From 2f7b6ebf7a5b0222512d718b229e078e7ac3e747 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 21 五月 2026 10:27:30 +0800
Subject: [PATCH] 阳光彩印 1.web端设备巡检要求也可以上传图片

---
 src/views/equipmentManagement/inspectionManagement/components/uploadFiles.vue |   63 +++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/src/views/equipmentManagement/inspectionManagement/components/uploadFiles.vue b/src/views/equipmentManagement/inspectionManagement/components/uploadFiles.vue
index a907b61..472bf99 100644
--- a/src/views/equipmentManagement/inspectionManagement/components/uploadFiles.vue
+++ b/src/views/equipmentManagement/inspectionManagement/components/uploadFiles.vue
@@ -383,6 +383,55 @@
   }));
 };
 
+const buildSubmitFileItem = item => {
+  if (!item) return null;
+
+  return {
+    id: item.id,
+    tempId: item.tempId,
+    tempFileId: item.tempFileId,
+    type: item.type,
+    url: item?.downloadUrl || item?.url || "",
+    downloadUrl: item?.downloadUrl || item?.url || "",
+    bucketFilename: item.bucketFilename,
+    originalFilename: item.originalFilename,
+    size: item.size,
+    byteSize: item.byteSize,
+    contentType: item.contentType,
+  };
+};
+
+const buildGroupedFiles = list => {
+  return (list || []).map(buildSubmitFileItem).filter(Boolean);
+};
+
+const buildSubmitPayload = () => {
+  const {
+    createTime,
+    updateTime,
+    storageBlobDTO,
+    commonFileListBefore,
+    commonFileListAfter,
+    commonFileList,
+    __raw,
+    ...rest
+  } = currentTask.value || {};
+
+  const files = buildSubmitFiles();
+  const tempFileIds = files
+    .map(item => item?.tempId ?? item?.tempFileId ?? item?.id)
+    .filter(Boolean);
+
+  return {
+    ...rest,
+    hasException: hasException.value,
+    tempFileIds,
+    commonFileListBefore: buildGroupedFiles(beforeModelValue.value),
+    commonFileListAfter: buildGroupedFiles(afterModelValue.value),
+    commonFileList: buildGroupedFiles(issueModelValue.value),
+  };
+};
+
 const submitUpload = async () => {
   if (hasException.value === null) {
     ElMessage.warning("璇烽�夋嫨鏄惁瀛樺湪寮傚父");
@@ -401,19 +450,7 @@
   });
 
   try {
-    const tempFileIds = files
-      .map(item => item?.tempId ?? item?.tempFileId ?? item?.id)
-      .filter(Boolean);
-
-    const payload = {
-      ...currentTask.value,
-      hasException: hasException.value,
-      storageBlobDTO: files,
-      tempFileIds,
-      commonFileListBefore: beforeModelValue.value,
-      commonFileListAfter: afterModelValue.value,
-      commonFileList: issueModelValue.value,
-    };
+    const payload = buildSubmitPayload();
 
     const result = await uploadInspectionTask(payload);
     if (result?.code === 200 || result?.success) {

--
Gitblit v1.9.3