diff --git a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/menu/MenuAndButtonTreeResponse.java b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/menu/MenuAndButtonTreeResponse.java index 0efa3a9f7..dfe187a63 100644 --- a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/menu/MenuAndButtonTreeResponse.java +++ b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/menu/MenuAndButtonTreeResponse.java @@ -69,12 +69,6 @@ public class MenuAndButtonTreeResponse implements AbstractTreeNode menuAndButtonTreeResponses) { - for (MenuAndButtonTreeResponse menuAndButtonTreeRespons : menuAndButtonTreeResponses) { - List children = menuAndButtonTreeRespons.getChildren(); - if (ObjectUtil.isEmpty(children)) { - continue; - } - - // 获取选中状态子节点数量 - long selectedCount = children.stream().filter(MenuAndButtonTreeResponse::getChecked).count(); - - // 获取子节点数量 - int childrenSize = children.size(); - - // 统计选中的数量 - if (selectedCount == 0) { - menuAndButtonTreeRespons.setChecked(false); - menuAndButtonTreeRespons.setIndeterminate(false); - } else if (selectedCount == childrenSize) { - menuAndButtonTreeRespons.setChecked(true); - menuAndButtonTreeRespons.setIndeterminate(false); - } else { - menuAndButtonTreeRespons.setChecked(false); - menuAndButtonTreeRespons.setIndeterminate(true); - } - - // 继续遍历子节点并填充 - IndeterminateFactory.fillIndeterminate(children); - } - } - -} diff --git a/kernel-s-system/system-business-menu/src/main/java/cn/stylefeng/roses/kernel/system/modular/menu/service/impl/SysMenuServiceImpl.java b/kernel-s-system/system-business-menu/src/main/java/cn/stylefeng/roses/kernel/system/modular/menu/service/impl/SysMenuServiceImpl.java index be63c6633..7acf0526b 100644 --- a/kernel-s-system/system-business-menu/src/main/java/cn/stylefeng/roses/kernel/system/modular/menu/service/impl/SysMenuServiceImpl.java +++ b/kernel-s-system/system-business-menu/src/main/java/cn/stylefeng/roses/kernel/system/modular/menu/service/impl/SysMenuServiceImpl.java @@ -59,7 +59,10 @@ import cn.stylefeng.roses.kernel.system.api.pojo.role.request.SysRoleRequest; import cn.stylefeng.roses.kernel.system.modular.menu.entity.SysMenu; import cn.stylefeng.roses.kernel.system.modular.menu.entity.SysMenuButton; import cn.stylefeng.roses.kernel.system.modular.menu.entity.SysMenuResource; -import cn.stylefeng.roses.kernel.system.modular.menu.factory.*; +import cn.stylefeng.roses.kernel.system.modular.menu.factory.AntdMenusFactory; +import cn.stylefeng.roses.kernel.system.modular.menu.factory.Antdv3MenusFactory; +import cn.stylefeng.roses.kernel.system.modular.menu.factory.LayuiMenusFactory; +import cn.stylefeng.roses.kernel.system.modular.menu.factory.MenuTypeFactory; import cn.stylefeng.roses.kernel.system.modular.menu.mapper.SysMenuMapper; import cn.stylefeng.roses.kernel.system.modular.menu.service.SysMenuButtonService; import cn.stylefeng.roses.kernel.system.modular.menu.service.SysMenuResourceService; @@ -471,9 +474,7 @@ public class SysMenuServiceImpl extends ServiceImpl impl AntdMenusFactory.fillButtons(menuAndButtonTreeResponses, buttonList, roleMenuButtonList); // 菜单列表转化为一棵树 - List menuAndButtonTreeResponses1 = new DefaultTreeBuildFactory().doTreeBuild(menuAndButtonTreeResponses); - IndeterminateFactory.fillIndeterminate(menuAndButtonTreeResponses1); - return menuAndButtonTreeResponses1; + return new DefaultTreeBuildFactory().doTreeBuild(menuAndButtonTreeResponses); } @Override