Detail.cshtml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. @{
  2. ViewBag.Title = "Detail";
  3. Layout = "~/Views/Shared/_Layout.cshtml";
  4. }
  5. @using MES.Production.Service;
  6. @using Central.Control.Domain;
  7. @using Ant.Service.Common;
  8. @using Ant.Service.Common.Enums;
  9. @model SYS_MODULE
  10. <style>
  11. body {
  12. background-color: white;
  13. }
  14. .changeicon {
  15. float: right;
  16. margin-right: -52px;
  17. border: none;
  18. background-color: #18a689;
  19. color: #FFFFFF;
  20. height: 33px;
  21. margin-top: -6px;
  22. }
  23. .removeicon {
  24. background-color: #f8ac59;
  25. float: right;
  26. margin-right: -92px;
  27. border: none;
  28. color: #FFFFFF;
  29. height: 33px;
  30. margin-top: -6px;
  31. }
  32. #icon {
  33. padding-top: 5px;
  34. padding-left: 5px;
  35. width: 50%;
  36. text-align:left;
  37. }
  38. </style>
  39. @using (Ajax.BeginForm("Save", null, new AjaxOptions()
  40. {
  41. HttpMethod = "Post",
  42. OnBegin = "SubAjax.Loading",
  43. OnComplete = "SubAjax.Complate",
  44. OnFailure = "SubAjax.Failure",
  45. OnSuccess = "SubAjax.Success"
  46. },
  47. new { @class = "form-horizontal dig-from", @role = "form" }))
  48. {
  49. <div class="wrapper-content">
  50. <div class="panel-body">
  51. <div class="tab-content">
  52. <div id="tab-1" class="tab-pane active">
  53. <div class="form-group">
  54. <label class="col-lg-3 control-label">所属系统:</label>
  55. <div class="col-lg-8">
  56. <select id="FK_BELONGSYSTEM" name="FK_BELONGSYSTEM" class="form-control" style="width: 100%;">
  57. @{foreach (var item in ViewData["Systemlist"] as dynamic){
  58. <option value="@item.ID" @(Model.FK_BELONGSYSTEM == item.ID ? "selected=\"selected\"" : "")>@item.NAME</option>
  59. }}
  60. </select>
  61. </div>
  62. </div>
  63. <div class="form-group">
  64. <label class="col-lg-3 control-label">上级模块:</label>
  65. <div class="col-lg-8">
  66. @Html.Hidden("parentmodule", Model.PARENTID)
  67. <select id="PARENTID" name="PARENTID" class="form-control select2" style="width: 100%;"></select>
  68. </div>
  69. </div>
  70. <div class="clearfix f-hafl">
  71. <div class="col-hafl">
  72. <div class="form-group">
  73. <label class="col-lg-3 control-label">模块名称:</label>
  74. <div class="col-lg-8">
  75. @Html.HiddenFor(p => p.ID)
  76. @Html.TextBoxFor(p => p.NAME, new { @class = "form-control", @placeholder = "请输入模块名称", @datatype = "*1-100", @nullmsg = "请输入模块名称!", @errormsg = "请输入模块名称!" })
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-lg-3 control-label">排序值:</label>
  81. <div class="col-lg-8">
  82. @Html.TextBoxFor(p => p.SHOWORDER, new { @class = "form-control", @placeholder = "请输入模块排序值", @datatype = "n", @nullmsg = "请输入模块排序值", @errormsg = "只能输入数字" })
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <label class="col-lg-3 control-label">图标:</label>
  87. <div class="col-lg-8">
  88. <span id="icon" class="form-control">
  89. @Html.Hidden("ICON", Model.ICON)
  90. <a class="btn btn-primary btn-xs"><i class="@Model.ICON"></i></a>
  91. <button class="changeicon" type="button">
  92. 选择
  93. </button>
  94. <button class="removeicon" type="button">
  95. 移除
  96. </button>
  97. </span>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="col-hafl">
  102. <div class="form-group">
  103. <label class="col-lg-3 control-label" style="width: 29% !important;">模块别名:</label>
  104. <div class="col-lg-8">
  105. @Html.TextBoxFor(p => p.ALIAS, new { @class = "form-control", @placeholder = "请输入模块别名", @datatype = "s1-20", @nullmsg = "请输入模块别名!", @errormsg = "模块别名不能包含中文!" })
  106. </div>
  107. </div>
  108. <div class="form-group">
  109. <label class="col-lg-3 control-label" style="width: 29% !important; ">特殊属性:</label>
  110. <div class="col-lg-8" style="text-align:left;">
  111. <label class="checkbox-inline">
  112. <input type="checkbox" name="ISSHOW" class="i-checks" @(Model.ISSHOW == 1 ? "checked=\"checked\"" : "") />
  113. 是否显示
  114. </label>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <div class="clearfix"></div>
  120. <div class="form-group">
  121. <label class="col-lg-3 control-label">模块类型:</label>
  122. <div class="col-lg-8">
  123. @{ string[] str = ViewData["ModuleType"] as string[];
  124. for (int i = 0; i < str.Length; i++)
  125. {
  126. <label class="radio-inline">
  127. <input type="radio" name="MODULETYPE" value="@(i+1)" @(Model.MODULETYPE == i + 1 ? "checked" : "")>@str[i]
  128. </label>
  129. }
  130. }
  131. </div>
  132. </div>
  133. <div class="form-group">
  134. <label class="col-lg-3 control-label">模块路径:</label>
  135. <div class="col-lg-8">
  136. @Html.TextBoxFor(p => p.MODULEPATH, new { @class = "form-control", @placeholder = "请输入模块路径" })
  137. </div>
  138. </div>
  139. <div class="hr-line-dashed">
  140. <div class="form-group m20">
  141. <div class="col-sm-2 col-sm-offset-2">
  142. <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
  143. <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. }
  152. @section scripts{
  153. <script type="text/javascript">
  154. //更换父模块
  155. function changeModule(s) {
  156. $.post('/Sys/Module/FindParnetModule', { s: s }, function (json) {
  157. var parentid = $('#parentmodule').val();
  158. if (json != '') {
  159. var html = $('#PARENTID');
  160. html.html('<option value="0"><i class="im-plus"></i>一级模块</option>');
  161. for (var i = 0; i < json.length; i++) {
  162. if (json[i].ID == parentid) {
  163. html.append('<option value=\'' + json[i].ID + '\' selected="selected">' + json[i].NAME + '</option>');
  164. } else {
  165. html.append('<option value=\'' + json[i].ID + '\'>' + json[i].NAME + '</option>');
  166. }
  167. }
  168. }
  169. }, 'json');
  170. }
  171. //切换模块
  172. $('#FK_BELONGSYSTEM').change(function () {
  173. changeModule($('#FK_BELONGSYSTEM').val());
  174. });
  175. $(function () {
  176. $('.form-horizontal').initValidform();
  177. // $('.select2').select2();
  178. //初始加载
  179. if ($('#FK_BELONGSYSTEM').val() != '') {
  180. changeModule($('#FK_BELONGSYSTEM').val());
  181. }
  182. //添加时加载无页面
  183. if ($('#ID').val() == '') {
  184. $('input[name="MODULETYPE"]').eq(0).prop('checked', true);
  185. }
  186. });
  187. //移除图标
  188. $('.removeicon').click(function () {
  189. $('#icon').find('a>i').attr('class', '');
  190. });
  191. //选择图标
  192. $('.changeicon').click(function () {
  193. var oldicon = $('#icon').find('a>i');
  194. top.dialog({
  195. title: '选择图标',
  196. url: '/Sys/Module/ShowIcon',
  197. width: 700,
  198. height: 380,
  199. data: oldicon.attr('class'), // 给 iframe 的数据
  200. onclose: function () {
  201. this.returnValue && oldicon.attr('class', this.returnValue) && $('#ICON').val(this.returnValue);
  202. },
  203. oniframeload: function () {
  204. }
  205. }).showModal();
  206. return false;
  207. });
  208. </script>
  209. }