Commit 2343083f7d2912be1a2afd0c3f892ad6c62da208
1 parent
9e39b5b3
1.处理部件删除 多删除问题
Showing
1 changed file
with
2 additions
and
2 deletions
src/components/Manufacture/WorkOrderPackTableTreeNew/index.js
| @@ -3309,13 +3309,13 @@ const controlProps = props => { | @@ -3309,13 +3309,13 @@ const controlProps = props => { | ||
| 3309 | // 使用Set来记录已处理节点,防止循环引用 | 3309 | // 使用Set来记录已处理节点,防止循环引用 |
| 3310 | const processedNodes = new Set(); | 3310 | const processedNodes = new Set(); |
| 3311 | 3311 | ||
| 3312 | - const findChildren = (parentId, allNodes) => { | 3312 | + const findChildren = (parentId = '', allNodes) => { |
| 3313 | // 防止重复处理同一个父节点 | 3313 | // 防止重复处理同一个父节点 |
| 3314 | if (processedNodes.has(parentId)) return []; | 3314 | if (processedNodes.has(parentId)) return []; |
| 3315 | processedNodes.add(parentId); | 3315 | processedNodes.add(parentId); |
| 3316 | 3316 | ||
| 3317 | const children = allNodes.filter(node => | 3317 | const children = allNodes.filter(node => |
| 3318 | - node.sControlParentId === parentId && !processedNodes.has(node.sNodeId) | 3318 | + parentId && node.sControlParentId === parentId && !processedNodes.has(node.sNodeId) |
| 3319 | ); | 3319 | ); |
| 3320 | 3320 | ||
| 3321 | return children.concat( | 3321 | return children.concat( |