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.

144 lines
5.6 KiB

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