From a429b65fc33faebbdd49c2525e61a80b8d0623c6 Mon Sep 17 00:00:00 2001 From: stylefeng Date: Thu, 31 Oct 2024 12:52:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.3.1=E3=80=91=E3=80=90role=E3=80=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=E5=A1=AB?= =?UTF-8?q?=E5=85=85=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/api/factory/RoleBindPermissionFactory.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/factory/RoleBindPermissionFactory.java b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/factory/RoleBindPermissionFactory.java index b449ba69b..f12d4c08e 100644 --- a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/factory/RoleBindPermissionFactory.java +++ b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/factory/RoleBindPermissionFactory.java @@ -107,10 +107,22 @@ public class RoleBindPermissionFactory { } for (RoleBindPermissionItem roleBindPermissionItem : beFilled) { + + // 针对菜单的选中填充 if (rolePermissionList.contains(Convert.toLong(roleBindPermissionItem.getNodeId()))) { roleBindPermissionItem.setChecked(true); } + // 针对功能的选中填充 + List functionList = roleBindPermissionItem.getFunctionList(); + if (ObjectUtil.isNotEmpty(functionList)) { + for (RoleBindPermissionItem bindPermissionItem : functionList) { + if (rolePermissionList.contains(Convert.toLong(bindPermissionItem.getNodeId()))) { + bindPermissionItem.setChecked(true); + } + } + } + fillSubItemCheckedFlag(roleBindPermissionItem.getChildren(), rolePermissionList); } }