73 lines
2.5 KiB
Plaintext
73 lines
2.5 KiB
Plaintext
@using WX.CRM.WebHelper;
|
|
@{
|
|
ViewBag.Title = "创建bas_agent";
|
|
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
|
|
|
|
}
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#btnSave").click(function () {
|
|
var checked = $("#ut").tree("getChecked");
|
|
var menuIds = "";
|
|
$(checked).each(function (i, n) {
|
|
if (n.id.indexOf("-") == -1)
|
|
menuIds += n.id + ",";
|
|
});
|
|
if (menuIds.length > 0)
|
|
menuIds = menuIds.substr(0, menuIds.length - 1);
|
|
if (menuIds.length == 0)
|
|
{
|
|
$.messager.alert("提示", "请你选中最底部菜单!", "error")
|
|
return false;
|
|
}
|
|
$.r_ajax({
|
|
url: "/Base/DailyMemu/Edit",
|
|
type: "Post",
|
|
data: { menuIds: menuIds },
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.type == 1) {
|
|
window.parent.frameReturnByMes(data.message);
|
|
window.parent.frameReturnByReload(true);
|
|
window.parent.frameReturnByClose()
|
|
}
|
|
else {
|
|
window.parent.frameReturnByMes(data.message);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
$("#btnCollapse").click(function () {
|
|
$("#ut").tree("collapseAll");
|
|
});
|
|
$("#btnExpand").click(function () {
|
|
$("#ut").tree("expandAll");
|
|
});
|
|
$('#ut').tree({
|
|
checkbox: true,
|
|
lines: true,
|
|
url: "/Base/Menu/GetMenuTreeJsonByRight",
|
|
onLoadSuccess: function () {
|
|
var setValue = "@Html.Raw(ViewBag.setValue)";
|
|
if (setValue != "") {
|
|
var nvalues = setValue.split(",");
|
|
$(nvalues).each(function (index, nvalue) {
|
|
$("#ut").tree("check", $("#ut").tree("find", nvalue).target);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<div class="mvctool bgb">
|
|
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
|
|
@Html.ToolButtonPlain("btnCollapse", "icon-flag", "折叠全部", false, "")
|
|
@Html.ToolButtonPlain("btnExpand", "icon-show", "展开全部", false, "")
|
|
</div>
|
|
<div class="formContent">
|
|
<ul id="ut"></ul>
|
|
<div style="height:50px;"></div>
|
|
</div>
|