Skip to content

Commit ba97009

Browse files
author
liyuan-meng
committed
✨删除 console
1 parent 285076b commit ba97009

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

src/components/tree/store.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -81,44 +81,6 @@ class Store {
8181
tmp.isUnfold = true;
8282
}
8383

84-
if (pNode) {
85-
// 同级第一个节点
86-
tmp.isFirstChild = pNode.children[0].id === tmp.id;
87-
// 同级最后一个节点
88-
tmp.isLastChild = pNode.children[pNode.children?.length - 1].id === tmp.id;
89-
90-
const index = pNode.children.findIndex(item => item.id === tmp.id);
91-
if (index > -1 && index <= pNode?.children?.length - 2) {
92-
// 弟弟节点是否有儿子
93-
tmp.isSiblingHasChild = pNode?.children?.[index + 1]?.children?.length;
94-
}
95-
// 哥哥节点是否有儿子
96-
if (index > 0) {
97-
tmp.isPreSilbingHasChild = pNode?.children?.[index - 1]?.children?.length;
98-
}
99-
100-
const ppNode = this.findNodeById(cloneData, pNode.pId);
101-
if (ppNode) {
102-
// 父结点是否是最后一个节点
103-
tmp.isParentLastChild = ppNode?.children?.[ppNode.children?.length - 1]?.id === pNode?.id;
104-
105-
const index1 = ppNode.children.findIndex(item => item.id === pNode.id);
106-
if (index1 > -1) {
107-
// 父结点的弟弟节点是否有儿子
108-
tmp.isParentSiblingHasChild = ppNode?.children?.[index1 + 1]?.children?.length;
109-
110-
const pppNode = this.findNodeById(cloneData, ppNode.pId);
111-
if (pppNode) {
112-
const index2 = pppNode.children.findIndex(item => item.id === ppNode.id);
113-
if (index2 > -1) {
114-
// 父结点的父结点的弟弟节点是否有儿子
115-
tmp.isGrandParentSiblingHasChild = pppNode?.children?.[index1 + 1]?.children?.length;
116-
}
117-
}
118-
}
119-
}
120-
}
121-
12284
// 存在已选中节点,则根节点半选
12385
if (selectedValue && selectedValue.length && !pNode) {
12486
// 特殊情况处理——有多个根节点

0 commit comments

Comments
 (0)