ComplianceServer/oldcode/WEB/Views/Base/Menu/ModuleEdit.cshtml

181 lines
5.9 KiB
Plaintext

@model WX.CRM.Model.Entity.BAS_MODULEMENU
@using WX.CRM.WebHelper;
@{
ViewBag.Title = "创建bas_ModuleMenu";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<link href="~/Content/MainMenu.css" rel="stylesheet" />
<style>
.main-Menu {
height: auto;
background-color: #1e71b1;
color: white;
width: 100%;
height: 300px;
}
.main-Menu li a {
border-color: #1e71b1;
border-radius: 3px;
border-style: solid;
border-width: 1px;
color: #fff;
display: inline;
float: left;
height: 56px;
overflow: hidden;
padding: 4px 7px 0;
text-align: center;
text-decoration: none;
width: 55px;
}
.main-Menu ul {
list-style: none outside none;
position: relative;
width: 100%;
}
.main-Menu li.list {
display: inline;
float: left;
margin: 9px 12px 5px 10px;
background-color: #1e71b1;
}
.main-Menu li a.onnav {
background-attachment: scroll;
background-clip: border-box;
background-color: rgb(16, 84, 136);
background-image: none;
background-origin: padding-box;
background-repeat: repeat;
background-size: auto auto;
border-color: #0f4e7f;
border-style: solid;
}
.main-Menu li a span.nc {
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-origin: padding-box;
background-repeat: no-repeat;
background-size: auto auto;
display: block;
height: 30px;
margin: 0 auto 2px;
overflow: hidden;
width: 32px;
}
</style>
<script type="text/javascript">
$(function () {
$("#btnSave").click(function () {
if ($("#CreateForm").valid()) {
$.r_ajax({
url: "/Base/Menu/ModuleEdit",
type: "Post",
data: $("#CreateForm").serialize(),
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);
}
}
});
}
return false;
});
$('#rightId').combotree({
url: "/Base/Bas_rightGroup/GetRightTreeList"
});
$("#MenuImage a").live("click", function () {
$(".onnav").removeClass("onnav");
$(this).addClass("onnav");
$("#map_IMAGEURL").val($(this).attr("title"));
});
});
var isShow = true;
function ChooseImg() {
if ($("#shishi").css("display") == "none")
$("#shishi").css("display", "");
else
$("#shishi").css("display", "none");
if (isShow) {
var chekimg = $("#map_IMAGEURL").val();
var acss = "";
$.r_post("/Base/Menu/GetMenuImg", function (data) {
$(data).each(function (i, n) {
if (chekimg == n.name)
acss = "class='onnav'";
else
acss = "";
$("#MenuImage").append("<li class='list'><a " + acss + " href='javascript:;' title='" + n.name + "'> <span style=\"background-image: url('" + n.imgurl + "');\" class=\"nc\"></span>" + n.name + "</a></li>");
});
}, "json");
isShow = false;
}
}
</script>
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
</div>
@using (Html.BeginForm("Edit", "bas_ModuleMenu", null, FormMethod.Post, new { Id = "CreateForm" }))
{
@Html.ValidationSummary(true)
<table class="fromEditTable setTextWidth300">
<tbody>
<tr>
<td width="60px" style="width:100px;">
@Html.LabelFor(m => m.map_MNAME)
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.map_MNAME)
@Html.HiddenFor(m => m.MODULEMENUID)
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.map_MNAME)
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
@Html.LabelFor(m => m.map_RIGHTID)
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.map_RIGHTID, new { style = "width:305px;" })
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.map_RIGHTID)
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
@Html.LabelFor(m => m.map_IMAGEURL)
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.map_IMAGEURL, new { style = "width:250px;" })
<a onclick="ChooseImg()" href="javascript:void(0);" id="showImg">选中图片</a>
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.map_IMAGEURL)
</td>
</tr>
</tbody>
</table>
<div id="shishi" class="main-Menu" style="display:none;">
<ul id="MenuImage"></ul>
</div>
}