fix: 修复 crud 重置失效的问题 Close: #9686 (#9693)

This commit is contained in:
liaoxuezhi 2024-02-29 20:51:44 +08:00 committed by GitHub
parent 95f18c173a
commit b1252fe0c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -982,8 +982,13 @@ export default class CRUD extends React.Component<CRUDProps, any> {
handleFilterReset(values: object, action: any) {
const {store, syncLocation, env, pageField, perPageField} = this.props;
const resetQuery: any = {};
Object.keys(values).forEach(key => (resetQuery[key] = ''));
store.updateQuery(
store.pristineQuery,
{
...resetQuery,
...store.pristineQuery
},
syncLocation && env && env.updateLocation
? (location: any) => env.updateLocation(location)
: undefined,