From a8b84e0fb16f28b3a8a63ef6aa4bb7581b2f55ed Mon Sep 17 00:00:00 2001 From: v_yutyi Date: Fri, 14 Jul 2023 15:05:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A0=91=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=AD=90=E7=9B=AE=E5=BD=95=E5=B1=95=E5=BC=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/src/views/organization/mixin.js | 6 ------ src/pages/src/views/organization/tree/OrganizationTree.vue | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) 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">