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/detail.vue | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/pages/equipmentManagement/upkeep/detail.vue b/src/pages/equipmentManagement/upkeep/detail.vue
index 3af1809..1578097 100644
--- a/src/pages/equipmentManagement/upkeep/detail.vue
+++ b/src/pages/equipmentManagement/upkeep/detail.vue
@@ -80,8 +80,7 @@
<view v-for="(item, index) in sparePartsList"
:key="index"
class="spare-part-item">
- <text class="spare-part-name">{{ item.sparePartName || item.name || '-' }}</text>
- <text class="spare-part-code">{{ item.sparePartCode || item.code || '-' }}</text>
+ <text class="spare-part-name">{{ item || '-' }}</text>
</view>
</view>
<view v-else
@@ -107,7 +106,7 @@
class="file-item"
@click="previewFile(file)">
<image v-if="file.type.includes('image')"
- :src="file.url"
+ :src="formatFileUrl(file.url)"
class="file-preview"
mode="aspectFill" />
<view v-else
@@ -197,12 +196,12 @@
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}/profile/${relativePath}`;
- }
- return `${config.baseUrl}/profile/${url}`;
+ // const uploadsIndex = url.indexOf("uploads");
+ // if (uploadsIndex !== -1) {
+ // const relativePath = url.substring(uploadsIndex);
+ // return `${config.fileUrl}/${relativePath}`;
+ // }
+ return `${config.fileUrl}/${url}`;
};
// 鍒ゆ柇鏄惁涓哄浘鐗囨枃浠�
@@ -257,10 +256,11 @@
detailData.value = data;
pageId.value = data.id;
// 澶勭悊澶囦欢鏁版嵁 - 鏀寔澶氱鏁版嵁缁撴瀯
- sparePartsList.value = data.spareParts || data.sparePartList || [];
+ sparePartsList.value = data.sparePartsNames.split(",") || [];
// 澶勭悊闄勪欢鏁版嵁 - 鏀寔澶氱鏁版嵁缁撴瀯
console.log(data.imagesFile);
fileList.value = data.imagesFile;
+ console.log(formatFileUrl(fileList.value[0].url));
};
// 杩斿洖涓婁竴椤�
--
Gitblit v1.9.3