From 68efd64847fe918d0d206aa89e21c971a3321fec Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 31 十二月 2025 10:41:04 +0800
Subject: [PATCH] 陕西昭德型煤: 1.现场巡检上传附件查看附件修改联调

---
 src/views/inspectionManagement/components/viewQrCodeFiles.vue |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/views/inspectionManagement/components/viewQrCodeFiles.vue b/src/views/inspectionManagement/components/viewQrCodeFiles.vue
index f8e923a..85350fc 100644
--- a/src/views/inspectionManagement/components/viewQrCodeFiles.vue
+++ b/src/views/inspectionManagement/components/viewQrCodeFiles.vue
@@ -95,15 +95,39 @@
 const cancel = () => {
   dialogVisitable.value = false;
 };
+// 鍩虹棰勮URL
+const BASE_PREVIEW_URL = 'https://nj477vg8876.vicp.fun';
+
 // 澶勭悊姣忎竴绫绘暟鎹細鍒嗙鍥剧墖鍜岃棰�
 function processItems(items) {
   const images = [];
   const videos = [];
+  if (!items || !Array.isArray(items)) {
+    return { images, videos };
+  }
   items.forEach(item => {
+    // 浣跨敤 fileUrl 瀛楁锛屽鏋滀笉瀛樺湪鍒欎娇鐢� url 瀛楁浣滀负鍏煎
+    const fileUrl = item.fileUrl || item.url;
+    if (!fileUrl) return;
+    
+    // 鏋勫缓瀹屾暣鐨勯瑙圲RL
+    let fullUrl = fileUrl;
+    // 濡傛灉 fileUrl 涓嶆槸瀹屾暣URL锛屽垯鎷兼帴鍩虹URL
+    if (!fileUrl.startsWith('http://') && !fileUrl.startsWith('https://')) {
+      // 纭繚璺緞浠� / 寮�澶�
+      const path = fileUrl.startsWith('/') ? fileUrl : `/${fileUrl}`;
+      fullUrl = `${BASE_PREVIEW_URL}${path}`;
+    }
+    
+    // 杈撳嚭鏈�缁堣矾寰勶紝鏂逛究璋冭瘯
+    console.log('鍘熷 fileUrl:', fileUrl);
+    console.log('鏈�缁堥瑙堣矾寰�:', fullUrl);
+    console.log('鏂囦欢绫诲瀷:', item.contentType);
+    
     if (item.contentType?.startsWith('image/')) {
-      images.push(item.url);
+      images.push(fullUrl);
     } else if (item.contentType?.startsWith('video/')) {
-      videos.push(item.url);
+      videos.push(fullUrl);
     }
   });
   return { images, videos };

--
Gitblit v1.9.3