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

111 lines
4.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. treeGrid: true,
  13. treeGridModel: "adjacency",
  14. ExpandColumn: "F_CreatorTime",
  15. url: "/SystemManage/Area/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. {
  21. label: '创建时间', name: 'F_CreatorTime', width: 80, align: 'left',
  22. formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
  23. },
  24. {
  25. label: "有效", name: "F_EnabledMark", width: 60, align: "center",
  26. formatter: function (cellvalue) {
  27. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  28. }
  29. },
  30. { label: '备注', name: 'F_Description', width: 300, align: 'left' }
  31. ]
  32. });
  33. $("#btn_search").click(function () {
  34. $gridList.jqGrid('setGridParam', {
  35. postData: { keyword: $("#txt_keyword").val() },
  36. }).trigger('reloadGrid');
  37. });
  38. }
  39. function btn_add() {
  40. $.modalOpen({
  41. id: "Form",
  42. title: "新增区域",
  43. url: "/SystemManage/Area/Form",
  44. width: "450px",
  45. height: "340px",
  46. callBack: function (iframeId) {
  47. top.frames[iframeId].submitForm();
  48. }
  49. });
  50. }
  51. function btn_edit() {
  52. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  53. $.modalOpen({
  54. id: "Form",
  55. title: "修改区域",
  56. url: "/SystemManage/Area/Form?keyValue=" + keyValue,
  57. width: "450px",
  58. height: "340px",
  59. callBack: function (iframeId) {
  60. top.frames[iframeId].submitForm();
  61. }
  62. });
  63. }
  64. function btn_delete() {
  65. $.deleteForm({
  66. url: "/SystemManage/Area/DeleteForm",
  67. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  68. success: function () {
  69. $.currentWindow().$("#gridList").resetSelection();
  70. $.currentWindow().$("#gridList").trigger("reloadGrid");
  71. }
  72. })
  73. }
  74. </script>
  75. <div class="topPanel">
  76. <div class="search">
  77. <table>
  78. <tr>
  79. <td>
  80. <div class="input-group">
  81. <input id="txt_keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;">
  82. <span class="input-group-btn">
  83. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  84. </span>
  85. </div>
  86. </td>
  87. </tr>
  88. </table>
  89. </div>
  90. <div class="toolbar">
  91. <div class="btn-group">
  92. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  93. </div>
  94. <div class="btn-group">
  95. <a id="NF-add" authorize="yes" class="btn btn-primary" onclick="btn_add()"><i class="fa fa-plus"></i>新建区域</a>
  96. </div>
  97. <div class="operate">
  98. <ul class="nav nav-pills">
  99. <li class="first">已选中<span>1</span>项</li>
  100. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改区域</a></li>
  101. <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除区域</a></li>
  102. </ul>
  103. <a href="javascript:;" class="close"></a>
  104. </div>
  105. <script>$('.toolbar').authorizeButton()</script>
  106. </div>
  107. </div>
  108. <div class="gridPanel">
  109. <table id="gridList"></table>
  110. </div>