新增:新增系统管理/角色管理(分页、查看详情、创建、修改、删除)

This commit is contained in:
2023-02-09 23:15:16 +08:00
parent 4171fe0597
commit 5251a484f2
22 changed files with 1564 additions and 12 deletions

View File

@@ -0,0 +1,58 @@
import axios from 'axios';
import qs from 'query-string';
const BASE_URL = '/system/role';
export interface RoleRecord {
roleId?: number;
roleName: string;
roleCode?: string;
dataScope: number;
dataScopeDeptIds?: string;
description?: string;
roleSort: number;
status?: number;
createUserString?: string;
createTime?: string;
updateUserString?: string;
updateTime?: string;
disabled?: boolean;
}
export interface RoleParam {
roleName?: string;
status?: number;
page: number;
size: number;
sort: Array<string>;
}
export interface RoleListRes {
list: RoleRecord[];
total: number;
}
export function listRole(params: RoleParam) {
return axios.get<RoleListRes>(`${BASE_URL}`, {
params,
paramsSerializer: (obj) => {
return qs.stringify(obj);
},
});
}
export function getRole(id: number) {
return axios.get<RoleRecord>(`${BASE_URL}/${id}`);
}
export function createRole(req: RoleRecord) {
return axios.post(BASE_URL, req);
}
export function updateRole(req: RoleRecord) {
return axios.put(BASE_URL, req);
}
export function deleteRole(ids: number | Array<number>) {
return axios.delete(`${BASE_URL}/${ids}`);
}