Browse Source

优化:组织树优化

GDW 2 weeks ago
parent
commit
a141c0ec61

+ 7 - 2
jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue

@@ -57,6 +57,7 @@
           v-model:expandedKeys="expandedKeys"
           @check="onCheck"
           @select="onSelect"
+          @expand="onExpand"
         >
           <template #title="{ key: treeKey, title, dataRef }">
             <a-dropdown :trigger="['contextmenu']">
@@ -208,7 +209,7 @@ import {inject, nextTick, ref, unref, watch} from 'vue';
             //选中全部子节点
             checkedKeys.value.push(resultElement.key)
           }
-        onExpand()
+        expandNode()
       }
       emit('rootTreeData', treeData.value);
     } catch (e) {
@@ -322,7 +323,7 @@ import {inject, nextTick, ref, unref, watch} from 'vue';
     }
   }
   //展开子节点
-  function onExpand() {
+  function expandNode() {
     needExpand.value.forEach((item) => {
       expandedKeys.value.push(item)
     })
@@ -456,6 +457,10 @@ import {inject, nextTick, ref, unref, watch} from 'vue';
     handleExportXls('部门信息', Api.exportXlsUrl);
   }
 
+  function onExpand() {
+    isUnfold.value = false
+  }
+
   //setup生命周期
   loadRootTreeData();