mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix: table的select动作判断falttenedRows进行选中,以便选中子节点 close:9714 (#9715)
This commit is contained in:
parent
c3a7faf3f0
commit
1847bce588
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user