优化后台栏目页面,增加快速显示和隐藏菜单
This commit is contained in:
@@ -418,6 +418,27 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
tip.Message = "删除后台菜单成功";
|
tip.Message = "删除后台菜单成功";
|
||||||
return Json(tip);
|
return Json(tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//修改栏目是否隐藏
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("edit", "adminmenu", "JSON")]
|
||||||
|
public IActionResult DoChangeAdminMenuHide(int id)
|
||||||
|
{
|
||||||
|
AdminMenu entity = AdminMenu.Find(AdminMenu._.Id == id);
|
||||||
|
if (entity == null)
|
||||||
|
{
|
||||||
|
tip.Message = "系统找不到本记录!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
if (entity.IsHide == 1)
|
||||||
|
entity.IsHide = 0;
|
||||||
|
else
|
||||||
|
entity.IsHide = 1;
|
||||||
|
entity.Update();
|
||||||
|
tip.Status = JsonTip.SUCCESS;
|
||||||
|
tip.Message = "修改菜单隐藏状态成功";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 系统运行日志
|
#region 系统运行日志
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<span class="fa fa-refresh" aria-hidden="true"></span>刷新
|
<span class="fa fa-refresh" aria-hidden="true"></span>刷新
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<table class="tree table table-striped table-bordered">
|
<table class="tree table table-striped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>菜单名称</th>
|
<th>菜单名称</th>
|
||||||
@@ -48,7 +48,11 @@
|
|||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
@if (m.IsHide == 1)
|
@if (m.IsHide == 1)
|
||||||
{
|
{
|
||||||
<i class="fa fa-eye-slash"></i>
|
<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>
|
||||||
<td>
|
<td>
|
||||||
@@ -69,6 +73,30 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.tree').treegrid();
|
$('.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>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user