From 08e52db54ce1e7563f1efe402a3f6c3931188013 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期五, 14 二月 2025 10:47:53 +0800
Subject: [PATCH] 产品结构树: 1、实现文档批量删除功能 2、实现文档列表的排序以及筛选功能 设备结构树: 1、新增权限配置弹窗,提交后由后端测试

---
 src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue |  112 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 91 insertions(+), 21 deletions(-)

diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
index 0847514..b0fecf4 100644
--- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
+++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue
@@ -12,6 +12,9 @@
     </a-tab-pane>
 
     <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/>
+
+    <DocumentBatchDeleteModal :currentDocumentInfo="currentRightClickedTableRowInfo" :size="tableContainerSize"
+                              @reloadDocumentListData="reloadDocumentListData" ref="documentBatchDeleteModalRef"/>
   </a-tabs>
 </template>
 
@@ -20,10 +23,11 @@
   import NcDocumentTableList from './Document/NcDocumentTableList'
   import OtherDocumentTableList from './Document/OtherDocumentTableList'
   import TableContextMenu from '../../../common/TableContextMenu'
+  import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal'
 
   export default {
     name: 'ProductStructureMainTop',
-    components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList },
+    components: { DocumentBatchDeleteModal, TableContextMenu, OtherDocumentTableList, NcDocumentTableList },
     data() {
       return {
         activeTabKey: 1,
@@ -86,13 +90,11 @@
         }
       },
 
