@@ -11,7 +11,7 @@ export function flattenTreeData(treeNodeList: TreeItemProps[] = [], expandedKeys
1111 //递归遍历每一个节点
1212 function dig ( list : DataNode [ ] , parent : FlattenNode | null = null , show ?: boolean ) : FlattenNode [ ] {
1313 return list . map ( ( treeNode ) => {
14- const mergedKey = treeNode . key ;
14+ const mergedKey = treeNode . value ;
1515
1616 const flattenNode : FlattenNode = {
1717 ...treeNode ,
@@ -81,18 +81,18 @@ export function getTreeNodeLevel(treeData: TreeItemProps[] = []) {
8181 const children = node ? node . children : treeData ;
8282
8383 if ( node ) {
84- nodeLevel [ node . key ] = {
84+ nodeLevel [ node . value ] = {
8585 level : parent ? parent . level + 1 : 0 ,
8686 parent : parent ,
8787 children : children ,
8888 data : node ,
89- key : node . key ,
89+ value : node . value ,
9090 } ;
9191 }
9292
9393 if ( children ) {
9494 children . forEach ( ( subNode ) => {
95- processNode ( subNode as TreeItemProps , node ? nodeLevel [ node ?. key ] : null ) ;
95+ processNode ( subNode as TreeItemProps , node ? nodeLevel [ node ?. value ] : null ) ;
9696 } ) ;
9797 }
9898 }
@@ -114,7 +114,7 @@ function fillConductCheck(keys: Set<string>, levelEntities: Map<number, Set<Enti
114114
115115 if ( checkedKeys . has ( key ) ) {
116116 children ?. forEach ( ( childEntity ) => {
117- checkedKeys . add ( childEntity . key ) ;
117+ checkedKeys . add ( childEntity . value ) ;
118118 } ) ;
119119 }
120120 } ) ;
@@ -129,18 +129,18 @@ function fillConductCheck(keys: Set<string>, levelEntities: Map<number, Set<Enti
129129
130130 let allChecked = true ;
131131
132- ( parent ?. children || [ ] ) . forEach ( ( { key } ) => {
133- const checked = checkedKeys . has ( key ) ;
132+ ( parent ?. children || [ ] ) . forEach ( ( { value } ) => {
133+ const checked = checkedKeys . has ( value ) ;
134134 if ( allChecked && ! checked ) {
135135 allChecked = false ;
136136 }
137137 } ) ;
138138
139139 if ( allChecked ) {
140- checkedKeys . add ( parent . key ) ;
140+ checkedKeys . add ( parent . value ) ;
141141 }
142142
143- visitedKeys . add ( parent . key ) ;
143+ visitedKeys . add ( parent . value ) ;
144144 } ) ;
145145 }
146146
@@ -161,7 +161,7 @@ function cleanConductCheck(keys: Set<string>, levelEntities: Map<number, Set<Ent
161161
162162 if ( ! checkedKeys . has ( key ) ) {
163163 children ?. forEach ( ( childEntity ) => {
164- checkedKeys . delete ( childEntity . key ) ;
164+ checkedKeys . delete ( childEntity . value ) ;
165165 } ) ;
166166 }
167167 } ) ;
@@ -177,18 +177,18 @@ function cleanConductCheck(keys: Set<string>, levelEntities: Map<number, Set<Ent
177177
178178 let allChecked = true ;
179179
180- ( parent . children || [ ] ) . forEach ( ( { key } ) => {
181- const checked = checkedKeys . has ( key ) ;
180+ ( parent . children || [ ] ) . forEach ( ( { value } ) => {
181+ const checked = checkedKeys . has ( value ) ;
182182 if ( allChecked && ! checked ) {
183183 allChecked = false ;
184184 }
185185 } ) ;
186186
187187 if ( ! allChecked ) {
188- checkedKeys . delete ( parent . key ) ;
188+ checkedKeys . delete ( parent . value ) ;
189189 }
190190
191- visitedKeys . add ( parent . key ) ;
191+ visitedKeys . add ( parent . value ) ;
192192 } ) ;
193193 }
194194
0 commit comments