92 lines
3.3 KiB
Plaintext
92 lines
3.3 KiB
Plaintext
@model Air.Model.AirAdminViewModel.Bas_RightGroupModel
|
|
@using Mini.Web.WebHelper;
|
|
@{
|
|
ViewBag.Title = "Edit";
|
|
Layout = "~/Areas/Admin/Views/Shared/_Index_LayoutEdit.cshtml";
|
|
}
|
|
@section scripts{
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#map_PARENTID").attr("data-val-noinput-input", "@(ViewBag.notId as string == "" ? "[-1]" : ViewBag.notId as string )");
|
|
})
|
|
</script>
|
|
}
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#btnSave").click(function () {
|
|
if ($("#CreateForm").valid()) {
|
|
$(".combo").css("display", "");
|
|
if (!$("#ParentId").valid())
|
|
return;
|
|
$.r_ajax({
|
|
url: "Edit",
|
|
type: "Post",
|
|
data: $("#CreateForm").serialize(),
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.type == 1) {
|
|
window.parent.frameReturnByMes(data.message);
|
|
window.parent.frameReturnByReload('@Model.ParentId');
|
|
window.parent.frameReturnByClose()
|
|
}
|
|
else {
|
|
window.parent.frameReturnByMes(data.message);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return false;
|
|
});
|
|
$('#comboTree').combotree({
|
|
url:"GetAllGroupTree",
|
|
required: true,
|
|
heiht: "400",
|
|
onSelect: function (node) {
|
|
$("#ParentId").attr("value", node.id);
|
|
if (!$("#ParentId").valid()) {
|
|
$(".combo").addClass("input-validation-error");
|
|
$(".combo-text").addClass("input-validation-error");
|
|
} else {
|
|
$(".combo").removeClass("input-validation-error");
|
|
$(".combo-text").removeClass("input-validation-error");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<div class="mvctool bgb">
|
|
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
|
|
</div>
|
|
<form id="CreateForm">
|
|
@Html.ValidationSummary(true)
|
|
<table class="fromEditTable setTextWidth300">
|
|
<tbody>
|
|
<tr>
|
|
<td width="60px" style="width:100px;">
|
|
@Html.LabelFor(m => m.ParentId)
|
|
</td>
|
|
<td style="width:310px">
|
|
@Html.TextBoxFor(m => m.ParentId, new { style = "width:305px;display:none;" })
|
|
<input id="comboTree" style="width: 305px;" value="@Model.ParentId" />
|
|
</td>
|
|
<td width="120px">
|
|
@Html.ValidationMessageFor(m => m.ParentId)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="60px" style="width:100px;">
|
|
@Html.LabelFor(m => m.Name)
|
|
</td>
|
|
<td style="width:310px">
|
|
@Html.TextBoxFor(m => m.Name)
|
|
@Html.HiddenFor(m => m.PkId)
|
|
</td>
|
|
<td width="120px">
|
|
@Html.ValidationMessageFor(m => m.Name)
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</form> |