From 9e2469cb713a85fdc2eea21bfd100d25b51a5d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Wed, 10 May 2023 10:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9myMenu=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E4=B8=8D=E5=8C=BA=E5=88=86=20=E6=8C=89=E9=92=AE=E5=92=8C?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ningdatech/pmapi/common/util/TreeUtil.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java index a3e2caf..a15a8c2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java @@ -137,11 +137,15 @@ public final class TreeUtil { List menus; if (!parentId.equals(StrPool.DEF_PARENT_ID)) { Map> group = CollUtils.group(currMenus, MenuRoleVO::getMenuType); - for (MenuRoleVO vo : group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList())) { - vo.setTopMenu(parentMenu.getTopMenu()); - parentIter.add(vo); - } +// for (MenuRoleVO vo : group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList())) { +// vo.setTopMenu(parentMenu.getTopMenu()); +// parentIter.add(vo); +// } menus = group.getOrDefault(MenuTypeEnum.MENU, Collections.emptyList()); + List buttons = group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList()); + if (CollUtil.isNotEmpty(buttons)) { + menus.addAll(buttons); + } } else { menus = new ArrayList<>(currMenus); }