mirror of https://gitee.com/stylefeng/roses
【menu】更新获取antdv的所有菜单接口,删除菜单表path字段
parent
6473ee7479
commit
9d3a780a20
File diff suppressed because one or more lines are too long
|
@ -34,11 +34,6 @@ public class AntdSysMenuResponse {
|
|||
*/
|
||||
private String antdvRouter;
|
||||
|
||||
/**
|
||||
* 前端用路径,适用于antdvue版本
|
||||
*/
|
||||
private String antdvPath;
|
||||
|
||||
/**
|
||||
* 图标,适用于antd vue版本
|
||||
*/
|
||||
|
|
|
@ -100,12 +100,6 @@ public class SysMenu extends BaseEntity implements AbstractTreeNode {
|
|||
@TableField("antdv_router")
|
||||
private String antdvRouter;
|
||||
|
||||
/**
|
||||
* 前端用路径,适用于antdvue版本
|
||||
*/
|
||||
@TableField("antdv_path")
|
||||
private String antdvPath;
|
||||
|
||||
/**
|
||||
* 图标,适用于antd vue版本
|
||||
*/
|
||||
|
|
|
@ -43,7 +43,6 @@ public class AntdMenusFactory {
|
|||
// 填充路由等信息
|
||||
antdvMenuItem.setRouter(antdSysMenuResponse.getAntdvRouter());
|
||||
antdvMenuItem.setIcon(antdSysMenuResponse.getAntdvIcon());
|
||||
antdvMenuItem.setPath(antdSysMenuResponse.getAntdvPath());
|
||||
|
||||
// 填充哪个角色绑定了这个菜单
|
||||
List<SimpleRoleInfo> roles = antdSysMenuResponse.getRoles();
|
||||
|
@ -61,10 +60,32 @@ public class AntdMenusFactory {
|
|||
antdvMenuItems.add(antdvMenuItem);
|
||||
}
|
||||
|
||||
// 加入根节点
|
||||
antdvMenuItems.add(createAntdVMenuRoot());
|
||||
|
||||
// 构造菜单树
|
||||
return new DefaultTreeBuildFactory<AntdvMenuItem>().doTreeBuild(antdvMenuItems);
|
||||
return new DefaultTreeBuildFactory<AntdvMenuItem>(SystemConstants.VIRTUAL_ROOT_PARENT_ID.toString()).doTreeBuild(antdvMenuItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建虚拟根节点
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/30 20:38
|
||||
*/
|
||||
private static AntdvMenuItem createAntdVMenuRoot() {
|
||||
AntdvMenuItem antdvMenuItem = new AntdvMenuItem();
|
||||
antdvMenuItem.setRouter("root");
|
||||
antdvMenuItem.setName("根节点");
|
||||
antdvMenuItem.setMenuId(SystemConstants.DEFAULT_PARENT_ID);
|
||||
antdvMenuItem.setMenuParentId(SystemConstants.VIRTUAL_ROOT_PARENT_ID);
|
||||
|
||||
antdvMenuItem.setAuthority(null);
|
||||
|
||||
return antdvMenuItem;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将数据库表的菜单,转化为vue antd admin识别的菜单路由格式
|
||||
*
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<result column="menu_parent_id" property="menuParentId"/>
|
||||
<result column="menu_name" property="menuName"/>
|
||||
<result column="antdv_router" property="antdvRouter"/>
|
||||
<result column="antdv_path" property="antdvPath"/>
|
||||
<result column="antdv_icon" property="antdvIcon"/>
|
||||
<collection property="roles" ofType="cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleRoleInfo">
|
||||
<id column="role_id" property="roleId"/>
|
||||
|
@ -21,7 +20,6 @@
|
|||
sm.menu_parent_id,
|
||||
sm.menu_name,
|
||||
sm.antdv_router,
|
||||
sm.antdv_path,
|
||||
sm.antdv_icon,
|
||||
sr.role_id,
|
||||
sr.role_name,
|
||||
|
|
|
@ -34,11 +34,6 @@ public class AntdvMenuItem implements AbstractTreeNode {
|
|||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 路径信息
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue