Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
8fc04d4a
Commit
8fc04d4a
authored
Aug 27, 2019
by
dqjdda
Browse files
菜单管理功能加强,新增功能项:是否隐藏菜单(某些页面不需要显示在左侧菜单栏中),是否缓存菜单(可解决切换Tab重新渲染的问题)
parent
e6146cb1
Changes
5
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java
View file @
8fc04d4a
...
@@ -34,6 +34,7 @@ public class Menu implements Serializable {
...
@@ -34,6 +34,7 @@ public class Menu implements Serializable {
@NotNull
@NotNull
private
Long
sort
;
private
Long
sort
;
@NotBlank
@Column
(
name
=
"path"
)
@Column
(
name
=
"path"
)
private
String
path
;
private
String
path
;
...
@@ -41,6 +42,12 @@ public class Menu implements Serializable {
...
@@ -41,6 +42,12 @@ public class Menu implements Serializable {
private
String
icon
;
private
String
icon
;
@Column
(
columnDefinition
=
"bit(1) default 0"
)
private
Boolean
cache
;
@Column
(
columnDefinition
=
"bit(1) default 0"
)
private
Boolean
hidden
;
/**
/**
* 上级菜单ID
* 上级菜单ID
*/
*/
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java
View file @
8fc04d4a
...
@@ -15,4 +15,6 @@ public class MenuMetaVo implements Serializable {
...
@@ -15,4 +15,6 @@ public class MenuMetaVo implements Serializable {
private
String
title
;
private
String
title
;
private
String
icon
;
private
String
icon
;
private
Boolean
noCache
;
}
}
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java
View file @
8fc04d4a
...
@@ -19,6 +19,8 @@ public class MenuVo implements Serializable {
...
@@ -19,6 +19,8 @@ public class MenuVo implements Serializable {
private
String
path
;
private
String
path
;
private
Boolean
hidden
;
private
String
redirect
;
private
String
redirect
;
private
String
component
;
private
String
component
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDTO.java
View file @
8fc04d4a
...
@@ -27,6 +27,10 @@ public class MenuDTO {
...
@@ -27,6 +27,10 @@ public class MenuDTO {
private
Boolean
iFrame
;
private
Boolean
iFrame
;
private
Boolean
cache
;
private
Boolean
hidden
;
private
String
icon
;
private
String
icon
;
private
List
<
MenuDTO
>
children
;
private
List
<
MenuDTO
>
children
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java
View file @
8fc04d4a
...
@@ -92,6 +92,8 @@ public class MenuServiceImpl implements MenuService {
...
@@ -92,6 +92,8 @@ public class MenuServiceImpl implements MenuService {
menu
.
setIFrame
(
resources
.
getIFrame
());
menu
.
setIFrame
(
resources
.
getIFrame
());
menu
.
setPid
(
resources
.
getPid
());
menu
.
setPid
(
resources
.
getPid
());
menu
.
setSort
(
resources
.
getSort
());
menu
.
setSort
(
resources
.
getSort
());
menu
.
setCache
(
resources
.
getCache
());
menu
.
setHidden
(
resources
.
getHidden
());
menuRepository
.
save
(
menu
);
menuRepository
.
save
(
menu
);
}
}
...
@@ -158,6 +160,7 @@ public class MenuServiceImpl implements MenuService {
...
@@ -158,6 +160,7 @@ public class MenuServiceImpl implements MenuService {
MenuVo
menuVo
=
new
MenuVo
();
MenuVo
menuVo
=
new
MenuVo
();
menuVo
.
setName
(
menuDTO
.
getName
());
menuVo
.
setName
(
menuDTO
.
getName
());
menuVo
.
setPath
(
menuDTO
.
getPath
());
menuVo
.
setPath
(
menuDTO
.
getPath
());
menuVo
.
setHidden
(
menuDTO
.
getHidden
());
// 如果不是外链
// 如果不是外链
if
(!
menuDTO
.
getIFrame
()){
if
(!
menuDTO
.
getIFrame
()){
...
@@ -169,7 +172,7 @@ public class MenuServiceImpl implements MenuService {
...
@@ -169,7 +172,7 @@ public class MenuServiceImpl implements MenuService {
menuVo
.
setComponent
(
menuDTO
.
getComponent
());
menuVo
.
setComponent
(
menuDTO
.
getComponent
());
}
}
}
}
menuVo
.
setMeta
(
new
MenuMetaVo
(
menuDTO
.
getName
(),
menuDTO
.
getIcon
()));
menuVo
.
setMeta
(
new
MenuMetaVo
(
menuDTO
.
getName
(),
menuDTO
.
getIcon
()
,!
menuDTO
.
getCache
()
));
if
(
menuDTOList
!=
null
&&
menuDTOList
.
size
()!=
0
){
if
(
menuDTOList
!=
null
&&
menuDTOList
.
size
()!=
0
){
menuVo
.
setAlwaysShow
(
true
);
menuVo
.
setAlwaysShow
(
true
);
menuVo
.
setRedirect
(
"noredirect"
);
menuVo
.
setRedirect
(
"noredirect"
);
...
...
Write
Preview
Supports
Markdown
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