From 2ceb99a629b70a3d63154656b534dcc603af78e7 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期五, 14 二月 2025 13:55:45 +0800
Subject: [PATCH] 1、调整产品和设备结构树权限配置分配用户时,admin只有在分配后或者有权限时才会被禁用

---
 src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
index 5a995f9..ae81024 100644
--- a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
+++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
@@ -24,7 +24,7 @@
 
         <!--浜у搧缁撴瀯鏍�-->
         <div style="flex: 1;overflow:auto;margin-top: 10px">
-          <a-tree ref="tree" show-icon :expandedKeys.sync="expandedKeys"
+          <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="{ label, parentId, entity, key:treeKey,type}">
@@ -151,34 +151,40 @@
 
       // 鏍戣妭鐐瑰彸閿崟鍑昏彍鍗曚腑鍒犻櫎鎸夐挳鏃惰Е鍙�
       handleDelete() {
-        this.$confirm({
+        const that = this
+        const { rightClickSelected: { id, type }, $confirm, url, $notification } = that
+        $confirm({
           title: '鎻愮ず',
           content: '纭鍒犻櫎姝ゆ潯璁板綍鍚楋紵',
           okText: '纭',
           okType: 'danger',
           cancelText: '鍙栨秷',
           onOk: () => {
-            console.log('this.rightClickSelected.id', this.rightClickSelected.id)
-            if (!this.url.delete) {
+            if (!url.delete) {
               this.$message.error('璇疯缃畊rl.delete灞炴��!')
               return
             }
-            const that = this
-            deleteAction(that.url.delete, { id: this.rightClickSelected.id })
+            deleteAction(url.delete + `/${id}/${type}`)
               .then((res) => {
                 if (res.success) {
                   that.getTreeDataByApi()
-                  that.$notification.success({
+                  $notification.success({
                     message: '娑堟伅',
                     description: res.message
                   })
                 } else {
-                  that.$notification.warning({
+                  $notification.warning({
                     message: '娑堟伅',
                     description: res.message
                   })
                 }
               })
+              .finally(() => {
+                that.$destroyAll()
+              })
+          },
+          onCancel: () => {
+            that.$destroyAll()
           }
         })
       },
@@ -298,10 +304,6 @@
 
   /deep/ .ant-card-body, /deep/ .ant-spin-nested-loading, /deep/ .ant-spin-container {
     height: 100%;
-  }
-
-  /deep/ .ant-tree-node-content-wrapper {
-    width: calc(100% - 24px);
   }
 
   /deep/ .ant-tree-title, .ant-tree-title .ant-dropdown-trigger {

--
Gitblit v1.9.3