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.

107 lines
4.4 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: "/SystemSecurity/Log/GetGridJson",
  13. height: $(window).height() - 128,
  14. colModel: [
  15. { label: '主键', name: 'F_Id', hidden: true },
  16. {
  17. label: '日期', name: 'F_Date', width: 120, align: 'left',
  18. formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' }
  19. },
  20. { label: '账户', name: 'F_Account', width: 80, align: 'left' },
  21. { label: '姓名', name: 'F_NickName', width: 80, align: 'left' },
  22. { label: '操作菜单', name: 'F_ModuleName', width: 100, align: 'left' },
  23. {
  24. label: '操作类型', name: 'F_Type', width: 80, align: 'left',
  25. formatter: function (cellvalue) {
  26. return top.clients.dataItems["DbLogType"][cellvalue] == undefined ? "" : top.clients.dataItems["DbLogType"][cellvalue]
  27. }
  28. },
  29. {
  30. label: 'IP地址', name: 'F_IPAddress', width: 230, align: 'left',
  31. formatter: function (cellvalue, options, rowObject) {
  32. return cellvalue + ";" + rowObject.F_IPAddressName;
  33. }
  34. },
  35. { label: '日志内容', name: 'F_Description', width: 300, align: 'left' }
  36. ],
  37. pager: "#gridPager",
  38. sortname: 'F_Date desc',
  39. viewrecords: true
  40. });
  41. $("#time_horizon a.btn-default").click(function () {
  42. $("#time_horizon a.btn-default").removeClass("active");
  43. $(this).addClass("active");
  44. $('#btn_search').trigger("click");
  45. });
  46. $("#btn_search").click(function () {
  47. var timeType = $("#time_horizon a.active").attr('data-value');
  48. var queryJson = {
  49. keyword: $("#txt_keyword").val(),
  50. timeType: $("#time_horizon a.active").attr('data-value'),
  51. }
  52. $gridList.jqGrid('setGridParam', {
  53. postData: { queryJson: JSON.stringify(queryJson) },
  54. }).trigger('reloadGrid');
  55. });
  56. }
  57. function btn_removelog() {
  58. $.modalOpen({
  59. id: "removelog",
  60. title: "清空日志",
  61. url: "/SystemSecurity/Log/RemoveLog",
  62. width: "400px",
  63. height: "180px",
  64. callBack: function (iframeId) {
  65. top.frames[iframeId].submitForm();
  66. }
  67. });
  68. }
  69. </script>
  70. <div class="topPanel">
  71. <div class="toolbar">
  72. <div class="btn-group">
  73. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  74. </div>
  75. <div class="btn-group">
  76. <a id="NF-removelog" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_removelog()"><i class="fa fa-eraser"></i>清空日志</a>
  77. </div>
  78. <script>$('.toolbar').authorizeButton()</script>
  79. </div>
  80. <div class="search">
  81. <table>
  82. <tr>
  83. <td>
  84. <div class="input-group">
  85. <input id="txt_keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;">
  86. <span class="input-group-btn">
  87. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  88. </span>
  89. </div>
  90. </td>
  91. <td style="padding-left: 10px;">
  92. <div id="time_horizon" class="btn-group">
  93. <a class="btn btn-default" data-value="1">今天</a>
  94. <a class="btn btn-default active" data-value="2">近7天</a>
  95. <a class="btn btn-default" data-value="3">近1个月</a>
  96. <a class="btn btn-default" data-value="4">近3个月</a>
  97. </div>
  98. </td>
  99. </tr>
  100. </table>
  101. </div>
  102. </div>
  103. <div class="gridPanel">
  104. <table id="gridList"></table>
  105. <div id="gridPager"></div>
  106. </div>