refactor: 分页响应数据结构调整

This commit is contained in:
Ray.Hao
2026-02-11 22:33:33 +08:00
parent 6f4e4eb6d6
commit 3a35b24476
6 changed files with 21 additions and 31 deletions

View File

@@ -149,8 +149,8 @@ const contentConfig = reactive({
// 数据解析函数
parseData(res) {
return {
total: res?.page?.total ?? 0,
list: res?.data ?? [],
total: res?.total ?? 0,
list: res?.list ?? [],
};
},
// 分页配置

View File

@@ -314,9 +314,9 @@
function handleQuery() {
loading.value = true;
${entityName}API.getPage(queryParams)
.then((res) => {
pageData.value = res.data;
total.value = res.page?.total ?? 0;
.then((data) => {
pageData.value = data.list;
total.value = data.total ?? 0;
})
.finally(() => {
loading.value = false;

View File

@@ -315,9 +315,9 @@
function handleQuery() {
loading.value = true;
${entityName}API.getPage(queryParams)
.then((res) => {
pageData.value = res.data;
total.value = res.page?.total ?? 0;
.then((data) => {
pageData.value = data.list;
total.value = data.total ?? 0;
})
.finally(() => {
loading.value = false;