Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
39556526
Commit
39556526
authored
Oct 30, 2018
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新左侧菜单列表的模板
parent
8f42e769
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
24 deletions
+44
-24
src/main/java/cn/stylefeng/guns/modular/system/controller/DashboardController.java
+18
-0
src/main/webapp/WEB-INF/common/_sidebar.html
+25
-23
src/main/webapp/WEB-INF/dashboard.html
+1
-1
src/main/webapp/assets/images/users/1.jpg
+0
-0
No files found.
src/main/java/cn/stylefeng/guns/modular/system/controller/DashboardController.java
View file @
39556526
...
...
@@ -15,6 +15,10 @@
*/
package
cn
.
stylefeng
.
guns
.
modular
.
system
.
controller
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.stylefeng.guns.core.common.node.MenuNode
;
import
cn.stylefeng.guns.core.util.ApiMenuFilter
;
import
cn.stylefeng.guns.modular.system.service.IMenuService
;
import
cn.stylefeng.guns.modular.system.service.INoticeService
;
import
cn.stylefeng.roses.core.base.controller.BaseController
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -38,6 +42,9 @@ public class DashboardController extends BaseController {
@Autowired
private
INoticeService
noticeService
;
@Autowired
private
IMenuService
menuService
;
/**
* 跳转到黑板
*/
...
...
@@ -45,6 +52,17 @@ public class DashboardController extends BaseController {
public
String
blackboard
(
Model
model
)
{
List
<
Map
<
String
,
Object
>>
notices
=
noticeService
.
list
(
null
);
model
.
addAttribute
(
"noticeList"
,
notices
);
//获取菜单列表
List
<
MenuNode
>
menus
=
menuService
.
getMenusByRoleIds
(
CollectionUtil
.
newArrayList
(
1
));
List
<
MenuNode
>
titles
=
MenuNode
.
buildTitle
(
menus
);
titles
=
ApiMenuFilter
.
build
(
titles
);
model
.
addAttribute
(
"titles"
,
titles
);
//获取用户头像
model
.
addAttribute
(
"avatar"
,
"12.jpg"
);
return
"/dashboard.html"
;
}
}
src/main/webapp/WEB-INF/common/_sidebar.html
View file @
39556526
...
...
@@ -2,33 +2,35 @@
<div
class=
"scroll-sidebar"
>
<nav
class=
"sidebar-nav"
>
<ul
id=
"sidebarnav"
>
<li>
<a
href=
"/blackboard"
><i
class=
"mdi mdi-access-point"
></i>
通知
</a>
</li>
<li>
<a
class=
"has-arrow"
href=
"#"
aria-expanded=
"false"
><i
class=
"mdi mdi-account-circle"
></i><span
class=
"hide-menu"
>
系统管理
</span></a>
<ul
aria-expanded=
"false"
class=
"collapse"
>
<li><a
href=
"index.html"
>
用户管理
</a></li>
<li><a
href=
"index2.html"
>
角色管理
</a></li>
<li><a
href=
"index3.html"
>
部门管理
</a></li>
<li><a
href=
"index4.html"
>
字典管理
</a></li>
</ul>
</li>
<li>
<a
class=
"has-arrow "
href=
"#"
aria-expanded=
"false"
><i
class=
"mdi mdi-apps"
></i><span
class=
"hide-menu"
>
后台管理
</span></a>
<ul
aria-expanded=
"false"
class=
"collapse"
>
<li><a
href=
"index2.html"
>
菜单管理
</a></li>
@for(title in titles){
@if(tool.isEmpty(title.children)){
<li>
<a
class=
"has-arrow"
href=
"#"
aria-expanded=
"false"
>
日志管理
</a>
<a
href=
"${ctxPath}${title.url}"
><i
class=
"mdi ${title.icon}"
></i>
${title.name}
</a>
</li>
@}else{
<li>
<a
class=
"has-arrow "
href=
"#"
aria-expanded=
"false"
>
<i
class=
"mdi ${title.icon}"
></i><span
class=
"hide-menu"
>
${title.name}
</span>
</a>
<ul
aria-expanded=
"false"
class=
"collapse"
>
<li><a
href=
"log1.html"
>
登录日志
</a></li>
<li><a
href=
"log2.html"
>
业务日志
</a></li>
@for(subTitle in title.children){
@if(tool.isEmpty(subTitle.children)){
<li><a
href=
"${ctxPath}${subTitle.url}"
>
${subTitle.name}
</a></li>
@}else{
<li>
<a
class=
"has-arrow"
href=
"#"
aria-expanded=
"false"
>
${subTitle.name}
</a>
<ul
aria-expanded=
"false"
class=
"collapse"
>
@for(thirdTitle in subTitle.children){
<li><a
href=
"${ctxPath}${thirdTitle.url}"
>
${thirdTitle.name}
</a></li>
@}
</ul>
</li>
@}
@}
</ul>
</li>
<li><a
href=
"index3.html"
>
监控管理
</a></li>
<li><a
href=
"index5.html"
>
通知管理
</a></li>
</ul>
</li>
@}
@}
</ul>
</nav>
</div>
...
...
src/main/webapp/WEB-INF/dashboard.html
View file @
39556526
@layout("/common/_container.html",{title:"概览
页面
"}){
@layout("/common/_container.html",{title:"概览"}){
<div
class=
"row"
>
<div
class=
"col-12"
>
@for(notice in noticeList){
...
...
src/main/webapp/assets/images/users/1.jpg
0 → 100644
View file @
39556526
93.4 KB
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