From af85dd610f4a363abfb3e7ae26f1a3fcf06ee590 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 03 十一月 2026 10:20:31 +0800
Subject: [PATCH] feat(app): 移除 App 端全部附件上传、下载、预览功能

---
 src/pages/mes/pd/project/detail.vue |   40 ----------------------------------------
 1 files changed, 0 insertions(+), 40 deletions(-)

diff --git a/src/pages/mes/pd/project/detail.vue b/src/pages/mes/pd/project/detail.vue
index 511345b..89d5a63 100644
--- a/src/pages/mes/pd/project/detail.vue
+++ b/src/pages/mes/pd/project/detail.vue
@@ -57,7 +57,6 @@
   const docForm = ref<PdDocument>({ documentType: undefined, documentName: "", documentVersion: "", blobIds: [], remark: "" });
   const docEditingId = ref<number>();
   const docTypeVisible = ref(false);
-  const docAttachments = ref<Array<{ id?: number; name?: string; url?: string }>>([]);
 
   /* ---------- 璧勬枡瀹℃牳瀛愯〃 ---------- */
   const audits = ref<PdDocumentAudit[]>([]);
@@ -171,7 +170,6 @@
     docForm.value = row
       ? { ...row, blobIds: row.blobIds ?? [] }
       : { documentType: undefined, documentName: "", documentVersion: project.value.version || "", blobIds: [], remark: "" };
-    docAttachments.value = (row?.attachmentList ?? []).map(item => ({ id: item.id, name: item.name, url: item.url }));
     docVisible.value = true;
   }
 
@@ -199,8 +197,6 @@
         ...docForm.value,
         projectId: projectId.value,
         blobIds: docForm.value.blobIds ?? [],
-        fileName: docAttachments.value[0]?.name,
-        fileUrl: docAttachments.value[0]?.url,
       };
       if (docEditingId.value) {
         await updatePdDocument(state.accessToken, { ...payload, id: docEditingId.value });
@@ -228,41 +224,6 @@
     } catch (error) {
       toast(error instanceof Error ? error.message : "鍒犻櫎澶辫触");
     }
-  }
-
-  /** 棰勮璧勬枡鏂囦欢锛欻5 鏂扮獥鍙f墦寮�锛涘皬绋嬪簭/App 涓嬭浇鍚庤皟鐢ㄧ郴缁熸墦寮� */
-  function previewDoc(row: PdDocument) {
-    if (!row.fileUrl) {
-      toast("璇ヨ祫鏂欐殏鏃犳枃浠�");
-      return;
-    }
-    const url = row.fileUrl;
-    // #ifdef H5
-    window.open(url, "_blank");
-    // #endif
-    // #ifndef H5
-    uni.showLoading({ title: "鎵撳紑涓��", mask: true });
-    uni.downloadFile({
-      url,
-      success: res => {
-        if (res.statusCode !== 200) {
-          toast("鏂囦欢涓嬭浇澶辫触");
-          return;
-        }
-        uni.openDocument({
-          filePath: res.tempFilePath,
-          showMenu: true,
-          fail: () => {
-            uni.setClipboardData({ data: url, success: () => toast("鏂囦欢閾炬帴宸插鍒�") });
-          },
-        });
-      },
-      fail: () => {
-        uni.setClipboardData({ data: url, success: () => toast("鏂囦欢閾炬帴宸插鍒�") });
-      },
-      complete: () => uni.hideLoading(),
-    });
-    // #endif
   }
 
   /* ---------- 璧勬枡瀹℃牳 ---------- */
@@ -515,7 +476,6 @@
               <text>涓婁紶鏃堕棿锛歿{ dateTimeText(row.uploadTime) }}</text>
             </view>
             <view class="actions">
-              <button v-if="row.fileUrl" @click="previewDoc(row)">棰勮</button>
               <button v-if="docEditable" @click="openDocForm(row)">缂栬緫</button>
               <button v-if="docEditable" class="danger" @click="removeDoc(row)">鍒犻櫎</button>
             </view>

--
Gitblit v1.9.3