mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 优化 支持子菜单配置默认激活的父菜单activeMenu
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user