Browse Source

修改myMenu菜单不区分 按钮和菜单

tags/24080901
niohe·erbao 1 year ago
parent
commit
9e2469cb71
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java

+ 8
- 4
pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java View File

@@ -137,11 +137,15 @@ public final class TreeUtil {
List<MenuRoleVO> menus;
if (!parentId.equals(StrPool.DEF_PARENT_ID)) {
Map<MenuTypeEnum, List<MenuRoleVO>> 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<MenuRoleVO> buttons = group.getOrDefault(MenuTypeEnum.BUTTON, Collections.emptyList());
if (CollUtil.isNotEmpty(buttons)) {
menus.addAll(buttons);
}
} else {
menus = new ArrayList<>(currMenus);
}


Loading…
Cancel
Save