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
Springboot Plus
Commits
985a8ff8
"...src/main/java/me/zhengjie/utils/ElConstant.java" did not exist on "81078698ae044bf4264b6af1e5b0901faceccf6e"
Commit
985a8ff8
authored
Mar 02, 2018
by
ykb
Browse files
修复了左侧导航菜单排序的问题
parent
65bbe68e
Changes
3
Hide whitespace changes
Inline
Side-by-side
admin-console/src/main/java/com/ibeetl/admin/console/service/MenuConsoleService.java
View file @
985a8ff8
...
@@ -11,6 +11,7 @@ import com.ibeetl.admin.core.util.PlatformException;
...
@@ -11,6 +11,7 @@ import com.ibeetl.admin.core.util.PlatformException;
import
org.beetl.sql.core.engine.PageQuery
;
import
org.beetl.sql.core.engine.PageQuery
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -56,7 +57,7 @@ public class MenuConsoleService extends BaseService<CoreMenu> {
...
@@ -56,7 +57,7 @@ public class MenuConsoleService extends BaseService<CoreMenu> {
}
}
platformService
.
clearMenuCache
();
platformService
.
clearMenuCache
();
}
}
public
void
updateMenu
(
CoreMenu
menu
)
{
public
void
updateMenu
(
CoreMenu
menu
)
{
menuDao
.
updateById
(
menu
);
menuDao
.
updateById
(
menu
);
platformService
.
clearMenuCache
();
platformService
.
clearMenuCache
();
...
...
admin-core/src/main/java/com/ibeetl/admin/core/rbac/tree/MenuItem.java
View file @
985a8ff8
...
@@ -15,9 +15,11 @@ public class MenuItem implements TreeItem{
...
@@ -15,9 +15,11 @@ public class MenuItem implements TreeItem{
@JsonIgnore
@JsonIgnore
MenuItem
parent
=
null
;
MenuItem
parent
=
null
;
String
name
;
String
name
;
private
Integer
seq
;
public
MenuItem
(
CoreMenu
sysMenu
){
public
MenuItem
(
CoreMenu
sysMenu
){
this
.
sysMenu
=
sysMenu
;
this
.
sysMenu
=
sysMenu
;
this
.
name
=
sysMenu
!=
null
?
sysMenu
.
getName
():
null
;
this
.
name
=
sysMenu
!=
null
?
sysMenu
.
getName
():
null
;
this
.
seq
=
sysMenu
.
getSeq
();
}
}
...
@@ -143,6 +145,19 @@ public class MenuItem implements TreeItem{
...
@@ -143,6 +145,19 @@ public class MenuItem implements TreeItem{
public
String
getName
()
{
public
String
getName
()
{
return
this
.
name
;
return
this
.
name
;
}
}
public
Integer
getSeq
()
{
return
seq
;
}
public
void
setSeq
(
Integer
seq
)
{
this
.
seq
=
seq
;
}
...
...
admin-core/src/main/java/com/ibeetl/admin/core/util/MenuBuildUtil.java
View file @
985a8ff8
package
com.ibeetl.admin.core.util
;
package
com.ibeetl.admin.core.util
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
com.ibeetl.admin.core.entity.CoreMenu
;
import
com.ibeetl.admin.core.entity.CoreMenu
;
...
@@ -42,9 +44,25 @@ public class MenuBuildUtil {
...
@@ -42,9 +44,25 @@ public class MenuBuildUtil {
if
(
list
.
isEmpty
())
{
if
(
list
.
isEmpty
())
{
return
;
return
;
}
}
sortMenu
(
parent
.
getChildren
());
for
(
MenuItem
child
:
parent
.
getChildren
())
{
for
(
MenuItem
child
:
parent
.
getChildren
())
{
buildTreeNode
(
child
,
list
);
buildTreeNode
(
child
,
list
);
}
}
}
}
private
static
void
sortMenu
(
List
<
MenuItem
>
children
)
{
Collections
.
sort
(
children
,
new
Comparator
<
MenuItem
>()
{
@Override
public
int
compare
(
MenuItem
o1
,
MenuItem
o2
)
{
return
o1
.
getSeq
().
compareTo
(
o2
.
getSeq
());
}
});
}
}
}
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