File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 // 特殊情况处理——有多个根节点
You can’t perform that action at this time.
0 commit comments