通讯录-默认组织架构-默认打开一级

main
ysn 7 days ago
parent de98c91a68
commit 7c7a6b5904
  1. 15
      src/views/contacts/index.vue

@ -16,7 +16,7 @@
ref="orgTree"
:data="treeData"
:props="treeProps"
default-expand-all
:default-expanded-keys="defaultExpandedKeys"
highlight-current
node-key="id"
@node-click="handleNodeClick"
@ -143,6 +143,7 @@ export default {
return {
treeData: [],
treeProps: { label: "name", children: "child" },
defaultExpandedKeys: [],
currentGroupId: null,
currentStructureName: "",
memberList: [],
@ -200,7 +201,9 @@ export default {
async fetchOrgTree() {
try {
const { data } = await getGroupsList();
this.treeData =data.list
this.treeData = data.list;
//
this.defaultExpandedKeys = this.treeData.map((node) => node.id);
if (!this.userGroupId) return;
const parentKeys = this.findParentKeys(this.treeData, this.userGroupId);
this.$nextTick(() => {
@ -447,6 +450,14 @@ export default {
flex-shrink: 0;
}
}
.load-more {
padding: 12px;
text-align: center;
.loading-text {
font-size: 12px;
color: #909399;
}
}
}
}
//

Loading…
Cancel
Save