Skip to content

Commit

Permalink
fix: table的select动作判断falttenedRows进行选中,以便选中子节点 close:9714 (baidu#9715)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranwawa committed Mar 5, 2024
1 parent c3a7faf commit 1847bce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/amis/src/renderers/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1847bce

Please sign in to comment.