update 优化 支持子菜单配置默认激活的父菜单activeMenu

This commit is contained in:
疯狂的狮子Li
2025-09-02 10:45:54 +08:00
parent 2258962770
commit 26ce8f30c9
14 changed files with 77 additions and 26 deletions

View File

@ -32,6 +32,11 @@ public class MetaVo {
*/
private String link;
/**
* 激活菜单
*/
private String activeMenu;
public MetaVo(String title, String icon) {
this.title = title;
this.icon = icon;
@ -58,4 +63,16 @@ public class MetaVo {
}
}
public MetaVo(String title, String icon, Boolean noCache, String link, String activeMenu) {
this.title = title;
this.icon = icon;
this.noCache = noCache;
if (StringUtils.ishttp(link)) {
this.link = link;
}
if (StringUtils.startWithAnyIgnoreCase(activeMenu, "/")) {
this.activeMenu = activeMenu;
}
}
}

View File

@ -185,7 +185,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
router.setPath(menu.getRouterPath());
router.setComponent(menu.getComponentInfo());
router.setQuery(menu.getQueryParam());
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getRemark()));
List<SysMenu> cMenus = menu.getChildren();
if (CollUtil.isNotEmpty(cMenus) && SystemConstants.TYPE_DIR.equals(menu.getMenuType())) {
router.setAlwaysShow(true);
@ -199,7 +199,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
children.setPath(menu.getPath());
children.setComponent(menu.getComponent());
children.setName(frameName);
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getRemark()));
children.setQuery(menu.getQueryParam());
childrenList.add(children);
router.setChildren(childrenList);