Merge branch 'main' into next

This commit is contained in:
GitHub Actions Bot 2024-08-17 09:39:24 +00:00
commit cd4b071831

View File

@ -78,13 +78,11 @@ export const useTableBlockProps = () => {
), ),
onChange: useCallback( onChange: useCallback(
({ current, pageSize }, filters, sorter) => { ({ current, pageSize }, filters, sorter) => {
const sort = !ctx.dragSort const sort = sorter.order
? sorter.order ? sorter.order === `ascend`
? sorter.order === `ascend` ? [sorter.field]
? [sorter.field] : [`-${sorter.field}`]
: [`-${sorter.field}`] : globalSort || ctx.dragSortBy;
: globalSort || ctx.dragSortBy
: ctx.dragSortBy;
const currentPageSize = pageSize || fieldSchema.parent?.['x-decorator-props']?.['params']?.pageSize; const currentPageSize = pageSize || fieldSchema.parent?.['x-decorator-props']?.['params']?.pageSize;
const args = { ...params?.[0], page: current || 1, pageSize: currentPageSize }; const args = { ...params?.[0], page: current || 1, pageSize: currentPageSize };
if (sort) { if (sort) {
@ -92,7 +90,7 @@ export const useTableBlockProps = () => {
} }
ctx.service.run(args); ctx.service.run(args);
}, },
[globalSort, params], [globalSort, params, ctx.dragSort],
), ),
onClickRow: useCallback( onClickRow: useCallback(
(record, setSelectedRow, selectedRow) => { (record, setSelectedRow, selectedRow) => {