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/DeviceStructure/DeviceStructureTree.vue |   61 ++++++++----------------------
 1 files changed, 16 insertions(+), 45 deletions(-)

diff --git a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue
index 56c7ec9..1b86a5b 100644
--- a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue
+++ b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue
@@ -22,9 +22,9 @@
           <a-tree blockNode show-icon :expandedKeys.sync="expandedKeys"
                   :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent"
                   @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick">
-            <template slot="title" slot-scope="{ title, parentId, entity, key:treeKey,equipmentId}">
+            <template slot="title" slot-scope="{ title, parentId, entity, key:treeKey,equipmentId,type}">
               <DeviceStructureTreeContextMenu ref="contextMenuRef"
-                                              :treeParams="{title,treeKey,searchValue,equipmentId,entity}"/>
+                                              :treeParams="{title,treeKey,searchValue,equipmentId,entity,type,param:currentDeviceDocClassCode}"/>
             </template>
 
             <a-icon slot="switcherIcon" type="down"/>
@@ -34,6 +34,9 @@
         </div>
       </div>
     </a-spin>
+
+    <!--鏉冮檺閰嶇疆寮圭獥-->
+    <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="getTreeDataByApi"/>
   </a-card>
 </template>
 
@@ -41,10 +44,12 @@
   import { mapActions } from 'vuex'
   import { deleteAction } from '@/api/manage'
   import DeviceStructureTreeContextMenu from './DeviceStructureTreeContextMenu'
+  import AssignPermissionModal from './Permission/AssignPermissionModal'
 
   export default {
     name: 'DeviceStructureTree',
     components: {
+      AssignPermissionModal,
       DeviceStructureTreeContextMenu
     },
     data() {
@@ -62,6 +67,7 @@
         allTreeKeys: [],
         currentSelected: {},
         rightClickSelected: {},
+        currentDeviceDocClassCode: 'SEND',
         url: {
           delete: '/nc/product/delete'
         }
@@ -70,6 +76,7 @@
     created() {
       this.getTreeDataByApi()
       this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
+      this.$bus.$on('handleSwitchDeviceDocClassCode', this.setCurrentDeviceDocClassCode)
     },
     methods: {
       ...mapActions(['QueryProduction']),
@@ -94,6 +101,11 @@
         })
       },
 
+      setCurrentDeviceDocClassCode(documentActiveTabKey) {
+        if (documentActiveTabKey === 1) this.currentDeviceDocClassCode = 'SEND'
+        else this.currentDeviceDocClassCode = 'REC'
+      },
+
       /**
        * 鏍戣妭鐐归�変腑鏃惰Е鍙�
        * @param selectedKeys 閫変腑鑺傜偣key
@@ -114,50 +126,9 @@
        */
       handleTreeRightClick({ event, node }) {
         const record = node.dataRef
+        // 鑻ュ彸閿椂褰撳墠鍙充晶灞曠ず灞傜骇涓鸿澶囧眰绾т笖褰撳墠鍙抽敭鏍戝眰绾у悓涓鸿澶囧眰绾ф椂鍒欏湪瑙﹀彂鍙抽敭鑿滃崟鍔熻兘鏃跺悓鏃惰Е鍙戝乏閿�変腑鍔熻兘
+        if (this.currentSelected.type === 2 && record.type === 2) this.handleTreeSelect([record.key], { node })
         this.rightClickSelected = Object.assign({}, record)
-      },
-
-      // 鏍戣妭鐐瑰彸閿崟鍑昏彍鍗曚腑鍒犻櫎鎸夐挳鏃惰Е鍙�
-      handleDelete() {
-        this.$confirm({
-          title: '鎻愮ず',
-          content: '纭鍒犻櫎姝ゆ潯璁板綍鍚楋紵',
-          okText: '纭',
-          okType: 'danger',
-          cancelText: '鍙栨秷',
-          onOk: () => {
-            console.log('this.rightClickSelected.id', this.rightClickSelected.id)
-            if (!this.url.delete) {
-              this.$message.error('璇疯缃畊rl.delete灞炴��!')
-              return
-            }
-            const that = this
-            deleteAction(that.url.delete, { id: this.rightClickSelected.id })
-              .then((res) => {
-                if (res.success) {
-                  that.getTreeDataByApi()
-                  that.$notification.success({
-                    message: '娑堟伅',
-                    description: res.message
-                  })
-                } else {
-                  that.$notification.warning({
-                    message: '娑堟伅',
-                    description: res.message
-                  })
-                }
-              })
-          }
-        })
-      },
-
-      /**
-       * 鑷姩灞曞紑娣诲姞涓嬬骇鑺傜偣鐨勭埗鑺傜偣
-       */
-      modalFormSubmitSuccess(isAddNextLevel) {
-        // 鍒ゆ柇鏄惁涓烘坊鍔犱笅绾у苟涓斿垽鏂埗鑺傜偣鏄惁灞曞紑
-        if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id)
-        this.getTreeDataByApi()
       },
 
       /**

--
Gitblit v1.9.3