From 6d229f92d2b5eee26a9499a842cc9ba128ee9999 Mon Sep 17 00:00:00 2001 From: yy2205 <2238220225@qq.com> Date: Fri, 23 May 2025 10:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=B6=EF=BC=8C=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=88=96pdf=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ECG/ECGForm.vue | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/views/ECG/ECGForm.vue b/src/views/ECG/ECGForm.vue index 94413d08..71d48b69 100644 --- a/src/views/ECG/ECGForm.vue +++ b/src/views/ECG/ECGForm.vue @@ -517,7 +517,7 @@
- +
+ + +
@@ -954,7 +967,15 @@ function print() { setTimeout(async () => { if (applyFormVO.value.pdfurl) { const fileUrl = applyFormVO.value.pdfurl.trim() - imagebase64_new.value = fileUrl + // 检查是否为PDF文件 + const isPdf = fileUrl.toLowerCase().endsWith('.pdf') + if (isPdf) { + // 如果是PDF,使用iframe显示 + imagebase64_new.value = fileUrl + } else { + // 如果是图片,使用el-image显示 + imagebase64_new.value = fileUrl + } } }, 100) })