mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:36:44 +00:00
fix: missing pageSize parameters when setting column field sorting (#4219)
* fix: missing pageSize parameters when setting column field sorting * fix: missing pageSize parameters when setting column field sorting
This commit is contained in:
parent
f366c39fda
commit
964d631c1d
@ -16,6 +16,7 @@ export const useTableBlockProps = () => {
|
|||||||
const { getDataBlocks } = useFilterBlock();
|
const { getDataBlocks } = useFilterBlock();
|
||||||
const isLoading = ctx?.service?.loading;
|
const isLoading = ctx?.service?.loading;
|
||||||
const params = useMemo(() => ctx?.service?.params, [JSON.stringify(ctx?.service?.params)]);
|
const params = useMemo(() => ctx?.service?.params, [JSON.stringify(ctx?.service?.params)]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isLoading) {
|
if (!isLoading) {
|
||||||
const serviceResponse = ctx?.service?.data;
|
const serviceResponse = ctx?.service?.data;
|
||||||
@ -74,7 +75,8 @@ export const useTableBlockProps = () => {
|
|||||||
: [`-${sorter.field}`]
|
: [`-${sorter.field}`]
|
||||||
: globalSort || ctx.dragSortBy
|
: globalSort || ctx.dragSortBy
|
||||||
: ctx.dragSortBy;
|
: ctx.dragSortBy;
|
||||||
ctx.service.run({ ...params?.[0], page: current, pageSize, sort });
|
const currentPageSize = pageSize || fieldSchema.parent?.['x-decorator-props']?.['params']?.pageSize;
|
||||||
|
ctx.service.run({ ...params?.[0], page: current || 1, pageSize: currentPageSize, sort });
|
||||||
},
|
},
|
||||||
[globalSort, params],
|
[globalSort, params],
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user