Skip to content

Commit

Permalink
fix: 修复树组件子目录展开问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 authored and EmilyMei committed Jul 14, 2023
1 parent 5437632 commit a8b84e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/pages/src/views/organization/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/pages/src/views/organization/tree/OrganizationTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
:tpl="tpl"
:show-icon="false"
@on-expanded="handleClickToggle"
@on-drag-node="handleDragNode">
@on-drag-node="handleDragNode"
@async-load-nodes="handleClickToggle">
</bk-tree>
<div class="bottom-tree" @click="clickBottomTree" ref="bottomTree" style="bottomTreeStyle">
<p :class="['bottom-tree-header', { 'show-header': isDirectory }]" @click="handleClickDirectory">
Expand Down

0 comments on commit a8b84e0

Please sign in to comment.