From 9c377c0a4004deea4c8dc45f5ba8a874b0d59042 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 09 三月 2026 13:44:32 +0800
Subject: [PATCH] fix: web端隐患上报已整改操作完,APP端隐患上报还可以继续整改

---
 src/pages/inspectionUpload/index.vue |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/pages/inspectionUpload/index.vue b/src/pages/inspectionUpload/index.vue
index 158441e..d77e951 100644
--- a/src/pages/inspectionUpload/index.vue
+++ b/src/pages/inspectionUpload/index.vue
@@ -281,8 +281,9 @@
                       class="attachment-item"
                       @click="previewAttachment(file)">
                   <view class="attachment-preview-container">
+                    {{formatFileUrl(file.url || file.downloadUrl)}}
                     <image v-if="file.type === 'image' || isImageFile(file)"
-                           :src="file.url || file.downloadUrl"
+                           :src="formatFileUrl(file.url || file.downloadUrl)"
                            class="attachment-preview"
                            mode="aspectFill" />
                     <view v-else
@@ -1589,7 +1590,19 @@
   const uploadedSuccessfully = () => {
     // 姝ゅ嚱鏁板凡涓嶅啀浣跨敤锛屾枃浠朵笂浼犳垚鍔熷悗绔嬪嵆娣诲姞鍒板搴斿垎绫�
   };
-
+  // 鏍煎紡鍖栨枃浠禪RL
+  const formatFileUrl = url => {
+    if (!url) return "";
+    if (url.startsWith("http://") || url.startsWith("https://")) {
+      return url;
+    }
+    const uploadsIndex = url.indexOf("uploads");
+    if (uploadsIndex !== -1) {
+      const relativePath = url.substring(uploadsIndex);
+      return `${config.baseUrl}/${relativePath}`;
+    }
+    return `${config.baseUrl}/${url}`;
+  };
   // 鏍煎紡鍖栨枃浠跺ぇ灏�
   const formatFileSize = size => {
     if (!size) return "";

--
Gitblit v1.9.3