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

131 lines
5.1 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. url: "/SystemManage/Role/GetGridJsonFY",
  13. height: $(window).height() - 128,
  14. colModel: [
  15. { label: "主键", name: "F_Id", hidden: true, key: true },
  16. { label: '角色名称', name: 'F_FullName', width: 150, align: 'left' },
  17. { label: '角色编号', name: 'F_EnCode', width: 150, align: 'left' },
  18. {
  19. label: '角色类型', name: 'F_Type', width: 80, align: 'left',
  20. formatter: function (cellvalue) {
  21. return top.clients.dataItems["RoleType"][cellvalue] == undefined ? "" : top.clients.dataItems["RoleType"][cellvalue]
  22. }
  23. },
  24. {
  25. label: '归属机构', name: 'F_OrganizeId', width: 150, align: 'left',
  26. formatter: function (cellvalue, options, rowObject) {
  27. return top.clients.organize[cellvalue] == null ? "" : top.clients.organize[cellvalue].fullname;
  28. }
  29. },
  30. {
  31. label: '创建时间', name: 'F_CreatorTime', width: 80, align: 'left',
  32. formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
  33. },
  34. {
  35. label: "有效", name: "F_EnabledMark", width: 60, align: "center",
  36. formatter: function (cellvalue) {
  37. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  38. }
  39. },
  40. { label: '备注', name: 'F_Description', width: 300, align: 'left' }
  41. ],
  42. pager: "#gridPager",
  43. sortname: "F_FullName asc",
  44. });
  45. $("#btn_search").click(function () {
  46. $gridList.jqGrid('setGridParam', {
  47. postData: { keyword: $("#txt_keyword").val() },
  48. }).trigger('reloadGrid');
  49. });
  50. }
  51. function btn_add() {
  52. $.modalOpen({
  53. id: "Form",
  54. title: "新增角色",
  55. url: "/SystemManage/Role/Form",
  56. width: "550px",
  57. height: "570px",
  58. btn: null
  59. });
  60. }
  61. function btn_edit() {
  62. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  63. $.modalOpen({
  64. id: "Form",
  65. title: "修改角色",
  66. url: "/SystemManage/Role/Form?keyValue=" + keyValue,
  67. width: "550px",
  68. height: "570px",
  69. btn: null
  70. });
  71. }
  72. function btn_delete() {
  73. $.deleteForm({
  74. url: "/SystemManage/Role/DeleteForm",
  75. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  76. success: function () {
  77. $.currentWindow().$("#gridList").trigger("reloadGrid");
  78. }
  79. })
  80. }
  81. function btn_details() {
  82. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  83. $.modalOpen({
  84. id: "Details",
  85. title: "查看角色",
  86. url: "/SystemManage/Role/Details?keyValue=" + keyValue,
  87. width: "550px",
  88. height: "620px",
  89. btn: null,
  90. });
  91. }
  92. </script>
  93. <div class="topPanel">
  94. <div class="toolbar">
  95. <div class="btn-group">
  96. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  97. </div>
  98. <div class="btn-group">
  99. <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建角色</a>
  100. </div>
  101. <div class="operate">
  102. <ul class="nav nav-pills">
  103. <li class="first">已选中<span>1</span>项</li>
  104. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改角色</a></li>
  105. <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除角色</a></li>
  106. <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看角色</a></li>
  107. </ul>
  108. <a href="javascript:;" class="close"></a>
  109. </div>
  110. <script>$('.toolbar').authorizeButton()</script>
  111. </div>
  112. <div class="search">
  113. <table>
  114. <tr>
  115. <td>
  116. <div class="input-group">
  117. <input id="txt_keyword" type="text" class="form-control" placeholder="角色名称/角色编号" style="width: 200px;">
  118. <span class="input-group-btn">
  119. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  120. </span>
  121. </div>
  122. </td>
  123. </tr>
  124. </table>
  125. </div>
  126. </div>
  127. <div class="gridPanel">
  128. <table id="gridList"></table>
  129. <div id="gridPager"></div>
  130. </div>