Index.cshtml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Layout.cshtml";
  4. }
  5. @using MES.Production.Service;
  6. @using Central.Control.Domain;
  7. @using Ant.Service.Common;
  8. @model List<COM_INDEX>
  9. <!-- table star -->
  10. <div class="row col-lg-12">
  11. <div class="wrapper wrapper-content animated fadeInUp">
  12. <div class="ibox">
  13. <div class="ibox-title">
  14. <h5>快速导航管理</h5>
  15. <div class="ibox-tools rboor">
  16. <a class="btn btn-primary btn-xs p310" id="insert"><i class="im-plus"></i> 添加新导航</a>
  17. <a class="btn btn-primary btn-xs p310" id="modify"><i class="im-pencil2"></i> 编辑</a>
  18. <a class="btn btn-primary btn-xs p310" id="delete"><i class="im-remove4"></i> 删除</a>
  19. </div>
  20. </div>
  21. <div class="ibox-content">
  22. <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  23. <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
  24. <thead>
  25. <tr>
  26. <th class="tn" style="width: 50px !important;"><input name="checkall" id="checkall" type="checkbox" value=""></th>
  27. <th style="width:60px !important;">序号</th>
  28. <th>标题</th>
  29. <th>路径</th>
  30. <th style="width:80px !important;">图标</th>
  31. <th style="width:80px !important;">颜色</th>
  32. <th style="width:80px !important;">背景色</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. @{foreach (var item in Model)
  37. {
  38. <tr>
  39. <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
  40. <td>@item.SHOWORDER</td>
  41. <td><a href="javascript:detail('@item.ID')">@item.TITLE</a></td>
  42. <td>@item.PATH</td>
  43. <td style="color: #18a689;"><i class="@item.ICON"></i></td>
  44. <td><span style="width: 20px; line-height:20px; height: 20px; background-color:#000000; color: @item.COLOR">&nbsp;示例&nbsp;&nbsp;</span></td>
  45. <td><span style="width: 20px; line-height:20px; height: 20px; background-color: @item.BACKGROUNDCOLOR">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
  46. </tr>
  47. }
  48. }
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- table end -->
  57. @section scripts{
  58. <script type="text/javascript">
  59. function detail(id) {
  60. dig.addModel('添加/编辑导航', '/Com/WinIndex/Detail/' + id, 600, 350, function () {
  61. if (this.returnValue == 'yes'){
  62. location.reload();
  63. }
  64. });
  65. }
  66. $('#insert').click(function () { detail('') });
  67. //修改
  68. $('#modify').click(function () {
  69. var vals = '';
  70. var num = 0;
  71. $('input[name="checkbox_name"]:checked').each(function () {
  72. vals = $(this).val();
  73. num++;
  74. });
  75. if (!vals) {
  76. dig.alertError("提示", "对不起,请选中您要操作的记录!");
  77. return;
  78. }
  79. if (num > 1) {
  80. dig.alertError("提示", "对不起,每次只能修改一条记录!");
  81. return;
  82. }
  83. detail(vals);
  84. });
  85. </script>
  86. }