From a5e38f6f9993ad34c3d0566762d71d1093ef88d4 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 8 Sep 2021 09:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=85=8D=E7=BD=AE=E8=B7=AF=E7=94=B1=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/SysMenu.java | 13 ++ .../com/ruoyi/system/domain/vo/RouterVo.java | 15 ++ .../service/impl/SysMenuServiceImpl.java | 1 + .../resources/mapper/system/SysMenuMapper.xml | 12 +- .../src/layout/components/Sidebar/Link.vue | 2 +- .../layout/components/Sidebar/SidebarItem.vue | 8 +- ruoyi-ui/src/router/index.js | 25 +-- ruoyi-ui/src/views/system/menu/index.vue | 39 ++-- sql/quartz.sql | 6 +- sql/{ry_20210731.sql => ry_20210908.sql} | 167 +++++++++--------- 10 files changed, 169 insertions(+), 119 deletions(-) rename sql/{ry_20210731.sql => ry_20210908.sql} (82%) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java index 7c35744..8c7c494 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java @@ -38,6 +38,9 @@ public class SysMenu extends BaseEntity /** 组件路径 */ private String component; + /** 路由参数 */ + private String query; + /** 是否为外链(0是 1否) */ private String isFrame; @@ -137,6 +140,16 @@ public class SysMenu extends BaseEntity this.component = component; } + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + public String getIsFrame() { return isFrame; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java index 21ff6b5..2d4a2b8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java @@ -36,6 +36,11 @@ public class RouterVo */ private String component; + /** + * 路由参数:如 {"id": 1, "name": "ry"} + */ + private String query; + /** * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 */ @@ -101,6 +106,16 @@ public class RouterVo this.component = component; } + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + public Boolean getAlwaysShow() { return alwaysShow; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index e8da922..f450caa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -151,6 +151,7 @@ public class SysMenuServiceImpl implements ISysMenuService router.setName(getRouteName(menu)); 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())); List cMenus = menu.getChildren(); if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml index afd7e0e..9f9fcb6 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -12,6 +12,7 @@ + @@ -27,7 +28,7 @@ - select menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time + select menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time from sys_menu @@ -48,13 +49,13 @@