Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
a5e38f6f
提交
a5e38f6f
authored
9月 08, 2021
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
菜单管理支持配置路由参数
上级
4988b585
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
85 行增加
和
36 行删除
+85
-36
SysMenu.java
...ain/java/com/ruoyi/common/core/domain/entity/SysMenu.java
+13
-0
RouterVo.java
...em/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
+15
-0
SysMenuServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
+1
-0
SysMenuMapper.xml
...system/src/main/resources/mapper/system/SysMenuMapper.xml
+8
-4
Link.vue
ruoyi-ui/src/layout/components/Sidebar/Link.vue
+1
-1
SidebarItem.vue
ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
+6
-2
index.js
ruoyi-ui/src/router/index.js
+13
-12
index.vue
ruoyi-ui/src/views/system/menu/index.vue
+25
-14
quartz.sql
sql/quartz.sql
+3
-3
ry_20210908.sql
sql/ry_20210908.sql
+0
-0
没有找到文件。
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
浏览文件 @
a5e38f6f
...
...
@@ -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
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
浏览文件 @
a5e38f6f
...
...
@@ -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
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
浏览文件 @
a5e38f6f
...
...
@@ -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
<
SysMenu
>
cMenus
=
menu
.
getChildren
();
if
(!
cMenus
.
isEmpty
()
&&
cMenus
.
size
()
>
0
&&
UserConstants
.
TYPE_DIR
.
equals
(
menu
.
getMenuType
()))
...
...
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
浏览文件 @
a5e38f6f
...
...
@@ -12,6 +12,7 @@
<result
property=
"orderNum"
column=
"order_num"
/>
<result
property=
"path"
column=
"path"
/>
<result
property=
"component"
column=
"component"
/>
<result
property=
"query"
column=
"query"
/>
<result
property=
"isFrame"
column=
"is_frame"
/>
<result
property=
"isCache"
column=
"is_cache"
/>
<result
property=
"menuType"
column=
"menu_type"
/>
...
...
@@ -27,7 +28,7 @@
</resultMap>
<sql
id=
"selectMenuVo"
>
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
</sql>
...
...
@@ -48,13 +49,13 @@
</select>
<select
id=
"selectMenuTreeAll"
resultMap=
"SysMenuResult"
>
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.
query, m.
visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
order by m.parent_id, m.order_num
</select>
<select
id=
"selectMenuListByUserId"
parameterType=
"SysMenu"
resultMap=
"SysMenuResult"
>
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.
query, m.
visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
...
...
@@ -73,7 +74,7 @@
</select>
<select
id=
"selectMenuTreeByUserId"
parameterType=
"Long"
resultMap=
"SysMenuResult"
>
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.
query, m.
visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
...
...
@@ -132,6 +133,7 @@
<if
test=
"orderNum != null and orderNum != ''"
>
order_num = #{orderNum},
</if>
<if
test=
"path != null and path != ''"
>
path = #{path},
</if>
<if
test=
"component != null"
>
component = #{component},
</if>
<if
test=
"query != null"
>
query = #{query},
</if>
<if
test=
"isFrame != null and isFrame != ''"
>
is_frame = #{isFrame},
</if>
<if
test=
"isCache != null and isCache != ''"
>
is_cache = #{isCache},
</if>
<if
test=
"menuType != null and menuType != ''"
>
menu_type = #{menuType},
</if>
...
...
@@ -154,6 +156,7 @@
<if
test=
"orderNum != null and orderNum != ''"
>
order_num,
</if>
<if
test=
"path != null and path != ''"
>
path,
</if>
<if
test=
"component != null and component != ''"
>
component,
</if>
<if
test=
"query != null and query != ''"
>
query,
</if>
<if
test=
"isFrame != null and isFrame != ''"
>
is_frame,
</if>
<if
test=
"isCache != null and isCache != ''"
>
is_cache,
</if>
<if
test=
"menuType != null and menuType != ''"
>
menu_type,
</if>
...
...
@@ -171,6 +174,7 @@
<if
test=
"orderNum != null and orderNum != ''"
>
#{orderNum},
</if>
<if
test=
"path != null and path != ''"
>
#{path},
</if>
<if
test=
"component != null and component != ''"
>
#{component},
</if>
<if
test=
"query != null and query != ''"
>
#{query},
</if>
<if
test=
"isFrame != null and isFrame != ''"
>
#{isFrame},
</if>
<if
test=
"isCache != null and isCache != ''"
>
#{isCache},
</if>
<if
test=
"menuType != null and menuType != ''"
>
#{menuType},
</if>
...
...
ruoyi-ui/src/layout/components/Sidebar/Link.vue
浏览文件 @
a5e38f6f
...
...
@@ -10,7 +10,7 @@ import { isExternal } from '@/utils/validate'
export
default
{
props
:
{
to
:
{
type
:
String
,
type
:
[
String
,
Object
]
,
required
:
true
}
},
...
...
ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
浏览文件 @
a5e38f6f
<
template
>
<div
v-if=
"!item.hidden"
>
<template
v-if=
"hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"
>
<app-link
v-if=
"onlyOneChild.meta"
:to=
"resolvePath(onlyOneChild.path)"
>
<app-link
v-if=
"onlyOneChild.meta"
:to=
"resolvePath(onlyOneChild.path
, onlyOneChild.query
)"
>
<el-menu-item
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{'submenu-title-noDropdown':!isNest}">
<item
:icon=
"onlyOneChild.meta.icon||(item.meta&&item.meta.icon)"
:title=
"onlyOneChild.meta.title"
/>
</el-menu-item>
...
...
@@ -82,13 +82,17 @@ export default {
return
false
},
resolvePath
(
routePath
)
{
resolvePath
(
routePath
,
routeQuery
)
{
if
(
isExternal
(
routePath
))
{
return
routePath
}
if
(
isExternal
(
this
.
basePath
))
{
return
this
.
basePath
}
if
(
routeQuery
)
{
let
query
=
JSON
.
parse
(
routeQuery
);
return
{
path
:
path
.
resolve
(
this
.
basePath
,
routePath
),
query
:
query
}
}
return
path
.
resolve
(
this
.
basePath
,
routePath
)
}
}
...
...
ruoyi-ui/src/router/index.js
浏览文件 @
a5e38f6f
...
...
@@ -9,19 +9,20 @@ import Layout from '@/layout'
/**
* Note: 路由配置项
*
* hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
* alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
* // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
* // 若你想不管路由下面的 children 声明的个数都显示你的根路由
* // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
* redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
* name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
* hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
* alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
* // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
* // 若你想不管路由下面的 children 声明的个数都显示你的根路由
* // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
* redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
* name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
* query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
* meta : {
noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
noCache: true
// 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
title: 'title'
// 设置该路由在侧边栏和面包屑中展示的名字
icon: 'svg-name'
// 设置该路由的图标,对应路径src/assets/icons/svg
breadcrumb: false
// 如果设置为false,则不会在breadcrumb面包屑中显示
activeMenu: '/system/user'
// 当路由设置了该属性,则会高亮相对应的侧边栏。
}
*/
...
...
ruoyi-ui/src/views/system/menu/index.vue
浏览文件 @
a5e38f6f
...
...
@@ -205,6 +205,31 @@
</span>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
v-if=
"form.menuType == 'C'"
>
<el-input
v-model=
"form.query"
placeholder=
"请输入路由参数"
maxlength=
"255"
/>
<span
slot=
"label"
>
<el-tooltip
content=
'访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`'
placement=
"top"
>
<i
class=
"el-icon-question"
></i>
</el-tooltip>
路由参数
</span>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
v-if=
"form.menuType == 'C'"
>
<span
slot=
"label"
>
<el-tooltip
content=
"选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致"
placement=
"top"
>
<i
class=
"el-icon-question"
></i>
</el-tooltip>
是否缓存
</span>
<el-radio-group
v-model=
"form.isCache"
>
<el-radio
label=
"0"
>
缓存
</el-radio>
<el-radio
label=
"1"
>
不缓存
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
v-if=
"form.menuType != 'F'"
>
<span
slot=
"label"
>
...
...
@@ -239,20 +264,6 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
v-if=
"form.menuType == 'C'"
>
<span
slot=
"label"
>
<el-tooltip
content=
"选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致"
placement=
"top"
>
<i
class=
"el-icon-question"
></i>
</el-tooltip>
是否缓存
</span>
<el-radio-group
v-model=
"form.isCache"
>
<el-radio
label=
"0"
>
缓存
</el-radio>
<el-radio
label=
"1"
>
不缓存
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
sql/quartz.sql
浏览文件 @
a5e38f6f
...
...
@@ -56,7 +56,7 @@ create table QRTZ_TRIGGERS (
-- ----------------------------
create
table
QRTZ_SIMPLE_TRIGGERS
(
sched_name
varchar
(
120
)
not
null
comment
'调度名称'
,
trigger_name
varchar
(
200
)
not
null
comment
'qrtz_triggers表trigger_
name的外键'
,
trigger_name
varchar
(
200
)
not
null
comment
'qrtz_triggers表trigger_name的外键'
,
trigger_group
varchar
(
200
)
not
null
comment
'qrtz_triggers表trigger_group的外键'
,
repeat_count
bigint
(
7
)
not
null
comment
'重复的次数统计'
,
repeat_interval
bigint
(
12
)
not
null
comment
'重复的间隔时间'
,
...
...
@@ -134,7 +134,7 @@ create table QRTZ_FIRED_TRIGGERS (
-- ----------------------------
create
table
QRTZ_SCHEDULER_STATE
(
sched_name
varchar
(
120
)
not
null
comment
'调度名称'
,
instance_name
varchar
(
200
)
not
null
comment
'
之前配置文件中org.quartz.scheduler.instanceId配置的名字,就会写入该字段
'
,
instance_name
varchar
(
200
)
not
null
comment
'
实例名称
'
,
last_checkin_time
bigint
(
13
)
not
null
comment
'上次检查时间'
,
checkin_interval
bigint
(
13
)
not
null
comment
'检查间隔时间'
,
primary
key
(
sched_name
,
instance_name
)
...
...
@@ -154,7 +154,7 @@ create table QRTZ_LOCKS (
-- ----------------------------
create
table
QRTZ_SIMPROP_TRIGGERS
(
sched_name
varchar
(
120
)
not
null
comment
'调度名称'
,
trigger_name
varchar
(
200
)
not
null
comment
'qrtz_triggers表trigger_
name的外键'
,
trigger_name
varchar
(
200
)
not
null
comment
'qrtz_triggers表trigger_name的外键'
,
trigger_group
varchar
(
200
)
not
null
comment
'qrtz_triggers表trigger_group的外键'
,
str_prop_1
varchar
(
512
)
null
comment
'String类型的trigger的第一个参数'
,
str_prop_2
varchar
(
512
)
null
comment
'String类型的trigger的第二个参数'
,
...
...
sql/ry_20210
731
.sql
→
sql/ry_20210
908
.sql
浏览文件 @
a5e38f6f
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论