Files
FastapiAdmin/frontend/web/src/api/module_system/dept.ts
T
zhangtao d34d4a4c50 chore: 完成多批次代码优化与重构
- 重构工作流模块目录结构,迁移代码文件
- 修复类型断言空值安全问题,添加 ! 操作符
- 优化样式类名,替换 flex-cc 为标准 flex 工具类
- 更新路由标签简化文案,移除冗余注释
- 调整 ruff 配置,放宽行长度限制
- 更新 README 与多语言文案,优化项目描述
- 修复表单、图表组件的类型与样式问题
- 简化搜索表单、数据卡片的布局代码
2026-06-20 05:31:46 +08:00

85 lines
1.6 KiB
TypeScript

import { request } from "@utils";
const API_PATH = "/system/dept";
const DeptAPI = {
listDept(query?: DeptPageQuery) {
return request<ApiResponse<DeptTable[]>>({
url: `${API_PATH}/tree`,
method: "get",
params: query,
});
},
detailDept(query: number) {
return request<ApiResponse<DeptTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
createDept(body: DeptForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
updateDept(id: number, body: DeptForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
deleteDept(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
batchDept(body: BatchType) {
return request<ApiResponse>({
url: `${API_PATH}/status/batch`,
method: "patch",
data: body,
});
},
};
export default DeptAPI;
export interface DeptPageQuery extends UserByQueryParams {
name?: string;
}
export interface DeptTable extends BaseType {
name?: string;
order?: number;
code: string;
leader?: string;
phone?: string;
email?: string;
parent_id?: number;
parent_name?: string;
children?: DeptTable[];
status?: number;
description?: string;
}
export interface DeptForm extends BaseFormType {
name?: string;
code: string;
leader?: string;
phone?: string;
email?: string;
parent_id?: number;
order?: number;
status?: number;
description?: string;
}