105 lines
4.7 KiB
Plaintext
105 lines
4.7 KiB
Plaintext
@model IList<COMCMS.Core.AdminMenu>
|
|
@{
|
|
ViewBag.title = "后台菜单管理";
|
|
}
|
|
<div class="wrapper wrapper-content">
|
|
<div class="ibox float-e-margins">
|
|
<div class="ibox-content">
|
|
<div id="toolbar" class="btn-group">
|
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addadminmenu','添加后台菜单','/AdminCP/Permission/AddAdminMenu',0,0);">
|
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
|
</button>
|
|
</div>
|
|
|
|
<div id="toolbar2" class="btn-group pull-right">
|
|
<button id="btn_refresh" type="button" class="btn btn-outline btn-default" onclick="refresh();">
|
|
<span class="fa fa-refresh" aria-hidden="true"></span>刷新
|
|
</button>
|
|
</div>
|
|
<table class="tree table table-striped table-bordered table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>菜单名称</th>
|
|
<th>菜单Key</th>
|
|
<th class="text-center">排序</th>
|
|
<th>链接地址</th>
|
|
<th class="text-center">隐藏</th>
|
|
<th>权限详情</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
@if (Model.Count == 0)
|
|
{
|
|
<tr><td colspan="7" class="text-center">暂无记录</td></tr>
|
|
}
|
|
@foreach (var m in Model)
|
|
{
|
|
<tr class="treegrid-@m.Id @(m.PId !=0?"treegrid-parent-"+m.PId:"") ">
|
|
<td>
|
|
@if (!string.IsNullOrWhiteSpace(m.ClassName))
|
|
{
|
|
<i class="fa @m.ClassName"></i>
|
|
}
|
|
@m.MenuName
|
|
</td>
|
|
<td>@m.MenuKey</td>
|
|
<td class="text-center">@m.Rank</td>
|
|
<td>@m.Link</td>
|
|
<td class="text-center">
|
|
@if (m.IsHide == 1)
|
|
{
|
|
<i class="fa fa-eye-slash text-danger" style="cursor:pointer" onclick="doChangeHide(@(m.Id))" title="点击取消隐藏该菜单"></i>
|
|
}
|
|
else
|
|
{
|
|
<i class="fa fa-eye text-success" style="cursor:pointer" onclick="doChangeHide(@(m.Id))" title="点击隐藏该菜单"></i>
|
|
}
|
|
</td>
|
|
<td>
|
|
@foreach (var e in @m.ListEvent)
|
|
{
|
|
<span>@e.EventName</span>
|
|
}
|
|
|
|
</td>
|
|
<td>
|
|
<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog('eidtadminmenu', '编辑后台菜单详情', '/AdminCP/Permission/EditAdminMenu/@m.Id', 0, 0)"><i class="fa fa-edit"></i> 编辑</a>
|
|
<a href="javascript:;" class="btn btn-xs btn-danger" title="删除" onclick="doDel('/AdminCP/Permission/DelAdminMenu',@m.Id);"><i class="fa fa-close"></i> 删除</a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
<script type="text/javascript">
|
|
$(document).ready(function () {
|
|
$('.tree').treegrid();
|
|
});
|
|
function doChangeHide(id) {
|
|
var loading = layer.load(0, {
|
|
shade: [0.2, '#000'] //0.1透明度的背景
|
|
});
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/AdminCP/Permission/DoChangeAdminMenuHide",
|
|
data: { id: id },
|
|
dataType: "JSON",
|
|
success: function (data) {
|
|
if (data.status == "success") {
|
|
layer.close(loading);
|
|
window.location.href = window.location.href;
|
|
} else {
|
|
layer.close(loading);
|
|
layer.alert(data.message, { icon: 2 });
|
|
}
|
|
},
|
|
error: function () {
|
|
layer.close(loading);
|
|
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div> |