mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
fix: 修复CRUD的filter中clearValueOnHidden字段使用上次保留值的问题 (#5896)
This commit is contained in:
parent
ec084e3b0b
commit
a03677616a
@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import {Renderer, RendererProps} from 'amis-core';
|
||||
import {SchemaNode, Schema, ActionObject, PlainObject} from 'amis-core';
|
||||
import {CRUDStore, ICRUDStore} from 'amis-core';
|
||||
@ -872,7 +873,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
}
|
||||
|
||||
handleFilterSubmit(
|
||||
values: object,
|
||||
values: Record<string, any>,
|
||||
jumpToFirstPage: boolean = true,
|
||||
replaceLocation: boolean = false,
|
||||
search: boolean = true
|
||||
@ -886,6 +887,14 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
loadDataOnceFetchOnFilter
|
||||
} = this.props;
|
||||
|
||||
/** 找出clearValueOnHidden的字段, 保证updateQuery时不会使用上次的保留值 */
|
||||
values = {
|
||||
...values,
|
||||
...pickBy(
|
||||
values?.__super?.diff ?? {},
|
||||
(value) => value === undefined
|
||||
)
|
||||
};
|
||||
values = syncLocation
|
||||
? qsparse(qsstringify(values, undefined, true))
|
||||
: values;
|
||||
|
Loading…
Reference in New Issue
Block a user