refactor: 更新API接口与数据结构,统一分页返回格式
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import UserAPI from "@/api/system/user";
|
||||
import RoleAPI from "@/api/system/role";
|
||||
import type { UserPageQuery } from "@/types/api";
|
||||
import type { UserQueryParams, UserItem } from "@/types/api";
|
||||
import type { IContentConfig } from "@/components/CURD/types";
|
||||
|
||||
const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
const contentConfig: IContentConfig<UserQueryParams, UserItem> = {
|
||||
permPrefix: "sys:user", // 不写不进行按钮权限校验
|
||||
table: {
|
||||
border: true,
|
||||
@@ -15,12 +15,6 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
pageSize: 20,
|
||||
pageSizes: [10, 20, 30, 50],
|
||||
},
|
||||
parseData(res) {
|
||||
return {
|
||||
total: res.total,
|
||||
list: res.list,
|
||||
};
|
||||
},
|
||||
indexAction(params) {
|
||||
return UserAPI.getPage(params);
|
||||
},
|
||||
@@ -38,8 +32,8 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
async exportsAction(params) {
|
||||
// 模拟获取到的是全量数据
|
||||
const res = await UserAPI.getPage(params);
|
||||
console.log("exportsAction", res.list);
|
||||
return res.list;
|
||||
console.log("exportsAction", res.data);
|
||||
return res.data;
|
||||
},
|
||||
pk: "id",
|
||||
toolbar: [
|
||||
|
||||
Reference in New Issue
Block a user