diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java index 60f5e9d9..f78a2212 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java @@ -137,4 +137,33 @@ public class SysRole extends BaseEntity { return UserConstants.ADMIN_ID.equals(this.roleId); } + public Boolean getMenuCheckStrictly() { + if (menuCheckStrictly == null) { + return null; + } + return menuCheckStrictly == 1; + } + + public void setMenuCheckStrictly(Boolean menuCheckStrictly) { + if (menuCheckStrictly == null) { + this.menuCheckStrictly = null; + return; + } + this.menuCheckStrictly = menuCheckStrictly ? 1 : 0; + } + + public Boolean getDeptCheckStrictly() { + if (deptCheckStrictly == null) { + return null; + } + return deptCheckStrictly == 1; + } + + public void setDeptCheckStrictly(Boolean deptCheckStrictly) { + if (deptCheckStrictly == null) { + this.deptCheckStrictly = null; + return; + } + this.deptCheckStrictly = deptCheckStrictly ? 1 : 0; + } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index b1c2df16..5d781fb0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -84,7 +84,7 @@ public class SysDeptServiceImpl implements ISysDeptService { @Override public List selectDeptListByRoleId(Long roleId) { SysRole role = roleMapper.selectById(roleId); - return baseMapper.selectDeptListByRoleId(roleId, role.getDeptCheckStrictly() == 1); + return baseMapper.selectDeptListByRoleId(roleId, role.getDeptCheckStrictly()); } /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 0c16cf03..4c2d4be3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -123,7 +123,7 @@ public class SysMenuServiceImpl implements ISysMenuService { @Override public List selectMenuListByRoleId(Long roleId) { SysRole role = roleMapper.selectById(roleId); - return baseMapper.selectMenuListByRoleId(roleId, role.getMenuCheckStrictly() == 1); + return baseMapper.selectMenuListByRoleId(roleId, role.getMenuCheckStrictly()); } /** diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue index a1202451..b08cf347 100644 --- a/ruoyi-ui/src/views/system/role/index.vue +++ b/ruoyi-ui/src/views/system/role/index.vue @@ -187,14 +187,14 @@ 展开/折叠 全选/全不选 - 父子联动 + 父子联动 @@ -231,7 +231,7 @@ 展开/折叠 全选/全不选 - 父子联动 + 父子联动 @@ -440,8 +440,8 @@ export default { status: "0", menuIds: [], deptIds: [], - menuCheckStrictly: 1, - deptCheckStrictly: 1, + menuCheckStrictly: true, + deptCheckStrictly: true, remark: undefined }; this.resetForm("form"); @@ -501,9 +501,9 @@ export default { // 树权限(父子联动) handleCheckedTreeConnect(value, type) { if (type == 'menu') { - this.form.menuCheckStrictly = value ? 1: 0; + this.form.menuCheckStrictly = value ? true: false; } else if (type == 'dept') { - this.form.deptCheckStrictly = value ? 1: 0; + this.form.deptCheckStrictly = value ? true: false; } }, /** 新增按钮操作 */