纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
5.9 KiB

3 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. var moduleId = $.request("moduleId");
  7. $(function () {
  8. gridList();
  9. })
  10. function gridList() {
  11. $("#gridList").dataGrid({
  12. treeGrid: true,
  13. treeGridModel: "adjacency",
  14. ExpandColumn: "F_Location",
  15. url: "/SystemManage/ModuleButton/GetTreeGridJson?moduleId=" + moduleId,
  16. height: $(window).height() - 90,
  17. colModel: [
  18. { label: "主键", name: "F_Id", hidden: true, key: true },
  19. { label: '名称', name: 'F_FullName', width: 150, align: 'left' },
  20. {
  21. label: '位置', name: 'F_Location', width: 80, align: 'left',
  22. formatter: function (cellvalue) {
  23. if (cellvalue == 1) {
  24. return "初始";
  25. } else {
  26. return "选中";
  27. }
  28. }
  29. },
  30. { label: '事件', name: 'F_JsEvent', width: 150, align: 'left' },
  31. { label: '连接', name: 'F_UrlAddress', width: 270, align: 'left' },
  32. {
  33. label: "分开", name: "F_Split", width: 60, align: "center",
  34. formatter: function (cellvalue) {
  35. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  36. }
  37. },
  38. {
  39. label: "公共", name: "F_IsPublic", width: 60, align: "center",
  40. formatter: function (cellvalue) {
  41. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  42. }
  43. },
  44. {
  45. label: "有效", name: "F_EnabledMark", width: 60, align: "center", autowidth: false,
  46. formatter: function (cellvalue) {
  47. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  48. }
  49. }
  50. ]
  51. });
  52. }
  53. function btn_add() {
  54. $.modalOpen({
  55. id: "Form",
  56. title: "新增按钮",
  57. url: "/SystemManage/ModuleButton/Form?moduleId=" + moduleId,
  58. width: "700px",
  59. height: "440px",
  60. callBack: function (iframeId) {
  61. top.frames[iframeId].submitForm();
  62. }
  63. });
  64. }
  65. function btn_edit() {
  66. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  67. $.modalOpen({
  68. id: "Form",
  69. title: "修改按钮",
  70. url: "/SystemManage/ModuleButton/Form?moduleId=" + moduleId + "&keyValue=" + keyValue,
  71. width: "700px",
  72. height: "440px",
  73. callBack: function (iframeId) {
  74. top.frames[iframeId].submitForm();
  75. }
  76. });
  77. }
  78. function btn_delete() {
  79. $.deleteForm({
  80. url: "/SystemManage/ModuleButton/DeleteForm",
  81. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  82. success: function () {
  83. $("#gridList").resetSelection();
  84. $("#gridList").trigger("reloadGrid");
  85. }
  86. })
  87. }
  88. function btn_details() {
  89. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  90. $.modalOpen({
  91. id: "Details",
  92. title: "查看按钮",
  93. url: "/SystemManage/ModuleButton/Details?moduleId=" + moduleId + "&keyValue=" + keyValue,
  94. width: "700px",
  95. height: "490px",
  96. btn: null,
  97. });
  98. }
  99. function btn_clonebutton() {
  100. $.modalOpen({
  101. id: "CloneButton",
  102. title: "克隆按钮",
  103. url: "/SystemManage/ModuleButton/CloneButton?moduleId=" + moduleId,
  104. width: "400px",
  105. height: "600px",
  106. callBack: function (iframeId) {
  107. top.frames[iframeId].submitForm();
  108. }
  109. });
  110. }
  111. </script>
  112. <div class="topPanel" style="border: 0px;">
  113. <div class="search">
  114. <table>
  115. <tr>
  116. <td>
  117. <div class="input-group">
  118. <input type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;">
  119. <span class="input-group-btn">
  120. <button type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  121. </span>
  122. </div>
  123. </td>
  124. </tr>
  125. </table>
  126. </div>
  127. <div class="toolbar">
  128. <div class="btn-group">
  129. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  130. </div>
  131. <div class="btn-group">
  132. <a class="btn btn-primary" onclick="btn_add()"><i class="fa fa-plus"></i>新建按钮</a>
  133. </div>
  134. <div class="btn-group">
  135. <a class="btn btn-primary" onclick="btn_clonebutton()"><i class="fa fa-paste"></i>克隆按钮</a>
  136. </div>
  137. <div class="operate">
  138. <ul class="nav nav-pills">
  139. <li class="first">已选中<span>1</span>项</li>
  140. <li><a onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改按钮</a></li>
  141. <li><a onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除按钮</a></li>
  142. <li><a onclick="btn_details()"><i class="fa fa-search-plus"></i>查看按钮</a></li>
  143. </ul>
  144. <a href="javascript:;" class="close"></a>
  145. </div>
  146. </div>
  147. </div>
  148. <div class="gridPanel">
  149. <table id="gridList"></table>
  150. <style>
  151. .ui-jqgrid {
  152. border-left: 0px;
  153. border-right: 0px;
  154. border-bottom: 0px;
  155. }
  156. </style>
  157. </div>