From b34c02590a3253955c3f44a1cbbbf8ba2a786893 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 06 三月 2026 18:01:22 +0800
Subject: [PATCH] 回显问题
---
src/pages/inspectionUpload/index.vue | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/pages/inspectionUpload/index.vue b/src/pages/inspectionUpload/index.vue
index b6578e4..d77e951 100644
--- a/src/pages/inspectionUpload/index.vue
+++ b/src/pages/inspectionUpload/index.vue
@@ -153,7 +153,7 @@
style="margin-right: 5px;"></u-icon>
{{ uploading ? '涓婁紶涓�...' : '鎷嶇収' }}
</u-button>
- <u-button type="success"
+ <!-- <u-button type="success"
@click="chooseMedia('video')"
:loading="uploading"
:disabled="getCurrentFiles().length >= uploadConfig.limit"
@@ -164,7 +164,7 @@
color="#fff"
style="margin-right: 5px;"></uni-icons>
{{ uploading ? '涓婁紶涓�...' : '鎷嶈棰�' }}
- </u-button>
+ </u-button> -->
</view>
<!-- 涓婁紶杩涘害 -->
<view v-if="uploading"
@@ -210,7 +210,7 @@
</view>
<view v-if="getCurrentFiles().length === 0"
class="empty-state">
- <text>璇烽�夋嫨瑕佷笂浼犵殑{{ getUploadTypeText() }}鍥剧墖鎴栬棰�</text>
+ <text>璇烽�夋嫨瑕佷笂浼犵殑{{ getUploadTypeText() }}鍥剧墖</text>
</view>
<!-- 缁熻淇℃伅 -->
<!-- <view class="upload-summary">
@@ -281,8 +281,9 @@
class="attachment-item"
@click="previewAttachment(file)">
<view class="attachment-preview-container">
+ {{formatFileUrl(file.url || file.downloadUrl)}}
<image v-if="file.type === 'image' || isImageFile(file)"
- :src="file.url || file.downloadUrl"
+ :src="formatFileUrl(file.url || file.downloadUrl)"
class="attachment-preview"
mode="aspectFill" />
<view v-else
@@ -1589,7 +1590,19 @@
const uploadedSuccessfully = () => {
// 姝ゅ嚱鏁板凡涓嶅啀浣跨敤锛屾枃浠朵笂浼犳垚鍔熷悗绔嬪嵆娣诲姞鍒板搴斿垎绫�
};
-
+ // 鏍煎紡鍖栨枃浠禪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.baseUrl}/${relativePath}`;
+ }
+ return `${config.baseUrl}/${url}`;
+ };
// 鏍煎紡鍖栨枃浠跺ぇ灏�
const formatFileSize = size => {
if (!size) return "";
--
Gitblit v1.9.3