1
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user