mirror of
https://gitee.com/nicefold/seewis-soybean-plus.git
synced 2026-10-14 10:02:13 +08:00
fix(table): 修复分页数据处理逻辑
- 修复 pageSize 赋值前增加空值检查,避免引起数据二次查询 - 修正分页参数解构顺序,避免数据错乱
This commit is contained in:
@@ -131,7 +131,9 @@ export function useNaivePaginatedTable<ResponseData, ApiData>(
|
|||||||
getColumns,
|
getColumns,
|
||||||
onFetched: data => {
|
onFetched: data => {
|
||||||
pagination.itemCount = data.total;
|
pagination.itemCount = data.total;
|
||||||
pagination.pageSize = data.pageSize;
|
if (data.pageSize) {
|
||||||
|
pagination.pageSize = data.pageSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -252,7 +254,7 @@ export function defaultTransform<ApiData>(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const { rows: records, pageSize: current, pageNum: size, total } = data;
|
const { rows: records, pageSize: size, pageNum: current, total } = data;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data: records,
|
data: records,
|
||||||
|
|||||||
Reference in New Issue
Block a user