From 9e1e28591e0de5fa8f36abc144922e7809e60262 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 06 三月 2026 17:41:36 +0800
Subject: [PATCH] 图片预览问题
---
src/pages/equipmentManagement/upkeep/detail.vue | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/pages/equipmentManagement/upkeep/detail.vue b/src/pages/equipmentManagement/upkeep/detail.vue
index 3af1809..44ead77 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
@@ -200,9 +199,9 @@
const uploadsIndex = url.indexOf("uploads");
if (uploadsIndex !== -1) {
const relativePath = url.substring(uploadsIndex);
- return `${config.baseUrl}/profile/${relativePath}`;
+ return `${config.baseUrl}/${relativePath}`;
}
- return `${config.baseUrl}/profile/${url}`;
+ return `${config.baseUrl}/${url}`;
};
// 鍒ゆ柇鏄惁涓哄浘鐗囨枃浠�
@@ -257,7 +256,7 @@
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;
--
Gitblit v1.9.3