fix: pageSize 200 & not a function (#1299)
This commit is contained in:
parent
7bfd8ea05b
commit
07a01fc507
@ -17,10 +17,21 @@ export type SharedFilterContextValue = {
|
||||
getFilterParams: (filterStore?: SharedFilterStore) => any;
|
||||
};
|
||||
|
||||
export const getFilterParams = (filterStore?: SharedFilterStore) => {
|
||||
const newAssociationFilterList = Object.entries(filterStore).map(([key, filter]) => filter);
|
||||
const newAssociationFilter = newAssociationFilterList.length
|
||||
? {
|
||||
$and: newAssociationFilterList,
|
||||
}
|
||||
: {};
|
||||
|
||||
return newAssociationFilter;
|
||||
};
|
||||
|
||||
export const SharedFilterContext = createContext<SharedFilterContextValue>({
|
||||
sharedFilterStore: {},
|
||||
setSharedFilterStore: undefined!,
|
||||
getFilterParams: undefined!,
|
||||
setSharedFilterStore: () => {},
|
||||
getFilterParams,
|
||||
});
|
||||
|
||||
export const concatFilter = (f1: SharedFilter, f2: SharedFilter): SharedFilter => {
|
||||
@ -39,23 +50,14 @@ export const SharedFilterProvider: FC<{ params?: any }> = (props) => {
|
||||
setSharedFilterStoreUnwrap(associationFilter);
|
||||
};
|
||||
|
||||
const getFilterParams = (filterStore?: SharedFilterStore) => {
|
||||
const newAssociationFilterList = Object.entries(filterStore ?? sharedFilterStore).map(([key, filter]) => filter);
|
||||
const newAssociationFilter = newAssociationFilterList.length
|
||||
? {
|
||||
$and: newAssociationFilterList,
|
||||
}
|
||||
: {};
|
||||
|
||||
return newAssociationFilter;
|
||||
};
|
||||
const getFilterParamsWrap = (filterStore?: SharedFilterStore) => getFilterParams(filterStore ?? sharedFilterStore);
|
||||
|
||||
return (
|
||||
<SharedFilterContext.Provider
|
||||
value={{
|
||||
sharedFilterStore,
|
||||
setSharedFilterStore,
|
||||
getFilterParams,
|
||||
getFilterParams: getFilterParamsWrap,
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
|
@ -43,6 +43,8 @@ export const AssociationFilterItem = (props) => {
|
||||
action: 'list',
|
||||
params: {
|
||||
fields: [labelKey, valueKey],
|
||||
pageSize: 200,
|
||||
page: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -89,7 +91,7 @@ export const AssociationFilterItem = (props) => {
|
||||
|
||||
const paramFilter = getFilterParams(newAssociationFilterStore);
|
||||
|
||||
service.run({ ...service.params?.[0], page: 1, filter: paramFilter });
|
||||
service.run({ ...service.params?.[0], pageSize: 200, page: 1, filter: paramFilter });
|
||||
};
|
||||
|
||||
const handleSearchToggle = (e: MouseEvent) => {
|
||||
@ -179,7 +181,7 @@ export const AssociationFilterItem = (props) => {
|
||||
className={css`
|
||||
& .ant-collapse-content-box {
|
||||
padding: 0 8px !important;
|
||||
max-height: 200px;
|
||||
max-height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
& .ant-collapse-header {
|
||||
|
Loading…
Reference in New Issue
Block a user