|
|
@@ -278,11 +278,13 @@ const initParam = reactive({
|
|
|
storeId: localGet("createdId") || ""
|
|
|
});
|
|
|
|
|
|
-// 数据回调处理
|
|
|
+// 数据回调处理:兼容接口返回数组或 { records/list, total } 格式,确保有数据时分页显示正确总数
|
|
|
const dataCallback = (data: any) => {
|
|
|
+ const list = Array.isArray(data) ? data : (data?.records ?? data?.list ?? []);
|
|
|
+ const total = typeof data?.total === "number" ? data.total : list.length;
|
|
|
return {
|
|
|
- list: data || [],
|
|
|
- total: data?.total || 0
|
|
|
+ list,
|
|
|
+ total
|
|
|
};
|
|
|
};
|
|
|
|