Commit 8fc04d4a authored by dqjdda's avatar dqjdda
Browse files

菜单管理功能加强,新增功能项:是否隐藏菜单(某些页面不需要显示在左侧菜单栏中),是否缓存菜单(可解决切换Tab重新渲染的问题)

parent e6146cb1
......@@ -34,6 +34,7 @@ public class Menu implements Serializable {
@NotNull
private Long sort;
@NotBlank
@Column(name = "path")
private String path;
......@@ -41,6 +42,12 @@ public class Menu implements Serializable {
private String icon;
@Column(columnDefinition = "bit(1) default 0")
private Boolean cache;
@Column(columnDefinition = "bit(1) default 0")
private Boolean hidden;
/**
* 上级菜单ID
*/
......
......@@ -15,4 +15,6 @@ public class MenuMetaVo implements Serializable {
private String title;
private String icon;
private Boolean noCache;
}
......@@ -19,6 +19,8 @@ public class MenuVo implements Serializable {
private String path;
private Boolean hidden;
private String redirect;
private String component;
......
......@@ -27,6 +27,10 @@ public class MenuDTO {
private Boolean iFrame;
private Boolean cache;
private Boolean hidden;
private String icon;
private List<MenuDTO> children;
......
......@@ -92,6 +92,8 @@ public class MenuServiceImpl implements MenuService {
menu.setIFrame(resources.getIFrame());
menu.setPid(resources.getPid());
menu.setSort(resources.getSort());
menu.setCache(resources.getCache());
menu.setHidden(resources.getHidden());
menuRepository.save(menu);
}
......@@ -158,6 +160,7 @@ public class MenuServiceImpl implements MenuService {
MenuVo menuVo = new MenuVo();
menuVo.setName(menuDTO.getName());
menuVo.setPath(menuDTO.getPath());
menuVo.setHidden(menuDTO.getHidden());
// 如果不是外链
if(!menuDTO.getIFrame()){
......@@ -169,7 +172,7 @@ public class MenuServiceImpl implements MenuService {
menuVo.setComponent(menuDTO.getComponent());
}
}
menuVo.setMeta(new MenuMetaVo(menuDTO.getName(),menuDTO.getIcon()));
menuVo.setMeta(new MenuMetaVo(menuDTO.getName(),menuDTO.getIcon(),!menuDTO.getCache()));
if(menuDTOList!=null && menuDTOList.size()!=0){
menuVo.setAlwaysShow(true);
menuVo.setRedirect("noredirect");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment