123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- import http from '@/api'
- /**
- * @name 查询角色信息列表
- * @param query 参数
- * @returns 返回列表
- */
- export const listRoleApi = (query: any) => {
- return http.get<any>('/system/role/list', query, { loading: true })
- }
- /**
- * @name 根据角色ID查询部门树结构
- * @param roleId 角色Id
- * @returns 返回列表
- */
- export const deptTreeSelectApi = (roleId: any) => {
- return http.get<any>(`/system/role/deptTree/${roleId}`)
- }
- /**
- * @name 根据角色ID查询菜单下拉树结构
- * @param roleId 角色Id
- * @returns 返回列表
- */
- export const roleMenuTreeSelectApi = (roleId: any) => {
- return http.get<any>(`/system/menu/roleMenuTreeselect/${roleId}`)
- }
- /**
- * @name 查询角色信息详细
- * @param roleId roleId
- * @returns returns
- */
- export const getRoleApi = (roleId: any) => {
- return http.get<any>(`/system/role/${roleId}`)
- }
- /**
- * @name 新增角色信息
- * @param data data
- * @returns returns
- */
- export const addRoleApi = (data: any) => {
- return http.post<any>('/system/role', data, { loading: false })
- }
- /**
- * @name 修改角色信息
- * @param data data
- * @returns returns
- */
- export const updateRoleApi = (data: any) => {
- return http.put<any>('/system/role', data, { loading: false })
- }
- /**
- * @name 角色数据权限
- * @param data data
- * @returns returns
- */
- export const dataScopeApi = (data: any) => {
- return http.put<any>('/system/role/dataScope', data, { loading: false })
- }
- /**
- * @name 修改角色状态
- * @param data data
- * @returns returns
- */
- export const changeStatusApi = (data: any) => {
- return http.put<any>('/system/role/changeStatus', data, { loading: false })
- }
- /**
- * @name 删除角色信息
- * @param roleId roleId
- * @returns returns
- */
- export const delRoleApi = (roleId: any) => {
- return http.delete<any>(`/system/role/${roleId}`)
- }
- /**
- * @name 下载模板
- * @returns returns
- */
- export const importTemplateApi = () => {
- return http.downloadPost('/system/role/importTemplate', {})
- }
- /**
- * @name 导入数据
- * @returns returns
- */
- export const importDataApi = (data: any) => {
- return http.post('/system/role/importData', data)
- }
- /**
- * @name 导出数据
- * @returns returns
- */
- export const exportApi = (data: any) => {
- return http.downloadPost('/system/role/export', data)
- }
- /**
- * @name 查询角色已授权用户列表
- * @param query 参数
- * @returns 返回列表
- */
- export const allocatedUserListApi = (query: any) => {
- return http.get<any>(`/system/role/authUser/allocatedList`, query, { loading: true })
- }
- /**
- * @name 查询角色未授权用户列表
- * @param query 参数
- * @returns 返回列表
- */
- export const unallocatedUserListApi = (query: any) => {
- return http.get<any>(`/system/role/authUser/unallocatedList`, query, { loading: true })
- }
- /**
- * @name 取消用户授权角色
- * @param data data
- * @returns returns
- */
- export const authUserCancelApi = (data: any) => {
- return http.put<any>('/system/role/authUser/cancel', data, { loading: false })
- }
- /**
- * @name 批量取消用户授权角色
- * @param data data
- * @returns returns
- */
- export const authUserCancelAllApi = (data: any) => {
- return http.put<any>('/system/role/authUser/cancelAll', data, { loading: false })
- }
- /**
- * @name 授权用户选择
- * @param data data
- * @returns returns
- */
- export const authUserSelectAllApi = (data: any) => {
- return http.put<any>('/system/role/authUser/selectAll', data, { loading: false })
- }
|