From fc7f59bcd94cebfcc3b2a1278984a3bb7b39edaa Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期二, 22 十月 2024 18:12:20 +0800
Subject: [PATCH] 功能模板树节点操作后局部刷新

---
 Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue
index d387f92..4c265d2 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue
@@ -111,7 +111,6 @@
     this.getTypeList();
   },
   methods: {
-
     getTreeList() {
       const loading = this.$loading({});
       gridRoles().then(res => {
@@ -173,14 +172,12 @@
       if (obj.checked === true) {
         result.push(obj.oid);
       }
-
       // 濡傛灉鏈� children锛屽垯缁х画閬嶅巻
       if (obj.children && obj.children.length > 0) {
         obj.children.forEach(child => {
           this.findCheckedOids(child, result);
         });
       }
-
       return result;
     },
 
@@ -188,7 +185,7 @@
     processChildren(item) {
       if (item.children && item.children.length > 0) {
         item.children = item.children.map(child => {
-          if (child.level < 2) {
+          if (child.level < 3) {
             // 榛樿鏍戣妭鐐瑰睍寮�涓ゅ眰鏁堟灉
             this.defaultExpandKeys.push(child.oid)
           }
@@ -243,10 +240,36 @@
 
     saveHandler() {
       const selectTreeList = this.$refs.uiTree.getCheckedNodes();
+      const selectParentList = this.$refs.uiTree.getHalfCheckedNodes();
       if (selectTreeList.length == 0) {
         this.$message.error("璇烽�夋嫨鍔熻兘妯″潡");
         return;
       }
+      const selectTreeData = selectTreeList.map(item => {
+        return {
+          checked: true,
+          expanded: true,
+          data:item.data,
+          level: item.level,
+          oid: item.oid,
+          text: item.text
+        }
+      })
+
+      // const parentData = selectParentList.map(item => {
+      //   return {
+      //     checked: false,
+      //     expanded: true,
+      //     data:item.data,
+      //     level: item.level,
+      //     oid: item.oid,
+      //     text: item.text
+      //   }
+      // })
+      // // 鍦ㄥ崐閫夌姸鎬佷腑杩囨护鎺夐《绾ц妭鐐� oid 涓� root
+      // const filterSelectTreeData = parentData.filter(item => item.oid !== 'root');
+
+      const data = [...selectTreeData];
       const formData = {
         roleId: this.nodeRow.oid,
         type: this.type,

--
Gitblit v1.9.3