This commit is contained in:
2026-05-29 14:34:59 +08:00
parent ecc4295e40
commit 532bae8204
4 changed files with 32 additions and 5 deletions
@@ -82,7 +82,7 @@ layout("/layouts/platform.html"){
:expand-on-click-node="false"
:props="{ children: 'children', label: 'name' }"
node-key="id"
default-expand-all
:default-expanded-keys="firstLevelExpandedKeys"
@node-click="treeNodeClick"
:filter-node-method="filterNode"
highlight-current
@@ -157,6 +157,7 @@ layout("/layouts/platform.html"){
filterText: null,
currentTreeNode: null,
currentTreeData: null,
firstLevelExpandedKeys: [],
treeData: []
}
},
@@ -176,6 +177,10 @@ layout("/layouts/platform.html"){
this.treeData = res.data
if (this.treeData) {
this.currentTreeData = this.treeData[0]
// 默认只展开树的第一层级,避免多级单位数据一次性全部展开。
this.firstLevelExpandedKeys = this.treeData.map(function (item) {
return item.id
})
}
})
},