From 65a8b5ec69dc1ddf53d8cc99bd722244d9272e53 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 7 Jul 2020 12:38:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=86=E9=85=8D=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E4=B8=8D=E5=85=81=E8=AE=B8=E9=80=89=E6=8B=A9=E8=B6=85?= =?UTF-8?q?=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysUserController.java | 5 ++-- .../main/resources/static/ruoyi/js/ry-ui.js | 2 ++ .../templates/system/user/authRole.html | 24 ++++++++++++------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index c9431ec7..f389b843 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -24,7 +24,6 @@ import com.ruoyi.framework.shiro.service.SysPasswordService; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysRole; import com.ruoyi.system.domain.SysUser; -import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserService; @@ -212,9 +211,9 @@ public class SysUserController extends BaseController { SysUser user = userService.selectUserById(userId); // 获取用户所属的角色列表 - List userRoles = userService.selectUserRoleByUserId(userId); + List roles = roleService.selectRolesByUserId(userId); mmap.put("user", user); - mmap.put("userRoles", userRoles); + mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); return prefix + "/authRole"; } diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index b61baa16..9a0dd3b7 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -62,6 +62,7 @@ var table = { clickToSelect: false, singleSelect: false, mobileResponsive: true, + maintainSelected: false, rememberSelected: false, fixedColumns: false, fixedNumber: 0, @@ -119,6 +120,7 @@ var table = { onDblClickCell: options.onDblClickCell, // 双击某格触发的事件 onEditableSave: options.onEditableSave, // 行内编辑保存的事件 onExpandRow: options.onExpandRow, // 点击详细视图的事件 + maintainSelected: options.maintainSelected, // 前端翻页时保留所选行 rememberSelected: options.rememberSelected, // 启用翻页记住前面的选择 fixedColumns: options.fixedColumns, // 是否启用冻结列(左侧) fixedNumber: options.fixedNumber, // 列冻结的个数(左侧) diff --git a/ruoyi-admin/src/main/resources/templates/system/user/authRole.html b/ruoyi-admin/src/main/resources/templates/system/user/authRole.html index 48504572..0e31bb61 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/authRole.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/authRole.html @@ -47,36 +47,42 @@