菜单父节点选择弹框内增加子菜单支持

This commit is contained in:
Argo-Lenovo 2016-11-06 00:23:16 +08:00
parent 33d65cd0b0
commit ce142d0adb
4 changed files with 22 additions and 12 deletions

View File

@ -249,6 +249,7 @@
<Content Include="Views\Shared\MenuTree.cshtml" /> <Content Include="Views\Shared\MenuTree.cshtml" />
<Content Include="Views\Shared\SubNavigation.cshtml" /> <Content Include="Views\Shared\SubNavigation.cshtml" />
<Content Include="Views\Shared\SubMenu.cshtml" /> <Content Include="Views\Shared\SubMenu.cshtml" />
<Content Include="Views\Shared\SubMenuTree.cshtml" />
<None Include="Web.Debug.config"> <None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon> <DependentUpon>Web.config</DependentUpon>
</None> </None>

View File

@ -14,7 +14,7 @@
<li> <li>
<div class="menu-submenu"> <div class="menu-submenu">
@foreach (var menu in Model.Menus) @foreach (var menu in Model.Menus)
{ {
@Html.Partial("SubMenu", menu) @Html.Partial("SubMenu", menu)
} }
</div> </div>

View File

@ -5,17 +5,12 @@
<h4 class="modal-title" id="myMenuModalLabel">请选择菜单</h4> <h4 class="modal-title" id="myMenuModalLabel">请选择菜单</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="dd" id="nestable_menu"> @if (Model.Count() > 0)
<ol class="dd-list"> {
@foreach (var menu in Model) <div class="dd" id="nestable_menu">
{ @Html.Partial("SubMenuTree", @Model)
<li class="dd-item dd3-item" data-id="@menu.ID"> </div>
<div class="dd-handle dd3-handle"></div> }
<div class="dd3-content"><label><input name="menuParent" type="checkbox" value="@menu.ID" /><input type="radio" name="menu" value="@menu.ID" /><span>@menu.Name</span></label></div>
</li>
}
</ol>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

View File

@ -0,0 +1,14 @@
@model IEnumerable<Menu>
<ol class="dd-list">
@foreach (var menu in Model)
{
<li class="dd-item dd3-item" data-id="@menu.ID">
<div class="dd-handle dd3-handle"></div>
<div class="dd3-content"><label><input name="menuParent" type="checkbox" value="@menu.ID" /><input type="radio" name="menu" value="@menu.ID" /><span>@menu.Name</span></label></div>
@if (menu.Menus.Count() > 0)
{
@Html.Partial("SubMenuTree", menu.Menus)
}
</li>
}
</ol>