feat:完善 dept 部门 30%(列表)

This commit is contained in:
YunaiV
2025-03-29 09:32:14 +08:00
parent 923f1de7f7
commit 32e0ce0325
4 changed files with 118 additions and 81 deletions

View File

@@ -0,0 +1,47 @@
import { requestClient } from '#/api/request';
export namespace SystemDeptApi {
/** 部门信息 */
export interface SystemDept {
id?: number;
name: string;
parentId?: number;
status: number;
sort: number;
leaderUserId: number;
phone: string;
email: string;
createTime: Date;
children?: SystemDept[];
}
}
/** 查询部门(精简)列表 */
export async function getSimpleDeptList() {
return requestClient.get<SystemDeptApi.SystemDept[]>('/system/dept/simple-list');
}
/** 查询部门列表 */
export async function getDeptList() {
return requestClient.get('/system/dept/list');
}
/** 查询部门详情 */
export async function getDept(id: number) {
return requestClient.get<SystemDeptApi.SystemDept>(`/system/dept/get?id=${id}`);
}
/** 新增部门 */
export async function createDept(data: SystemDeptApi.SystemDept) {
return requestClient.post('/system/dept/create', data);
}
/** 修改部门 */
export async function updateDept(data: SystemDeptApi.SystemDept) {
return requestClient.put('/system/dept/update', data);
}
/** 删除部门 */
export async function deleteDept(id: number) {
return requestClient.delete(`/system/dept/delete?id=${id}`);
}