mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 20:18:03 +08:00
crud 的 rowsDiff 带上行 id
This commit is contained in:
parent
ad0eb9176e
commit
5f27c95f32
@ -501,7 +501,14 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
replaceLocation: boolean = false,
|
||||
search: boolean = true
|
||||
) {
|
||||
const {store, syncLocation, env, pageField, perPageField, loadDataOnceFetchOnFilter} = this.props;
|
||||
const {
|
||||
store,
|
||||
syncLocation,
|
||||
env,
|
||||
pageField,
|
||||
perPageField,
|
||||
loadDataOnceFetchOnFilter
|
||||
} = this.props;
|
||||
values = syncLocation ? qs.parse(qsstringify(values)) : values;
|
||||
|
||||
store.updateQuery(
|
||||
@ -516,7 +523,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
perPageField
|
||||
);
|
||||
this.lastQuery = store.query;
|
||||
search && this.search(undefined, undefined, undefined, loadDataOnceFetchOnFilter);
|
||||
search &&
|
||||
this.search(undefined, undefined, undefined, loadDataOnceFetchOnFilter);
|
||||
}
|
||||
|
||||
handleBulkGo(
|
||||
@ -818,7 +826,15 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
|
||||
const data: any = createObject(store.data, {
|
||||
rows,
|
||||
rowsDiff: diff,
|
||||
rowsDiff: (diff as Array<any>).map((item: any, index: number) => {
|
||||
if (rows[index] && rows[index].hasOwnProperty(primaryField || 'id')) {
|
||||
item = {
|
||||
...item,
|
||||
[primaryField || 'id']: (rows[index] as any)[primaryField || 'id']
|
||||
};
|
||||
}
|
||||
return item;
|
||||
}),
|
||||
indexes: indexes,
|
||||
rowsOrigin
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user