From ab04ec484fb2907cb75608280dcd4d12aa48d073 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期六, 28 六月 2025 14:15:27 +0800
Subject: [PATCH] 详情文件下载

---
 laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue b/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue
index 2c4cbfc..a7bf0e6 100644
--- a/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue
+++ b/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue
@@ -55,7 +55,9 @@
                                 </div>
                             </div>
                             <el-form-item prop="name" style="margin-top: 18px">
-                                <el-upload action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList">
+                                <el-upload 
+                                :on-preview="handlePreview"
+                                action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList">
                                     <!-- <el-button size="small" type="primary">点击上传</el-button> -->
                                 </el-upload>
                             </el-form-item>
@@ -108,7 +110,7 @@
 import ApprovalProcess from '@/components/approvalProcess'
 import AiEditor from '@/components/AiEditor'
 import { getDetailInfo, getDetail, detailAuditReport } from '../../service'
-
+import apiConfig from '@/utils/baseurl';
 export default {
     name: "ApprovalDialog",
     components: {
@@ -168,6 +170,17 @@
         },
     },
     methods: {
+        handlePreview(file) {
+            console.log('url', file)
+            if (file && file.url) {
+                if (file.url && file.url.startsWith(apiConfig.showImgUrl)) {
+                    window.open(file.url, '_blank');
+                }else{
+                    let newUrl=apiConfig.showImgUrl+file.url;
+                    window.open(newUrl, '_blank');
+                }
+            }
+        },
         getDetailInfo() {
             getDetailInfo({ id: this.data.id }).then(res => {
                 if (res) {

--
Gitblit v1.7.1