From b39e0358272ba224a7659fa2ed262c00e790ff0b Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 09 三月 2026 14:26:04 +0800
Subject: [PATCH] 图片地址修正

---
 src/pages/equipmentManagement/upkeep/maintain.vue |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/src/pages/equipmentManagement/upkeep/maintain.vue b/src/pages/equipmentManagement/upkeep/maintain.vue
index b745e83..d3b8549 100644
--- a/src/pages/equipmentManagement/upkeep/maintain.vue
+++ b/src/pages/equipmentManagement/upkeep/maintain.vue
@@ -41,7 +41,7 @@
                  clearable />
       </u-form-item>
       <u-form-item label="淇濆吇鐘舵��"
-                   prop="status"
+                   prop="maintenancestatusText"
                    required
                    border-bottom>
         <u-input v-model="maintenancestatusText"
@@ -123,8 +123,9 @@
                   :key="index"
                   class="file-item">
               <view class="file-preview-container">
+                <!-- {{formatFileUrl(file.url)}} -->
                 <image v-if="file.type === 'image' || isImageFile(file)"
-                       :src="file.url || file.tempFilePath || file.path || file.downloadUrl"
+                       :src="formatFileUrl(file.url || file.tempFilePath || file.path || file.downloadUrl)"
                        class="file-preview"
                        mode="aspectFill" />
                 <view v-else-if="file.type === 'video'"
@@ -591,7 +592,6 @@
       await fetchSparePartOptions(pageId);
     }
     // 椤甸潰鏄剧ず鏃跺垵濮嬪寲琛ㄥ崟
-    initForm();
   });
   const sparePartOptions = ref([]);
   const fetchSparePartOptions = deviceLedgerId => {
@@ -634,26 +634,26 @@
   };
 
   // 鏍煎紡鍖栨枃浠禪RL
-  const formatFileUrl = url => {
-    if (!url) return "";
+  // const formatFileUrl = url => {
+  //   if (!url) return "";
 
-    // 濡傛灉宸茬粡鏄畬鏁寸殑URL锛坔ttp鎴杊ttps寮�澶达級锛岀洿鎺ヨ繑鍥�
-    if (url.startsWith("http://") || url.startsWith("https://")) {
-      return url;
-    }
+  //   // 濡傛灉宸茬粡鏄畬鏁寸殑URL锛坔ttp鎴杊ttps寮�澶达級锛岀洿鎺ヨ繑鍥�
+  //   if (url.startsWith("http://") || url.startsWith("https://")) {
+  //     return url;
+  //   }
 
-    // 濡傛灉鏄湰鍦拌矾寰勶紙濡� D:\\ruoyi\\prod\\uploads...锛夛紝闇�瑕佽浆鎹负缃戠粶URL
-    // 浠庤矾寰勪腑鎻愬彇uploads鍚庨潰鐨勯儴鍒�
-    const uploadsIndex = url.indexOf("uploads");
-    if (uploadsIndex !== -1) {
-      const relativePath = url.substring(uploadsIndex);
-      // 浣跨敤baseUrl + /profile/ + 鐩稿璺緞
-      return `http://192.168.1.35:8888/profile/${relativePath}`;
-    }
+  //   // 濡傛灉鏄湰鍦拌矾寰勶紙濡� D:\\ruoyi\\prod\\uploads...锛夛紝闇�瑕佽浆鎹负缃戠粶URL
+  //   // 浠庤矾寰勪腑鎻愬彇uploads鍚庨潰鐨勯儴鍒�
+  //   const uploadsIndex = url.indexOf("uploads");
+  //   if (uploadsIndex !== -1) {
+  //     const relativePath = url.substring(uploadsIndex);
+  //     // 浣跨敤baseUrl + /profile/ + 鐩稿璺緞
+  //     return `http://192.168.1.35:8888/profile/${relativePath}`;
+  //   }
 
-    // 鍏朵粬鎯呭喌锛屽皾璇曠洿鎺ユ嫾鎺�
-    return `http://192.168.1.35:8888/profile/${url}`;
-  };
+  //   // 鍏朵粬鎯呭喌锛屽皾璇曠洿鎺ユ嫾鎺�
+  //   return `http://192.168.1.35:8888/profile/${url}`;
+  // };
 
   // 鏍煎紡鍖栨枃浠跺ぇ灏�
   const formatFileSize = size => {
@@ -920,6 +920,18 @@
         uploadProgress.value = res.progress;
       });
     }
+  }; // 鏍煎紡鍖栨枃浠禪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.fileUrl}/${relativePath}`;
+    // }
+    return `${config.fileUrl}/${url}`;
   };
 
   // 涓婁紶鎴愬姛澶勭悊

--
Gitblit v1.9.3