mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 04:08:43 +08:00 
			
		
		
		
	菜单新增 alwaysShow 总是展示、componentName 组件名
This commit is contained in:
		@@ -30,6 +30,9 @@ public class AuthMenuRespVO {
 | 
			
		||||
    @Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index")
 | 
			
		||||
    private String component;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "组件名", example = "SystemUser")
 | 
			
		||||
    private String componentName;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
 | 
			
		||||
    private String icon;
 | 
			
		||||
 | 
			
		||||
@@ -39,6 +42,9 @@ public class AuthMenuRespVO {
 | 
			
		||||
    @Schema(description = "是否缓存", required = true, example = "false")
 | 
			
		||||
    private Boolean keepAlive;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "是否总是显示", example = "false")
 | 
			
		||||
    private Boolean alwaysShow;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 子路由
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -46,6 +46,9 @@ public class MenuBaseVO {
 | 
			
		||||
    @Size(max = 200, message = "组件路径不能超过255个字符")
 | 
			
		||||
    private String component;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "组件名", example = "SystemUser")
 | 
			
		||||
    private String componentName;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1")
 | 
			
		||||
    @NotNull(message = "状态不能为空")
 | 
			
		||||
    private Integer status;
 | 
			
		||||
@@ -56,4 +59,7 @@ public class MenuBaseVO {
 | 
			
		||||
    @Schema(description = "是否缓存", example = "false")
 | 
			
		||||
    private Boolean keepAlive;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "是否总是显示", example = "false")
 | 
			
		||||
    private Boolean alwaysShow;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -61,6 +61,8 @@ public class MenuDO extends BaseDO {
 | 
			
		||||
    private Long parentId;
 | 
			
		||||
    /**
 | 
			
		||||
     * 路由地址
 | 
			
		||||
     *
 | 
			
		||||
     * 如果 path 为 http(s) 时,则它是外链
 | 
			
		||||
     */
 | 
			
		||||
    private String path;
 | 
			
		||||
    /**
 | 
			
		||||
@@ -71,6 +73,10 @@ public class MenuDO extends BaseDO {
 | 
			
		||||
     * 组件路径
 | 
			
		||||
     */
 | 
			
		||||
    private String component;
 | 
			
		||||
    /**
 | 
			
		||||
     * 组件名
 | 
			
		||||
     */
 | 
			
		||||
    private String componentName;
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     *
 | 
			
		||||
@@ -87,9 +93,15 @@ public class MenuDO extends BaseDO {
 | 
			
		||||
    /**
 | 
			
		||||
     * 是否缓存
 | 
			
		||||
     *
 | 
			
		||||
     * 只有菜单、目录使用
 | 
			
		||||
     * 是否使用 Vue 路由的 keep-alive 特性
 | 
			
		||||
     * 只有菜单、目录使用,否使用 Vue 路由的 keep-alive 特性
 | 
			
		||||
     * 注意:如果开启缓存,则必须填写 {@link #componentName} 属性,否则无法缓存
 | 
			
		||||
     */
 | 
			
		||||
    private Boolean keepAlive;
 | 
			
		||||
    /**
 | 
			
		||||
     * 是否总是显示
 | 
			
		||||
     *
 | 
			
		||||
     * 如果为 false 时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单
 | 
			
		||||
     */
 | 
			
		||||
    private Boolean alwaysShow;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -278,6 +278,7 @@ public class MenuServiceImpl implements MenuService {
 | 
			
		||||
        // 菜单为按钮类型时,无需 component、icon、path 属性,进行置空
 | 
			
		||||
        if (MenuTypeEnum.BUTTON.getType().equals(menu.getType())) {
 | 
			
		||||
            menu.setComponent("");
 | 
			
		||||
            menu.setComponentName("");
 | 
			
		||||
            menu.setIcon("");
 | 
			
		||||
            menu.setPath("");
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user