Index.cshtml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @{
  2. ViewBag.Title = "系统管理";
  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. @using CommonToolHelper;
  10. @model PageInfo<SYS_SYSTEM>
  11. <!-- table star -->
  12. <div class="row col-lg-12">
  13. <div class="wrapper wrapper-content animated fadeInUp">
  14. <div class="ibox">
  15. <div class="ibox-title">
  16. <h5>所有系统</h5>
  17. <div class="ibox-tools rboor">
  18. <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 创建新系统</a>
  19. <a class="btn btn-primary btn-xs p310" id="modify" action="edit"><i class="im-pencil2"></i> 编辑</a>
  20. <a class="btn btn-primary btn-xs p310" id="delete" action="remove"><i class="im-remove4"></i> 删除</a>
  21. </div>
  22. </div>
  23. <div class="ibox-content">
  24. <!-- search star -->
  25. @using (Ajax.BeginForm("Index", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
  26. {
  27. <div class="form-horizontal clearfix">
  28. <div class="col-lg-4 col-sm-3 pl0" style="width:50%;">
  29. <div class="form-group">
  30. <label class="control-label" style="width:70px; float:left;">授权状态:</label>
  31. <div class="col-lg-8 col-sm-7" style="width:150px !important;">
  32. <select id="status" name="status" class="input-sm form-control input-s-sm inline" style="width:auto;" onchange="submit()">
  33. <option value="" @(ViewData["status"] == null ? "selected=\"selected\"" : "")>全部</option>
  34. <option value="1" @(ViewData["status"] != null && ViewData["status"].ToString() != "" && ViewData["status"].ToString() == "1" ? "selected=\"selected\"" : "")>正常</option>
  35. <option value="0" @(ViewData["status"] != null && ViewData["status"].ToString() != "" && ViewData["status"].ToString() == "0" ? "selected=\"selected\"" : "")>禁止</option>
  36. </select>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="col-lg-4 col-sm-4" style="float:right;">
  41. <div class="form-group">
  42. <div class="col-lg-12 col-sm-12 input-group">
  43. @Html.TextBox("Search", null, new { @class = "input-sm form-control", @placeholder = "请输入查询关键词" })
  44. <span class="input-group-btn">
  45. <button type="button" onclick="submit()" class="btn btn-sm btn-primary"> 搜索</button>
  46. </span>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. }
  52. <!-- search end -->
  53. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  54. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  55. <thead>
  56. <tr>
  57. <th class="tn" style="width: 50px !important;text-align:center;padding-left:0px;"><input name="checkall" id="checkall" type="checkbox" value=""></th>
  58. <th>系统名称</th>
  59. <th>系统地址</th>
  60. <th>登录访问</th>
  61. <th>登录账号</th>
  62. <th>创建时间</th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. @{foreach (var item in Model.List)
  67. {
  68. <tr>
  69. <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
  70. <td>
  71. <a href="javascript:EditSystem('@item.ID')" listaction="Detail"> @item.NAME</a>
  72. </td>
  73. <td>@item.SITEURL</td>
  74. <td>@(item.IS_LOGIN == 0 ? "禁止" : "正常")</td>
  75. <td>@item.DOCKUSER</td>
  76. <td>@item.CREATEDATE</td>
  77. </tr>
  78. }
  79. }
  80. </tbody>
  81. </table>
  82. <!-- page -->
  83. <div class="bottom">
  84. <div class="dataTables_info" id="example_info" post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
  85. <div class="dataTables_length" id="example_length">
  86. <label>
  87. 显示
  88. <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
  89. <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
  90. <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
  91. <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
  92. <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
  93. </select> 项结果
  94. </label>
  95. </div>
  96. @CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url)
  97. <div class="clear"></div>
  98. </div>
  99. <!-- page -->
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <!-- table end -->
  106. @section scripts{
  107. <script type="text/javascript">
  108. //列表增加
  109. $("#insert").click(function () {
  110. dig.addModel("添加/编辑系统", "/Sys/System/detail", 700, 450, function () {
  111. if (this.returnValue == 'yes') {
  112. location.reload();
  113. }
  114. });
  115. });
  116. //跳转修改
  117. function EditSystem(n) {
  118. dig.addModel("添加/编辑系统", "/Sys/System/detail/" + n, 700, 450, function () {
  119. if (this.returnValue == 'yes') {
  120. location.reload();
  121. }
  122. });
  123. }
  124. //列表选择修改
  125. $('#modify').click(function () {
  126. var vals = '';
  127. var num = 0;
  128. $('input[name="checkbox_name"]:checked').each(function () {
  129. vals = $(this).val();
  130. num++;
  131. });
  132. if (!vals) {
  133. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  134. return;
  135. }
  136. if (num > 1) {
  137. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  138. return;
  139. }
  140. dig.addModel("添加/编辑系统", "/Sys/System/detail/" + vals, 700, 450, function () {
  141. if (this.returnValue == 'yes') {
  142. location.reload();
  143. }
  144. });
  145. });
  146. </script>
  147. }