This commit is contained in:
yanran200730
2022-01-25 18:31:16 +08:00
parent e7b02865fc
commit 8a06bea864
2 changed files with 18 additions and 6 deletions

View File

@@ -360,11 +360,11 @@
} }
this.$nextTick(() => { this.$nextTick(() => {
this.autoScale()
if (level === '2') { if (level === '2') {
this.getUserList(id) this.getUserList(id)
} else { } else {
this.isLoading = false this.isLoading = false
this.autoScale()
} }
}) })
} }
@@ -399,8 +399,8 @@
label: '子节点', label: '子节点',
userList: userList || [] userList: userList || []
}, node) }, node)
this.$nextTick(() => { this.$nextTick(() => {
console.log('---------')
this.autoScale() this.autoScale()
}) })
} }
@@ -433,7 +433,19 @@
} }
}) : [] }) : []
userList = [...girdMemberManageList, ...girdMemberList] if (this.girdLevel === '2' && item.girdLevel === '2' && girdMemberList.length) {
userList = girdMemberManageList
item.girdList = [{
girdLevel: '2',
id: item.id,
isUser: false,
userList: girdMemberList,
label: item.girdName,
children: []
}]
} else {
userList = [...girdMemberManageList, ...girdMemberList]
}
if (!userList.length) { if (!userList.length) {
userList = [{ userList = [{
label: '-', label: '-',
@@ -445,14 +457,14 @@
const obj = { const obj = {
label: item.girdName, label: item.girdName,
id: item.id, id: `${new Date().getTime()}-${item.id}`,
girdLevel: item.girdLevel, girdLevel: item.girdLevel,
isUser: false, isUser: false,
userList: userList, userList: userList,
children: item.girdList || [] children: item.girdList || []
} }
if (obj.children && obj.children.length) { if (obj.children && obj.children.length && this.girdLevel !== '2') {
obj.children = this.formatList(obj.children) obj.children = this.formatList(obj.children)
} }
@@ -770,7 +782,7 @@
padding: 20px; padding: 20px;
overflow: hidden; overflow: hidden;
width: max-content; width: max-content;
height: inherit; height: 200%;
} }
::v-deep .org-chart-container { ::v-deep .org-chart-container {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 11 KiB