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 | 58 +++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/src/pages/equipmentManagement/upkeep/maintain.vue b/src/pages/equipmentManagement/upkeep/maintain.vue
index e6be078..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"
@@ -96,7 +96,7 @@
style="margin-right: 5px;"></u-icon>
{{ uploading ? '涓婁紶涓�...' : '鎷嶇収' }}
</u-button>
- <u-button type="success"
+ <!-- <u-button type="success"
@click="chooseMedia('video')"
:loading="uploading"
:disabled="uploadFiles.length >= uploadConfig.limit"
@@ -107,7 +107,7 @@
color="#fff"
style="margin-right: 5px;"></uni-icons>
{{ uploading ? '涓婁紶涓�...' : '鎷嶈棰�' }}
- </u-button>
+ </u-button> -->
</view>
<!-- 涓婁紶杩涘害 -->
<view v-if="uploading"
@@ -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'"
@@ -153,7 +154,7 @@
</view>
<view v-if="uploadFiles.length === 0"
class="empty-state">
- <text>璇烽�夋嫨瑕佷笂浼犵殑淇濆吇鍥剧墖鎴栬棰�</text>
+ <text>璇烽�夋嫨瑕佷笂浼犵殑淇濆吇鍥剧墖</text>
</view>
</view>
</u-form-item>
@@ -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