绘制角色界面

This commit is contained in:
GYYM
2024-10-16 11:27:17 +08:00
parent 7c8d5644f7
commit 062a8f259f
4 changed files with 436 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
import { ResPage } from '@/api/interface'
import { Role } from './interface'
import { ADMIN as rePrefix } from '@/api/config/serviceName'
import http from '@/api'
/**
* @name 角色管理模块
*/
// 获取角色列表
export const getRoleList = (params: Role.ReqRoleParams) => {
return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/role/list`, params)
}
// // 获取树形用户列表
// export const getRoleTreeList = (params: Role.ReqRoleParams) => {
// return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/role/tree/list`, params)
// }
// 新增角色
export const addRole = (params: { id: string }) => {
return http.post(`${rePrefix}/role/add`, params)
}
// 批量添加角色
export const BatchAddRole = (params: FormData) => {
return http.post(`${rePrefix}/role/import`, params)
}
// 编辑角色
export const editRole = (params: { id: string }) => {
return http.post(`${rePrefix}/role/edit`, params)
}
// 删除角色
export const deleteRole = (params: { id: string[] }) => {
return http.post(`${rePrefix}/role/delete`, params)
}
// 切换角色状态
export const changeRoleStatus = (params: { id: string; status: number }) => {
return http.post(`${rePrefix}/role/change`, params)
}
// 重置用户密码
// export const resetUserPassWord = (params: { id: string }) => {
// return http.post(`${rePrefix}/role/rest_password`, params)
// }
// 导出角色数据
export const exportRoleInfo = (params: Role.ReqRoleParams) => {
return http.download(`${rePrefix}/role/export`, params)
}
// 获取角色状态字典
export const getRoleStatus = () => {
return http.get<Role.ResStatus[]>(`${rePrefix}/role/status`)
}
// 获取用户性别字典
// export const getUserGender = () => {
// return http.get<User.ResGender[]>(`${rePrefix}/user/gender`)
// }
// 获取角色权限列表
export const getRoleDepartment = () => {
return http.get<Role.ResPermissionList[]>(`${rePrefix}/role/permission`)
}
// 获取用户角色字典
// export const getUserRole = () => {
// return http.get<User.ResRole[]>(`${rePrefix}/user/role`)
// }