-      /**
-       * 鐐瑰嚮涓嬭浇鏃惰Е鍙戜笅杞藉綋鍓嶆枃妗�
-       */
+      // 涓嬭浇褰撳墠鍙抽敭閫変腑鏂囨。
       handleDownload() {
         const that = this
         const { docId, docName } = this.currentRightClickedTableRowInfo
-        dncApi.downloadDocumentApi({ id: docId, docName })
+        dncApi.downloadDocumentApi({ docId, docName })
           .then(res => {
             if (res && !res.success) {
               that.$notification.error({
@@ -109,24 +111,65 @@
           })
       },
 
+      // 鍒犻櫎褰撳墠鍙抽敭閫変腑鏂囨。
+      handleDelete() {
+        const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
+        const that = this
+        that.$confirm({
+          title: '鎻愮ず',
+          content: `鍒犻櫎鍚庝笉鍙彇娑堬紝纭鍒犻櫎鍚楋紵`,
+          okText: '纭',
+          cancelText: '鍙栨秷',
+          onOk: () => {
+            dncApi.deleteDocumentApi(docId)
+              .then((res) => {
+                if (res.success) {
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.reloadDocumentListData({ docClassCode: param, attributionId })
+                } else {
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              })
+              .finally(() => {
+                that.$destroyAll()
+              })
+          },
+          onCancel: () => {
+            that.$destroyAll()
+          }
+        })
+      },
+
+      handleBatchRemove(modalTitle) {
+        if (!this.$refs.documentBatchDeleteModalRef) return
+        this.$refs.documentBatchDeleteModalRef.title = modalTitle
+        this.$refs.documentBatchDeleteModalRef.visible = true
+      },
+
       /**
-       * 鐐瑰嚮鍑哄簱鏃惰Е鍙戝綋鍓嶆枃妗e嚭搴�
+       * 鍑哄簱褰撳墠鍙抽敭閫変腑鏂囨。
        * @param menuLabel
        */
       handlePull(menuLabel) {
         const that = this
         const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo
-        this.$confirm({
+        that.$confirm({
           title: '鎻愮ず',
           content: `纭${menuLabel}鍚楋紵`,
           okText: '纭',
           cancelText: '鍙栨秷',
           onOk: () => {
-            dncApi.documentOutboundApi({ id: docId, docName })
+            dncApi.documentOutboundApi({ docId, docName })
               .then(res => {
                 console.log('res------------------', res)
                 if (res.success) {
-                  this.reloadDocumentListData({ docClassCode: param, attributionId })
+                  that.reloadDocumentListData({ docClassCode: param, attributionId })
                   that.$notification.success({
                     message: '娑堟伅',
                     description: `${menuLabel}鎴愬姛`
@@ -144,18 +187,24 @@
                   description: err.message
                 })
               })
+              .finally(() => {
+                that.$destroyAll()
+              })
+          },
+          onCancel: () => {
+            that.$destroyAll()
           }
         })
       },
 
       /**
-       * 鐐瑰嚮鍙栨秷鍑哄簱鏃惰Е鍙戝綋鍓嶆枃妗e彇娑堝嚭搴�
+       * 鍙栨秷鍑哄簱褰撳墠鍙抽敭閫変腑鏂囨。
        * @param menuLabel
        */
       handleCancelPull(menuLabel) {
         const that = this
         const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
-        this.$confirm({
+        that.$confirm({
           title: '鎻愮ず',
           content: `纭${menuLabel}鍚楋紵`,
           okText: '纭',
@@ -182,19 +231,24 @@
                   description: err.message
                 })
               })
+              .finally(() => {
+                that.$destroyAll()
+              })
+          },
+          onCancel() {
+            that.$destroyAll()
           }
         })
       },
 
-
       /**
-       * 鐐瑰嚮鍙戝竷鏃惰Е鍙戝綋鍓嶆枃妗e彂甯�
+       * 鍙戝竷褰撳墠鍙抽敭閫変腑鏂囨。
        * @param menuLabel
        */
       handlePublish(menuLabel) {
         const that = this
         const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
-        this.$confirm({
+        that.$confirm({
           title: '鎻愮ず',
           content: `纭${menuLabel}鍚楋紵`,
           okText: '纭',
@@ -222,18 +276,24 @@
                   description: err.message
                 })
               })
+              .finally(() => {
+                that.$destroyAll()
+              })
+          },
+          onCancel() {
+            that.$destroyAll()
           }
         })
       },
 
       /**
-       * 鐐瑰嚮閲嶆柊鍙戝竷鏃惰Е鍙戝綋鍓嶆枃妗i噸鏂板彂甯冮��鍥炰笂涓�鐗堟湰
+       * 閲嶆柊鍙戝竷褰撳墠鍙抽敭閫変腑鏂囨。骞堕噸鏂板彂甯冮��鍥炰笂涓�鏂囨。鐗堟湰
        * @param menuLabel
        */
       handleRepublish(menuLabel) {
         const that = this
         const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
-        this.$confirm({
+        that.$confirm({
           title: '鎻愮ず',
           content: `纭${menuLabel}鍚楋紵`,
           okText: '纭',
@@ -260,18 +320,24 @@
                   description: err.message
                 })
               })
+              .finally(() => {
+                that.$destroyAll()
+              })
+          },
+          onCancel() {
+            that.$destroyAll()
           }
         })
       },
 
       /**
-       * 鐐瑰嚮褰掓。鏃惰Е鍙戝綋鍓嶆枃妗e綊妗d笖鍚庣画鏃犳硶缁х画鍙戝竷鎴栧綊妗�
+       * 閲嶅綊妗e綋鍓嶅彸閿�変腑鏂囨。涓斿悗缁棤娉曠户缁彂甯冩垨褰掓。
        * @param menuLabel
        */
       handlePigeonhole(menuLabel) {
         const that = this
         const { docId, param, attributionId } = this.currentRightClickedTableRowInfo
-        this.$confirm({
+        that.$confirm({
           title: '鎻愮ず',
           content: `${menuLabel}鍚庝笉鍙彇娑堬紝纭${menuLabel}鍚楋紵`,
           okText: '纭',
@@ -298,13 +364,17 @@
                   description: err.message
                 })
               })
+              .finally(() => {
+                that.$destroyAll()
+              })
+          },
+          onCancel() {
+            that.$destroyAll()
           }
         })
       },
 
-      /**
-       * 鎺у埗鍙抽敭鑿滃崟鐐瑰嚮鍏抽棴
-       */
+      // 鎺у埗鍙抽敭鑿滃崟鍏抽棴
       handleMenuClose() {
         this.$refs.tableContextMenuRef.menuVisible = false
         document.body.removeEventListener('click', this.handleMenuClose)

--
Gitblit v1.9.3