fix: table的select动作判断falttenedRows进行选中,以便选中子节点 close:9714 (#9715)

This commit is contained in:
ranwawa 2024-03-05 21:13:58 +08:00 committed by GitHub
parent c3a7faf3f0
commit 1847bce588
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2774,12 +2774,12 @@ export default class Table extends React.Component<TableProps, object> {
store.clear(); store.clear();
break; break;
case 'select': case 'select':
const dataSource = store.getData(data);
const selected: Array<any> = []; const selected: Array<any> = [];
dataSource.items.forEach((item: any, rowIndex: number) => { store.falttenedRows.forEach((item: any, rowIndex: number) => {
const flag = evalExpression(args?.selected, {record: item, rowIndex}); const record = item.data;
const flag = evalExpression(args?.selected, {record, rowIndex});
if (flag) { if (flag) {
selected.push(item); selected.push(record);
} }
}); });
store.updateSelected(selected, valueField); store.updateSelected(selected, valueField);