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

128 lines
5.0 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/GetGridJson",
  13. height: $(window).height() - 96,
  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. });
  43. $("#btn_search").click(function () {
  44. $gridList.jqGrid('setGridParam', {
  45. postData: { keyword: $("#txt_keyword").val() },
  46. }).trigger('reloadGrid');
  47. });
  48. }
  49. function btn_add() {
  50. $.modalOpen({
  51. id: "Form",
  52. title: "新增角色",
  53. url: "/SystemManage/Role/Form",
  54. width: "550px",
  55. height: "570px",
  56. btn: null
  57. });
  58. }
  59. function btn_edit() {
  60. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  61. $.modalOpen({
  62. id: "Form",
  63. title: "修改角色",
  64. url: "/SystemManage/Role/Form?keyValue=" + keyValue,
  65. width: "550px",
  66. height: "570px",
  67. btn: null
  68. });
  69. }
  70. function btn_delete() {
  71. $.deleteForm({
  72. url: "/SystemManage/Role/DeleteForm",
  73. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  74. success: function () {
  75. $.currentWindow().$("#gridList").trigger("reloadGrid");
  76. }
  77. })
  78. }
  79. function btn_details() {
  80. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  81. $.modalOpen({
  82. id: "Details",
  83. title: "查看角色",
  84. url: "/SystemManage/Role/Details?keyValue=" + keyValue,
  85. width: "550px",
  86. height: "620px",
  87. btn: null,
  88. });
  89. }
  90. </script>
  91. <div class="topPanel">
  92. <div class="toolbar">
  93. <div class="btn-group">
  94. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  95. </div>
  96. <div class="btn-group">
  97. <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建角色</a>
  98. </div>
  99. <div class="operate">
  100. <ul class="nav nav-pills">
  101. <li class="first">已选中<span>1</span>项</li>
  102. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改角色</a></li>
  103. <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除角色</a></li>
  104. <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看角色</a></li>
  105. </ul>
  106. <a href="javascript:;" class="close"></a>
  107. </div>
  108. <script>$('.toolbar').authorizeButton()</script>
  109. </div>
  110. <div class="search">
  111. <table>
  112. <tr>
  113. <td>
  114. <div class="input-group">
  115. <input id="txt_keyword" type="text" class="form-control" placeholder="角色名称/角色编号" style="width: 200px;">
  116. <span class="input-group-btn">
  117. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  118. </span>
  119. </div>
  120. </td>
  121. </tr>
  122. </table>
  123. </div>
  124. </div>
  125. <div class="gridPanel">
  126. <table id="gridList"></table>
  127. </div>