123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- @{
- ViewBag.Title = "Detail";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- @using MES.Production.Service;
- @using Central.Control.Domain;
- @using Ant.Service.Common;
- @using Ant.Service.Common.Enums;
- @model SYS_MODULE
- <style>
- body {
- background-color: white;
- }
- .changeicon {
- float: right;
- margin-right: -52px;
- border: none;
- background-color: #18a689;
- color: #FFFFFF;
- height: 33px;
- margin-top: -6px;
- }
- .removeicon {
- background-color: #f8ac59;
- float: right;
- margin-right: -92px;
- border: none;
- color: #FFFFFF;
- height: 33px;
- margin-top: -6px;
- }
- #icon {
- padding-top: 5px;
- padding-left: 5px;
- width: 50%;
- text-align:left;
- }
- </style>
- @using (Ajax.BeginForm("Save", null, new AjaxOptions()
- {
- HttpMethod = "Post",
- OnBegin = "SubAjax.Loading",
- OnComplete = "SubAjax.Complate",
- OnFailure = "SubAjax.Failure",
- OnSuccess = "SubAjax.Success"
- },
- new { @class = "form-horizontal dig-from", @role = "form" }))
- {
- <div class="wrapper-content">
- <div class="panel-body">
- <div class="tab-content">
- <div id="tab-1" class="tab-pane active">
- <div class="form-group">
- <label class="col-lg-3 control-label">所属系统:</label>
- <div class="col-lg-8">
- <select id="FK_BELONGSYSTEM" name="FK_BELONGSYSTEM" class="form-control" style="width: 100%;">
- @{foreach (var item in ViewData["Systemlist"] as dynamic){
- <option value="@item.ID" @(Model.FK_BELONGSYSTEM == item.ID ? "selected=\"selected\"" : "")>@item.NAME</option>
- }}
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">上级模块:</label>
- <div class="col-lg-8">
- @Html.Hidden("parentmodule", Model.PARENTID)
- <select id="PARENTID" name="PARENTID" class="form-control select2" style="width: 100%;"></select>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">模块名称:</label>
- <div class="col-lg-8">
- @Html.HiddenFor(p => p.ID)
- @Html.TextBoxFor(p => p.NAME, new { @class = "form-control", @placeholder = "请输入模块名称", @datatype = "*1-100", @nullmsg = "请输入模块名称!", @errormsg = "请输入模块名称!" })
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">排序值:</label>
- <div class="col-lg-8">
- @Html.TextBoxFor(p => p.SHOWORDER, new { @class = "form-control", @placeholder = "请输入模块排序值", @datatype = "n", @nullmsg = "请输入模块排序值", @errormsg = "只能输入数字" })
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">图标:</label>
- <div class="col-lg-8">
- <span id="icon" class="form-control">
- @Html.Hidden("ICON", Model.ICON)
- <a class="btn btn-primary btn-xs"><i class="@Model.ICON"></i></a>
- <button class="changeicon" type="button">
- 选择
- </button>
- <button class="removeicon" type="button">
- 移除
- </button>
- </span>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width: 29% !important;">模块别名:</label>
- <div class="col-lg-8">
- @Html.TextBoxFor(p => p.ALIAS, new { @class = "form-control", @placeholder = "请输入模块别名", @datatype = "s1-20", @nullmsg = "请输入模块别名!", @errormsg = "模块别名不能包含中文!" })
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width: 29% !important; ">特殊属性:</label>
- <div class="col-lg-8" style="text-align:left;">
- <label class="checkbox-inline">
- <input type="checkbox" name="ISSHOW" class="i-checks" @(Model.ISSHOW == 1 ? "checked=\"checked\"" : "") />
- 是否显示
- </label>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix"></div>
- <div class="form-group">
- <label class="col-lg-3 control-label">模块类型:</label>
- <div class="col-lg-8">
- @{ string[] str = ViewData["ModuleType"] as string[];
- for (int i = 0; i < str.Length; i++)
- {
- <label class="radio-inline">
- <input type="radio" name="MODULETYPE" value="@(i+1)" @(Model.MODULETYPE == i + 1 ? "checked" : "")>@str[i]
- </label>
- }
- }
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">模块路径:</label>
- <div class="col-lg-8">
- @Html.TextBoxFor(p => p.MODULEPATH, new { @class = "form-control", @placeholder = "请输入模块路径" })
- </div>
- </div>
- <div class="hr-line-dashed">
- <div class="form-group m20">
- <div class="col-sm-2 col-sm-offset-2">
- <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
- <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- }
- @section scripts{
- <script type="text/javascript">
- //更换父模块
- function changeModule(s) {
- $.post('/Sys/Module/FindParnetModule', { s: s }, function (json) {
- var parentid = $('#parentmodule').val();
- if (json != '') {
- var html = $('#PARENTID');
- html.html('<option value="0"><i class="im-plus"></i>一级模块</option>');
- for (var i = 0; i < json.length; i++) {
- if (json[i].ID == parentid) {
- html.append('<option value=\'' + json[i].ID + '\' selected="selected">' + json[i].NAME + '</option>');
- } else {
- html.append('<option value=\'' + json[i].ID + '\'>' + json[i].NAME + '</option>');
- }
- }
- }
- }, 'json');
- }
- //切换模块
- $('#FK_BELONGSYSTEM').change(function () {
- changeModule($('#FK_BELONGSYSTEM').val());
- });
- $(function () {
- $('.form-horizontal').initValidform();
- // $('.select2').select2();
- //初始加载
- if ($('#FK_BELONGSYSTEM').val() != '') {
- changeModule($('#FK_BELONGSYSTEM').val());
- }
- //添加时加载无页面
- if ($('#ID').val() == '') {
- $('input[name="MODULETYPE"]').eq(0).prop('checked', true);
- }
- });
- //移除图标
- $('.removeicon').click(function () {
- $('#icon').find('a>i').attr('class', '');
- });
- //选择图标
- $('.changeicon').click(function () {
- var oldicon = $('#icon').find('a>i');
- top.dialog({
- title: '选择图标',
- url: '/Sys/Module/ShowIcon',
- width: 700,
- height: 380,
- data: oldicon.attr('class'), // 给 iframe 的数据
- onclose: function () {
- this.returnValue && oldicon.attr('class', this.returnValue) && $('#ICON').val(this.returnValue);
- },
- oniframeload: function () {
- }
- }).showModal();
- return false;
- });
- </script>
- }
|