提交 | 用户 | 时间
|
820397
|
1 |
import request from '@/config/axios' |
H |
2 |
|
|
3 |
export interface RoleVO { |
|
4 |
id: number |
|
5 |
name: string |
|
6 |
code: string |
|
7 |
sort: number |
|
8 |
status: number |
|
9 |
type: number |
|
10 |
dataScope: number |
|
11 |
dataScopeDeptIds: number[] |
|
12 |
createTime: Date |
|
13 |
} |
|
14 |
|
|
15 |
export interface UpdateStatusReqVO { |
|
16 |
id: number |
|
17 |
status: number |
|
18 |
} |
|
19 |
|
|
20 |
// 查询角色列表 |
|
21 |
export const getRolePage = async (params: PageParam) => { |
|
22 |
return await request.get({ url: '/system/role/page', params }) |
|
23 |
} |
|
24 |
|
|
25 |
// 查询角色(精简)列表 |
|
26 |
export const getSimpleRoleList = async (): Promise<RoleVO[]> => { |
|
27 |
return await request.get({ url: '/system/role/simple-list' }) |
|
28 |
} |
|
29 |
|
|
30 |
// 查询角色详情 |
|
31 |
export const getRole = async (id: number) => { |
|
32 |
return await request.get({ url: '/system/role/get?id=' + id }) |
|
33 |
} |
|
34 |
|
|
35 |
// 新增角色 |
|
36 |
export const createRole = async (data: RoleVO) => { |
|
37 |
return await request.post({ url: '/system/role/create', data }) |
|
38 |
} |
|
39 |
|
|
40 |
// 修改角色 |
|
41 |
export const updateRole = async (data: RoleVO) => { |
|
42 |
return await request.put({ url: '/system/role/update', data }) |
|
43 |
} |
|
44 |
|
|
45 |
// 修改角色状态 |
|
46 |
export const updateRoleStatus = async (data: UpdateStatusReqVO) => { |
|
47 |
return await request.put({ url: '/system/role/update-status', data }) |
|
48 |
} |
|
49 |
|
|
50 |
// 删除角色 |
|
51 |
export const deleteRole = async (id: number) => { |
|
52 |
return await request.delete({ url: '/system/role/delete?id=' + id }) |
|
53 |
} |
|
54 |
|
|
55 |
// 导出角色 |
|
56 |
export const exportRole = (params) => { |
|
57 |
return request.download({ |
|
58 |
url: '/system/role/export-excel', |
|
59 |
params |
|
60 |
}) |
|
61 |
} |