feat:完善接口定义

This commit is contained in:
chenchun
2024-09-02 17:16:25 +08:00
parent 71fd5a13fc
commit b648f09f16
3 changed files with 81 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
import { http } from "@/utils/http";
import type { Result, ResultPage } from "@/api/result";
/** 查询岗位列表 */
export const getList = (data?: object) => {
return http.request<ResultPage>("get", "/dept", { data });
};
/** 查询部门详细 */
export const getDept = id => {
return http.request<Result>("get", `/dept/${id}`, {});
};
/** 新增部门 */
export const addDept = data => {
return http.request<Result>("post", `/dept`, { data });
};
/** 修改部门 */
export const updateDept = (id, data) => {
return http.request<Result>("put", `/dept/${id}`, { data });
};
/** 删除部门 */
export const delDept = id => {
return http.request<Result>("delete", `/dept`, { params: { id } });
};
/** 获取部门选择框列表 */
export const getPostOptionSelect = () => {
return http.request<Result>("get", `/post`, {});
};