Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
a69cc94f
Commit
a69cc94f
authored
Nov 28, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
三级菜单自动配置组件
parent
c666faed
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
5 deletions
+27
-5
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
...rc/main/java/com/ruoyi/common/constant/UserConstants.java
+3
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
+15
-0
ruoyi-ui/src/components/ParentView/index.vue
ruoyi-ui/src/components/ParentView/index.vue
+3
-3
ruoyi-ui/src/router/index.js
ruoyi-ui/src/router/index.js
+1
-0
ruoyi-ui/src/store/modules/permission.js
ruoyi-ui/src/store/modules/permission.js
+4
-1
sql/ry_20201128.sql
sql/ry_20201128.sql
+1
-1
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
View file @
a69cc94f
...
...
@@ -54,6 +54,9 @@ public class UserConstants
/** Layout组件标识 */
public
final
static
String
LAYOUT
=
"Layout"
;
/** ParentView组件标识 */
public
final
static
String
PARENT_VIEW
=
"ParentView"
;
/** 校验返回结果码 */
public
final
static
String
UNIQUE
=
"0"
;
public
final
static
String
NOT_UNIQUE
=
"1"
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
View file @
a69cc94f
...
...
@@ -364,6 +364,10 @@ public class SysMenuServiceImpl implements ISysMenuService
{
component
=
menu
.
getComponent
();
}
else
if
(
StringUtils
.
isEmpty
(
menu
.
getComponent
())
&&
isParentView
(
menu
))
{
component
=
UserConstants
.
PARENT_VIEW
;
}
return
component
;
}
...
...
@@ -379,6 +383,17 @@ public class SysMenuServiceImpl implements ISysMenuService
&&
menu
.
getIsFrame
().
equals
(
UserConstants
.
NO_FRAME
);
}
/**
* 是否为parent_view组件
*
* @param menu 菜单信息
* @return 结果
*/
public
boolean
isParentView
(
SysMenu
menu
)
{
return
menu
.
getParentId
().
intValue
()
!=
0
&&
UserConstants
.
TYPE_DIR
.
equals
(
menu
.
getMenuType
());
}
/**
* 根据父节点的ID获取所有子节点
*
...
...
ruoyi-ui/src/
views/system/log
/index.vue
→
ruoyi-ui/src/
components/ParentView
/index.vue
View file @
a69cc94f
<
template
>
<router-view
/>
</
template
>
<
template
>
<router-view
/>
</
template
>
ruoyi-ui/src/router/index.js
View file @
a69cc94f
...
...
@@ -5,6 +5,7 @@ Vue.use(Router)
/* Layout */
import
Layout
from
'
@/layout
'
import
ParentView
from
'
@/components/ParentView
'
;
/**
* Note: 路由配置项
...
...
ruoyi-ui/src/store/modules/permission.js
View file @
a69cc94f
import
{
constantRoutes
}
from
'
@/router
'
import
{
getRouters
}
from
'
@/api/menu
'
import
Layout
from
'
@/layout/index
'
import
ParentView
from
'
@/components/ParentView
'
;
const
permission
=
{
state
:
{
...
...
@@ -33,9 +34,11 @@ const permission = {
function
filterAsyncRouter
(
asyncRouterMap
)
{
return
asyncRouterMap
.
filter
(
route
=>
{
if
(
route
.
component
)
{
// Layout组件特殊处理
// Layout
ParentView
组件特殊处理
if
(
route
.
component
===
'
Layout
'
)
{
route
.
component
=
Layout
}
else
if
(
route
.
component
===
'
ParentView
'
)
{
route
.
component
=
ParentView
}
else
{
route
.
component
=
loadView
(
route
.
component
)
}
...
...
sql/ry_2020112
3
.sql
→
sql/ry_2020112
8
.sql
View file @
a69cc94f
...
...
@@ -169,7 +169,7 @@ insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 's
insert
into
sys_menu
values
(
'105'
,
'字典管理'
,
'1'
,
'6'
,
'dict'
,
'system/dict/index'
,
1
,
0
,
'C'
,
'0'
,
'0'
,
'system:dict:list'
,
'dict'
,
'admin'
,
sysdate
(),
''
,
null
,
'字典管理菜单'
);
insert
into
sys_menu
values
(
'106'
,
'参数设置'
,
'1'
,
'7'
,
'config'
,
'system/config/index'
,
1
,
0
,
'C'
,
'0'
,
'0'
,
'system:config:list'
,
'edit'
,
'admin'
,
sysdate
(),
''
,
null
,
'参数设置菜单'
);
insert
into
sys_menu
values
(
'107'
,
'通知公告'
,
'1'
,
'8'
,
'notice'
,
'system/notice/index'
,
1
,
0
,
'C'
,
'0'
,
'0'
,
'system:notice:list'
,
'message'
,
'admin'
,
sysdate
(),
''
,
null
,
'通知公告菜单'
);
insert
into
sys_menu
values
(
'108'
,
'日志管理'
,
'1'
,
'9'
,
'log'
,
'
system/log/index'
,
1
,
0
,
'M'
,
'0'
,
'0'
,
''
,
'log'
,
'admin'
,
sysdate
(),
''
,
null
,
'日志管理菜单'
);
insert
into
sys_menu
values
(
'108'
,
'日志管理'
,
'1'
,
'9'
,
'log'
,
'
'
,
1
,
0
,
'M'
,
'0'
,
'0'
,
''
,
'log'
,
'admin'
,
sysdate
(),
''
,
null
,
'日志管理菜单'
);
insert
into
sys_menu
values
(
'109'
,
'在线用户'
,
'2'
,
'1'
,
'online'
,
'monitor/online/index'
,
1
,
0
,
'C'
,
'0'
,
'0'
,
'monitor:online:list'
,
'online'
,
'admin'
,
sysdate
(),
''
,
null
,
'在线用户菜单'
);
insert
into
sys_menu
values
(
'110'
,
'定时任务'
,
'2'
,
'2'
,
'job'
,
'monitor/job/index'
,
1
,
0
,
'C'
,
'0'
,
'0'
,
'monitor:job:list'
,
'job'
,
'admin'
,
sysdate
(),
''
,
null
,
'定时任务菜单'
);
insert
into
sys_menu
values
(
'111'
,
'数据监控'
,
'2'
,
'3'
,
'druid'
,
'monitor/druid/index'
,
1
,
0
,
'C'
,
'0'
,
'0'
,
'monitor:druid:list'
,
'druid'
,
'admin'
,
sysdate
(),
''
,
null
,
'数据监控菜单'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment