refactor: 更新API接口与数据结构,统一分页返回格式

This commit is contained in:
Ray.Hao
2026-01-09 00:07:25 +08:00
parent 4a8efc770e
commit a5885d0710
64 changed files with 1085 additions and 910 deletions

View File

@@ -1,16 +1,20 @@
import request from "@/utils/request";
import type { DeptQuery, DeptVo, DeptForm } from "@/types/api";
import type { DeptQueryParams, DeptItem, DeptForm, OptionItem } from "@/types/api";
const DEPT_BASE_URL = "/api/v1/depts";
const DeptAPI = {
/** 获取部门树形列表 */
getList(queryParams?: DeptQuery) {
return request<any, DeptVo[]>({ url: `${DEPT_BASE_URL}`, method: "get", params: queryParams });
getList(queryParams?: DeptQueryParams) {
return request<any, DeptItem[]>({
url: `${DEPT_BASE_URL}`,
method: "get",
params: queryParams,
});
},
/** 获取部门下拉数据源 */
getOptions() {
return request<any, OptionType[]>({ url: `${DEPT_BASE_URL}/options`, method: "get" });
return request<any, OptionItem[]>({ url: `${DEPT_BASE_URL}/options`, method: "get" });
},
/** 获取部门表单数据 */
getFormData(id: string) {