This commit is contained in:
Flow 2025-08-14 15:23:54 +08:00
parent 27a821e585
commit 19ea04b0b2

View File

@ -1465,44 +1465,32 @@ const handleApply = async (row) => {
/** 查看报告 */
const handleViewReport = async (row) => {
try {
//
const loading = ElLoading.service({
lock: true,
text: '正在加载报告...',
background: 'rgba(0, 0, 0, 0.8)'
//
const result = await EcgworkstationApi.getPdfUrl({
orgid: row.orgid,
examid: row.examid
})
try {
//
const result = await EcgworkstationApi.getPdfUrl({
orgid: row.orgid,
examid: row.examid
// APIURLdata
let pdfUrl = ''
if (typeof result === 'string') {
// APIURL
pdfUrl = result.replace(/`/g, '').trim()
} else if (result && result.data) {
// APIdataURL
pdfUrl = result.data.replace(/`/g, '').trim()
}
if (pdfUrl) {
//
openReportWindow(pdfUrl, row)
} else {
console.warn('API返回数据异常:', {
result,
resultType: typeof result,
hasData: !!result?.data
})
// APIURLdata
let pdfUrl = ''
if (typeof result === 'string') {
// APIURL
pdfUrl = result.replace(/`/g, '').trim()
} else if (result && result.data) {
// APIdataURL
pdfUrl = result.data.replace(/`/g, '').trim()
}
if (pdfUrl) {
console.log('处理后的PDF URL:', pdfUrl)
//
openReportWindow(pdfUrl, row)
} else {
console.warn('API返回数据异常:', {
result,
resultType: typeof result,
hasData: !!result?.data
})
ElMessage.warning('报告未生成或查询失败')
}
} finally {
loading.close()
ElMessage.warning('报告未生成或查询失败')
}
} catch (error) {
console.error('查询报告失败:', error)