blob: ad5880783ddf99a6413aecb7556605176cc01157 [file] [log] [blame]
Jiarenxiang38dcb052025-03-13 16:40:09 +08001import { request } from '@umijs/max';
2import { downLoadXlsx } from '@/utils/downloadfile';
3
4// 查询部门列表
5export async function getDeptList(params?: API.System.DeptListParams) {
6 return request<API.System.DeptPageResult>('/api/system/dept/list', {
7 method: 'GET',
8 headers: {
9 'Content-Type': 'application/json;charset=UTF-8',
10 },
11 params
12 });
13}
14
15// 查询部门列表(排除节点)
16export function getDeptListExcludeChild(deptId: number) {
17 return request(`/api/system/dept/list/exclude/${deptId}`, {
18 method: 'get',
19 });
20}
21
22// 查询部门详细
23export function getDept(deptId: number) {
24 return request<API.System.DeptInfoResult>(`/api/system/dept/${deptId}`, {
25 method: 'GET'
26 });
27}
28
29// 新增部门
30export async function addDept(params: API.System.Dept) {
31 return request<API.Result>('/api/system/dept', {
32 method: 'POST',
33 headers: {
34 'Content-Type': 'application/json;charset=UTF-8',
35 },
36 data: params
37 });
38}
39
40// 修改部门
41export async function updateDept(params: API.System.Dept) {
42 return request<API.Result>('/api/system/dept', {
43 method: 'PUT',
44 headers: {
45 'Content-Type': 'application/json;charset=UTF-8',
46 },
47 data: params
48 });
49}
50
51// 删除部门
52export async function removeDept(ids: string) {
53 return request<API.Result>(`/api/system/dept/${ids}`, {
54 method: 'DELETE'
55 });
56}