diff --git a/src/pages/src/views/organization/mixin.js b/src/pages/src/views/organization/mixin.js index 15b1c594b..08d270c34 100644 --- a/src/pages/src/views/organization/mixin.js +++ b/src/pages/src/views/organization/mixin.js @@ -14,9 +14,6 @@ export default { item.showChildren = !item.showChildren; } this.isAddChild = false; - if (item.children === null) { - this.$set(item, 'children', []); - } item.children = res.data.children; item.children.forEach((element) => { this.filterTreeData(element, item, item.isLocalDepartment); @@ -33,9 +30,6 @@ export default { if (tree.type) { this.$set(tree, 'has_children', !!tree.departments.length); } - if (!Object.prototype.hasOwnProperty.call(tree, 'children')) { - this.$set(tree, 'children', []); - } // 组织节点添加一个类型标记 if (isLocalDepartment !== null) { tree.isLocalDepartment = isLocalDepartment; diff --git a/src/pages/src/views/organization/tree/OrganizationTree.vue b/src/pages/src/views/organization/tree/OrganizationTree.vue index 38d67f1ef..51c1496af 100644 --- a/src/pages/src/views/organization/tree/OrganizationTree.vue +++ b/src/pages/src/views/organization/tree/OrganizationTree.vue @@ -20,7 +20,8 @@ :tpl="tpl" :show-icon="false" @on-expanded="handleClickToggle" - @on-drag-node="handleDragNode"> + @on-drag-node="handleDragNode" + @async-load-nodes="handleClickToggle">