From 04feb57ed8a6915a1cc15be32b0cf98078b739e9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 9 Jan 2021 22:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=20dept=20=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/system/dept.js | 12 +- ruoyi-ui/src/utils/constants.js | 13 +- ruoyi-ui/src/utils/dict.js | 1 + ruoyi-ui/src/views/system/role/index.vue | 119 +++++++----------- .../controller/dept/SysDeptController.java | 38 ++++++ .../permission/vo/role/SysRoleBaseVO.java | 2 +- .../permission/vo/role/SysRoleRespVO.java | 2 +- .../vo/role/SysRoleUpdateStatusReqVO.java | 4 +- .../system/convert/dept/SysDeptConvert.java | 20 +++ .../dal/mysql/dao/dept/SysDeptMapper.java | 10 +- .../system/service/dept/SysDeptService.java | 11 +- .../service/dept/impl/SysDeptServiceImpl.java | 6 + 12 files changed, 157 insertions(+), 81 deletions(-) create mode 100644 src/main/java/cn/iocoder/dashboard/modules/system/convert/dept/SysDeptConvert.java diff --git a/ruoyi-ui/src/api/system/dept.js b/ruoyi-ui/src/api/system/dept.js index 0535e8a61..3cfa8e506 100644 --- a/ruoyi-ui/src/api/system/dept.js +++ b/ruoyi-ui/src/api/system/dept.js @@ -26,6 +26,7 @@ export function getDept(deptId) { } // 查询部门下拉树结构 +// TODO 准备删除 export function treeselect() { return request({ url: '/system/dept/treeselect', @@ -34,6 +35,7 @@ export function treeselect() { } // 根据角色ID查询部门树结构 +// TODO 准备删除 export function roleDeptTreeselect(roleId) { return request({ url: '/system/dept/roleDeptTreeselect/' + roleId, @@ -41,6 +43,14 @@ export function roleDeptTreeselect(roleId) { }) } +// 获取部门精简信息列表 +export function listSimpleDepts() { + return request({ + url: '/system/dept/list-all-simple', + method: 'get' + }) +} + // 新增部门 export function addDept(data) { return request({ @@ -65,4 +75,4 @@ export function delDept(deptId) { url: '/system/dept/' + deptId, method: 'delete' }) -} \ No newline at end of file +} diff --git a/ruoyi-ui/src/utils/constants.js b/ruoyi-ui/src/utils/constants.js index 0ed3c33db..fefb97e6b 100644 --- a/ruoyi-ui/src/utils/constants.js +++ b/ruoyi-ui/src/utils/constants.js @@ -24,7 +24,18 @@ export const SysMenuTypeEnum = { /** * 角色的类型枚举 */ -export const RoleTypeEnum = { +export const SysRoleTypeEnum = { SYSTEM: 1, // 内置角色 CUSTOM: 2 // 自定义角色 } + +/** + * 数据权限的泛微枚举 + */ +export const SysDataScopeEnum = { + ALL: 1, // 全部数据权限 + DEPT_CUSTOM: 2, // 指定部门数据权限 + DEPT_ONLY: 3, // 部门数据权限 + DEPT_AND_CHILD: 4, // 部门及以下数据权限 + DEPT_SELF: 5 // 仅本人数据权限 +} diff --git a/ruoyi-ui/src/utils/dict.js b/ruoyi-ui/src/utils/dict.js index acbe88c90..9b482baef 100644 --- a/ruoyi-ui/src/utils/dict.js +++ b/ruoyi-ui/src/utils/dict.js @@ -9,6 +9,7 @@ export const DICT_TYPE = { SYS_COMMON_STATUS: 'sys_common_status', SYS_MENU_TYPE: 'sys_menu_type', SYS_ROLE_TYPE: 'sys_role_type', + SYS_DATA_SCOPE: 'sys_data_scope', } /** diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue index 5f4a157bd..50cf5cfd4 100644 --- a/ruoyi-ui/src/views/system/role/index.vue +++ b/ruoyi-ui/src/views/system/role/index.vue @@ -163,7 +163,7 @@ - + @@ -174,15 +174,15 @@ - - 父子联动 + + 父子联动(选中父节点,自动选择子节点) 展开/折叠 全选/全不选