| | |
| | | <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 |
| | |
| | | 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 |
| | |
| | | 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}`; |
| | | }; |
| | | |
| | | // 判断是否为图片文件 |
| | |
| | | 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)); |
| | | }; |
| | | |
| | | // 返回上一页 |