diff --git a/common/changes/@visactor/vtable/3645-bug-tree-node-move-position-error_2025-04-08-02-45.json b/common/changes/@visactor/vtable/3645-bug-tree-node-move-position-error_2025-04-08-02-45.json new file mode 100644 index 0000000000..be432b69f1 --- /dev/null +++ b/common/changes/@visactor/vtable/3645-bug-tree-node-move-position-error_2025-04-08-02-45.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: when move tree node position code occor error #3645 #3706\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file diff --git a/packages/vtable/src/state/checkbox/checkbox.ts b/packages/vtable/src/state/checkbox/checkbox.ts index 5e5878da2a..2b70d5a694 100644 --- a/packages/vtable/src/state/checkbox/checkbox.ts +++ b/packages/vtable/src/state/checkbox/checkbox.ts @@ -36,7 +36,7 @@ function setSingleCheckedState( const recordIndex = state.table.getRecordShowIndexByCell(col, row); if (recordIndex >= 0) { const dataIndex = state.table.dataSource.getIndexKey(recordIndex).toString(); - if (state.checkedState.has(dataIndex)) { + if (state.checkedState.get(dataIndex)) { state.checkedState.get(dataIndex)[field] = checked; } else { state.checkedState.set(dataIndex, { @@ -89,7 +89,7 @@ export function syncCheckedState( if (isValid(state.checkedState.get(dataIndex)?.[field])) { return state.checkedState.get(dataIndex)[field]; } - if (state.checkedState.has(dataIndex)) { + if (state.checkedState.get(dataIndex)) { state.checkedState.get(dataIndex)[field] = checked; } else if (dataIndex.includes(',')) { // child record, sync parent record state