fix(user): 菜单order排序
This commit is contained in:
@@ -29,35 +29,41 @@ public class MetaVo
|
||||
*/
|
||||
private String link;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer order;
|
||||
|
||||
public MetaVo()
|
||||
{
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon)
|
||||
public MetaVo(String title, String icon, Integer order)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, boolean noCache)
|
||||
public MetaVo(String title, String icon, boolean noCache, Integer order)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, String link)
|
||||
public MetaVo(String title, String icon, String link, Integer order)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.link = link;
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, boolean noCache, String link)
|
||||
public MetaVo(String title, String icon, boolean noCache, String link, Integer order)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
this.order = order;
|
||||
if (StringUtils.ishttp(link))
|
||||
{
|
||||
this.link = link;
|
||||
@@ -103,4 +109,12 @@ public class MetaVo
|
||||
{
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
public Integer getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(Integer order) {
|
||||
this.order = order;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public class UMenuServiceImpl implements IUMenuService
|
||||
router.setPath(getRouterPath(menu));
|
||||
router.setComponent(getComponent(menu));
|
||||
router.setQuery(menu.getQuery());
|
||||
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.getOrderNum()));
|
||||
List<UMenu> cMenus = menu.getChildren();
|
||||
if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
|
||||
{
|
||||
@@ -184,14 +184,14 @@ public class UMenuServiceImpl implements IUMenuService
|
||||
children.setPath(menu.getPath());
|
||||
children.setComponent(menu.getComponent());
|
||||
children.setName(menu.getName());
|
||||
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.getOrderNum()));
|
||||
children.setQuery(menu.getQuery());
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
}
|
||||
else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
|
||||
{
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getOrderNum()));
|
||||
router.setPath("/");
|
||||
List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
||||
RouterVo children = new RouterVo();
|
||||
@@ -199,7 +199,7 @@ public class UMenuServiceImpl implements IUMenuService
|
||||
children.setPath(routerPath);
|
||||
children.setComponent(UserConstants.INNER_LINK);
|
||||
children.setName(menu.getName());
|
||||
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath()));
|
||||
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath(), menu.getOrderNum()));
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user