-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat]存在三级菜单(包括三级以上)时,自动把顶级菜单作为子模块,在头部导航条呈现子模块大菜单,左边菜单树仅显示该子模块下级菜单,以解…
…决菜单数量过多的问题。
- Loading branch information
Showing
4 changed files
with
93 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,10 @@ | |
var cfg = ViewBag.Config as SysConfig; | ||
var name = cfg == null ? "" : cfg.DisplayName; | ||
|
||
// 模块菜单 | ||
var module = Context.Request.Query["module"].ToString(); | ||
var ms = user.GetModules(); | ||
|
||
var set = CubeSetting.Current; | ||
} | ||
<!-- #section:basics/navbar.layout --> | ||
|
@@ -30,14 +34,27 @@ | |
</button> | ||
|
||
<!-- /section:basics/sidebar.mobile.toggle --> | ||
<div class="pull-left"> | ||
<div class="navbar-header"> | ||
<!-- #section:basics/navbar.layout.brand --> | ||
<a href="@ViewBag.Main" class="navbar-brand" target="main"> | ||
<a href="/Admin" class="navbar-brand"> | ||
<small> | ||
@name | ||
</small> | ||
</a> | ||
</div> | ||
<ul class="nav nav-pills navbar-nav"> | ||
@foreach (var item in ms) | ||
{ | ||
if (item.Key.EqualIgnoreCase(module)) | ||
{ | ||
<li class="active"><a class="nav-link" href="[email protected]">@item.Value</a></li> | ||
} | ||
else | ||
{ | ||
<li><a class="nav-link" href="[email protected]">@item.Value</a></li> | ||
} | ||
} | ||
</ul> | ||
|
||
<!-- #section:basics/navbar.dropdown --> | ||
<div class="navbar-buttons navbar-header pull-right" role="navigation"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,10 @@ | |
var cfg = ViewBag.Config as SysConfig; | ||
var name = cfg == null ? "" : cfg.DisplayName; | ||
|
||
// 模块菜单 | ||
var module = Context.Request.Query["module"].ToString(); | ||
var ms = user.GetModules(); | ||
|
||
var set = CubeSetting.Current; | ||
} | ||
|
||
|
@@ -25,6 +29,19 @@ | |
<i class="layui-icon layui-icon-spread-left"></i> | ||
</li> | ||
</ul> | ||
<ul class="layui-nav layui-layout-left"> | ||
@foreach (var item in ms) | ||
{ | ||
if (item.Key.EqualIgnoreCase(module)) | ||
{ | ||
<li class="layui-nav-item active" lay-header-event="menuLeft"><a href="[email protected]">@item.Value</a></li> | ||
} | ||
else | ||
{ | ||
<li class="layui-nav-item" lay-header-event="menuLeft"><a href="[email protected]">@item.Value</a></li> | ||
} | ||
} | ||
</ul> | ||
|
||
<ul class="layui-nav layui-layout-right"> | ||
<li class="layui-nav-item layui-show-md-inline-block"> | ||
|