diff --git a/frontend/src/api/role/interface/index.ts b/frontend/src/api/role/interface/index.ts index aed7faa..90e2e2f 100644 --- a/frontend/src/api/role/interface/index.ts +++ b/frontend/src/api/role/interface/index.ts @@ -3,34 +3,64 @@ import type { ReqPage } from '@/api/interface' // 角色管理模块 export namespace Role { + //资源接口 export interface Permission{ - key: string; //权限名称 - label: string; //权限ID - disabled:boolean; //是否拥有该权限 + id: string; //资源ID + name: string; //资源名称 + code: string; //资源代码 } + //角色接口 + export interface RoleBO { + id?: string; //角色类型ID + name: string; //角色类型名称 + code: string; //角色代码 + type: number; //角色类型 + remark:string; //角色描述 + } + + //角色+资源 + export interface ReqRoleAndPermission extends RoleBO{ + permissionList?:Permission[]; //角色权限列表 + } + + // 角色+分页 + export interface ReqRoleParams extends ReqPage,RoleBO { + + } + + + + // export interface Permission{ + // key: string; //权限名称 + // label: string; //权限ID + // disabled:boolean; //是否拥有该权限 + // } + // 角色列表 - export interface ResRoleList { - id: string; //角色类型ID - rolename: string; //角色类型名称 - status: number; //角色类型状态 - describe:string; //角色描述 - permissionList?:Permission[]; //角色权限列表 - } + // export interface ResRoleList { + // id: string; //角色类型ID + // rolename: string; //角色类型名称 + // status: number; //角色类型状态 + // describe:string; //角色描述 + // permissionList?:Permission[]; //角色权限列表 + // } - // 角色参数 - export interface ReqRoleParams extends ReqPage { - id: string; //角色类型ID - rolename: string; //角色类型名称 - status: number; //角色类型状态 - describe:string; //角色描述 - permissionList?:Permission[]; //角色权限列表 - } + + + + // export interface ReqRoleParams extends ReqPage { + // id: string; //角色类型ID + // rolename: string; //角色类型名称 + // status: number; //角色类型状态 + // describe:string; //角色描述 + // permissionList?:Permission[]; //角色权限列表 + // } // 角色字典 - export interface ResStatus { - roleLabel: string; - roleValue: number; - } + // export interface ResStatus { + // roleLabel: string; + // roleValue: number; + // } // export interface ResGender { // genderLabel: string; @@ -38,11 +68,11 @@ export namespace Role { // } //角色权限列表 - export interface ResPermissionList { - key: string; - label: string; - disable?: Permission[]; - } + // export interface ResPermissionList { + // key: string; + // label: string; + // disable?: Permission[]; + // } // export interface ResRole { // id: string; diff --git a/frontend/src/api/role/role.ts b/frontend/src/api/role/role.ts index dcd57f7..0dff602 100644 --- a/frontend/src/api/role/role.ts +++ b/frontend/src/api/role/role.ts @@ -8,40 +8,60 @@ import http from '@/api' */ // 获取角色列表 export const getRoleList = (params: Role.ReqRoleParams) => { - return http.post>(`/RoleList_Post`, params) - // return http.post>(`${rePrefix}/role/list`, params) + return http.post>(`/role/list`, params) + // return http.post>(`/RoleList_Post`, params) + // return http.post>(`${rePrefix}/role/list`, params) } +// 新增角色 +export const addRole = (params: Role.RoleBO) => { + return http.post(`/role/add`, params) +} + +// 编辑角色 +export const editRole = (params: Role.RoleBO) => { + return http.post(`/role/edit`, params) +} + +// 删除角色 +export const deleteRole = (params: { id: string[] }) => { + return http.post(`/role/del`, params) +} + + +// 编辑角色资源 +export const editRoleAndPermission = (params: Role.ReqRoleAndPermission) => { + return http.post(`/role/edit_RoleAndPermission`, params) +} + + + + + + + + + + // // 获取树形用户列表 // export const getRoleTreeList = (params: Role.ReqRoleParams) => { // return http.post>(`${rePrefix}/role/tree/list`, params) // } -// 新增角色 -export const addRole = (params: { id: string }) => { - return http.post(`/RoleList_Add`, params) -} +// export const addRole = (params: { id: string ; rolename: string;status: number; describe:string; }) => { +// return http.post(`/RoleList_Add`, params) +// } // 批量添加角色 -export const BatchAddRole = (params: FormData) => { - return http.post(`${rePrefix}/role/import`, 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(`/RoleList_Del`, params) -} - -// 切换角色状态 -export const changeRoleStatus = (params: { id: string; status: number }) => { - return http.post(`${rePrefix}/role/change`, params) -} +// // 切换角色状态 +// export const changeRoleStatus = (params: { id: string; status: number }) => { +// return http.post(`${rePrefix}/role/change`, params) +// } // 重置用户密码 // export const resetUserPassWord = (params: { id: string }) => { @@ -49,14 +69,14 @@ export const changeRoleStatus = (params: { id: string; status: number }) => { // } // 导出角色数据 -export const exportRoleInfo = (params: Role.ReqRoleParams) => { - return http.download(`${rePrefix}/role/export`, params) -} +// export const exportRoleInfo = (params: Role.ReqRoleParams) => { +// return http.download(`${rePrefix}/role/export`, params) +// } // 获取角色状态字典 -export const getRoleStatus = () => { - return http.get(`${rePrefix}/role/status`) -} +// export const getRoleStatus = () => { +// return http.get(`${rePrefix}/role/status`) +// } // 获取用户性别字典 // export const getUserGender = () => { @@ -64,9 +84,9 @@ export const getRoleStatus = () => { // } // 获取角色权限列表 -export const getRoleDepartment = () => { - return http.get(`${rePrefix}/role/permission`) -} +// export const getRoleDepartment = () => { +// return http.get(`${rePrefix}/role/permission`) +// } // 获取用户角色字典 // export const getUserRole = () => { diff --git a/frontend/src/api/system/dictData.ts b/frontend/src/api/system/dictData.ts index 6be2b1f..a9d752a 100644 --- a/frontend/src/api/system/dictData.ts +++ b/frontend/src/api/system/dictData.ts @@ -43,6 +43,51 @@ const dictData: Dict[] = [ }, ], }, + { + id: "3", + code: 'type', + label: '资源类型', + children: [ + { + id: "1", + label: '菜单', + code: 1, + }, + { + id: "2", + label: '按钮', + code: 2, + }, + { + id: "3", + label: '公共资源', + code: 3, + }, + ], + }, + { + id: "4", + code: 'roleType', + label: '角色类型', + children: [ + { + id: "0", + label: '超级管理员', + code: 0, + }, + { + id: "1", + label: '管理员', + code: 1, + }, + { + id: "2", + label: '普通角色', + code: 2, + }, + ], + }, +] export default dictData \ No newline at end of file diff --git a/frontend/src/views/authority/role/components/rolePopup.vue b/frontend/src/views/authority/role/components/rolePopup.vue new file mode 100644 index 0000000..4fa535e --- /dev/null +++ b/frontend/src/views/authority/role/components/rolePopup.vue @@ -0,0 +1,120 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/authority/role/components/roleUnit.vue b/frontend/src/views/authority/role/components/roleUnit.vue deleted file mode 100644 index 1483d04..0000000 --- a/frontend/src/views/authority/role/components/roleUnit.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - \ No newline at end of file diff --git a/frontend/src/views/authority/role/index.vue b/frontend/src/views/authority/role/index.vue index 7e03b84..2808e04 100644 --- a/frontend/src/views/authority/role/index.vue +++ b/frontend/src/views/authority/role/index.vue @@ -1,254 +1,234 @@ - +} + \ No newline at end of file diff --git a/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue b/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue index 5a2e1cb..b17dc3e 100644 --- a/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue +++ b/frontend/src/views/machine/errorSystem/components/ErrorSystemDialog.vue @@ -147,7 +147,7 @@ import{ElMessage, FormInstance,FormItemRule}from'element-plus' import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue'; import { dialogBig,dialogMiddle} from '@/utils/elementBind' - import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件 + //import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件 import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue' const props = defineProps<{ visible: boolean;