纽威
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.

165 lines
6.6 KiB

3 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. $(function () {
  7. gridList();
  8. })
  9. function gridList() {
  10. var $gridList = $("#gridList");
  11. $gridList.dataGrid({
  12. treeGrid: true,
  13. treeGridModel: "adjacency",
  14. ExpandColumn: "F_UrlAddress",
  15. url: "/SystemManage/Module/GetTreeGridJson",
  16. height: $(window).height() - 96,
  17. colModel: [
  18. { label: "主键", name: "F_Id", hidden: true, key: true },
  19. { label: '名称', name: 'F_FullName', width: 200, align: 'left' },
  20. { label: '连接', name: 'F_UrlAddress', width: 260, align: 'left' },
  21. {
  22. label: '目标', name: 'F_Target', width: 80, align: 'center',
  23. formatter: function (cellvalue) {
  24. if (cellvalue == "expand") {
  25. return "无页面";
  26. } else if (cellvalue == "iframe") {
  27. return "框架页";
  28. } else if (cellvalue == "open") {
  29. return "弹出页";
  30. } else if (cellvalue == "blank") {
  31. return "新窗口";
  32. }
  33. }
  34. },
  35. {
  36. label: "菜单", name: "F_IsMenu", width: 60, align: "center",
  37. formatter: function (cellvalue) {
  38. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  39. }
  40. },
  41. {
  42. label: "展开", name: "F_IsExpand", width: 60, align: "center",
  43. formatter: function (cellvalue) {
  44. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  45. }
  46. },
  47. {
  48. label: "公共", name: "F_IsPublic", width: 60, align: "center",
  49. formatter: function (cellvalue) {
  50. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  51. }
  52. },
  53. {
  54. label: "有效", name: "F_EnabledMark", width: 60, align: "center",
  55. formatter: function (cellvalue) {
  56. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  57. }
  58. },
  59. { label: '介绍', name: 'F_Description', width: 300, align: 'left' }
  60. ]
  61. });
  62. $("#btn_search").click(function () {
  63. $gridList.jqGrid('setGridParam', {
  64. postData: { keyword: $("#txt_keyword").val() },
  65. }).trigger('reloadGrid');
  66. });
  67. }
  68. function btn_add() {
  69. $.modalOpen({
  70. id: "Form",
  71. title: "新增菜单",
  72. url: "/SystemManage/Module/Form",
  73. width: "700px",
  74. height: "440px",
  75. callBack: function (iframeId) {
  76. top.frames[iframeId].submitForm();
  77. }
  78. });
  79. }
  80. function btn_edit() {
  81. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  82. $.modalOpen({
  83. id: "Form",
  84. title: "修改菜单",
  85. url: "/SystemManage/Module/Form?keyValue=" + keyValue,
  86. width: "700px",
  87. height: "440px",
  88. callBack: function (iframeId) {
  89. top.frames[iframeId].submitForm();
  90. }
  91. });
  92. }
  93. function btn_delete() {
  94. $.deleteForm({
  95. url: "/SystemManage/Module/DeleteForm",
  96. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  97. success: function () {
  98. $.currentWindow().$("#gridList").resetSelection();
  99. $.currentWindow().$("#gridList").trigger("reloadGrid");
  100. }
  101. })
  102. }
  103. function btn_details() {
  104. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  105. $.modalOpen({
  106. id: "Details",
  107. title: "查看菜单",
  108. url: "/SystemManage/Module/Details?keyValue=" + keyValue,
  109. width: "700px",
  110. height: "490px",
  111. btn: null,
  112. });
  113. }
  114. function btn_modulebutton() {
  115. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  116. $.modalOpen({
  117. id: "modulebutton",
  118. title: "系统按钮",
  119. url: "/SystemManage/ModuleButton/Index?moduleId=" + keyValue,
  120. width: "950px",
  121. height: "600px",
  122. btn: null,
  123. });
  124. }
  125. </script>
  126. <div class="topPanel">
  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 id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建菜单</a>
  133. </div>
  134. <div class="operate">
  135. <ul class="nav nav-pills">
  136. <li class="first">已选中<span>1</span>项</li>
  137. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改菜单</a></li>
  138. <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除菜单</a></li>
  139. <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看菜单</a></li>
  140. <li class="split"></li>
  141. <li><a id="NF-modulebutton" authorize="yes" onclick="btn_modulebutton()"><i class="fa fa-gavel"></i>按钮管理</a></li>
  142. </ul>
  143. <a href="javascript:;" class="close"></a>
  144. </div>
  145. <script>$('.toolbar').authorizeButton()</script>
  146. </div>
  147. <div class="search">
  148. <table>
  149. <tr>
  150. <td>
  151. <div class="input-group">
  152. <input id="txt_keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;">
  153. <span class="input-group-btn">
  154. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  155. </span>
  156. </div>
  157. </td>
  158. </tr>
  159. </table>
  160. </div>
  161. </div>
  162. <div class="gridPanel">
  163. <table id="gridList"></table>
  164. </div>