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();
break;
case 'select':
const dataSource = store.getData(data);
const selected: Array<any> = [];
dataSource.items.forEach((item: any, rowIndex: number) => {
const flag = evalExpression(args?.selected, {record: item, rowIndex});
store.falttenedRows.forEach((item: any, rowIndex: number) => {
const record = item.data;
const flag = evalExpression(args?.selected, {record, rowIndex});
if (flag) {
selected.push(item);
selected.push(record);
}
});
store.updateSelected(selected, valueField);