operlog.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('操作日志列表')" />
  5. <th:block th:include="include :: bootstrap-select-css" />
  6. </head>
  7. <body class="gray-bg">
  8. <div class="container-div">
  9. <div class="row">
  10. <div class="col-sm-12 search-collapse">
  11. <form id="operlog-form">
  12. <div class="select-list">
  13. <ul>
  14. <li>
  15. <label>系统模块: </label><input type="text" name="title"/>
  16. </li>
  17. <li>
  18. <label>操作人员: </label><input type="text" name="operName"/>
  19. </li>
  20. <li class="select-selectpicker">
  21. <label>操作类型: </label><select id="businessTypes" th:with="type=${@dict.getType('sys_oper_type')}" class="selectpicker" data-none-selected-text="请选择" multiple>
  22. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  23. </select>
  24. </li>
  25. <li>
  26. <label>操作状态:</label><select name="status" th:with="type=${@dict.getType('sys_common_status')}">
  27. <option value="">所有</option>
  28. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  29. </select>
  30. </li>
  31. <li class="select-time">
  32. <label>操作时间: </label>
  33. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
  34. <span>-</span>
  35. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
  36. </li>
  37. <li>
  38. <a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  39. <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  40. </li>
  41. </ul>
  42. </div>
  43. </form>
  44. </div>
  45. <div class="btn-group-sm" id="toolbar" role="group">
  46. <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:operlog:remove">
  47. <i class="fa fa-remove"></i> 删除
  48. </a>
  49. <a class="btn btn-danger" onclick="$.operate.clean()" shiro:hasPermission="monitor:operlog:remove">
  50. <i class="fa fa-trash"></i> 清空
  51. </a>
  52. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:operlog:export">
  53. <i class="fa fa-download"></i> 导出
  54. </a>
  55. </div>
  56. <div class="col-sm-12 select-table table-striped">
  57. <table id="bootstrap-table"></table>
  58. </div>
  59. </div>
  60. </div>
  61. <th:block th:include="include :: footer" />
  62. <th:block th:include="include :: bootstrap-select-js" />
  63. <script th:inline="javascript">
  64. var detailFlag = [[${@permission.hasPermi('monitor:operlog:detail')}]];
  65. var datas = [[${@dict.getType('sys_oper_type')}]];
  66. var prefix = ctx + "monitor/operlog";
  67. $(function() {
  68. var options = {
  69. url: prefix + "/list",
  70. cleanUrl: prefix + "/clean",
  71. detailUrl: prefix + "/detail/{id}",
  72. removeUrl: prefix + "/remove",
  73. exportUrl: prefix + "/export",
  74. queryParams: queryParams,
  75. sortName: "operTime",
  76. sortOrder: "desc",
  77. modalName: "操作日志",
  78. escape: true,
  79. showPageGo: true,
  80. rememberSelected: true,
  81. columns: [{
  82. field: 'state',
  83. checkbox: true
  84. },
  85. {
  86. field: 'operId',
  87. title: '日志编号'
  88. },
  89. {
  90. field: 'title',
  91. title: '系统模块'
  92. },
  93. {
  94. field: 'businessType',
  95. title: '操作类型',
  96. align: 'center',
  97. formatter: function(value, row, index) {
  98. return $.table.selectDictLabel(datas, value);
  99. }
  100. },
  101. {
  102. field: 'operName',
  103. title: '操作人员',
  104. sortable: true
  105. },
  106. {
  107. field: 'deptName',
  108. title: '部门名称'
  109. },
  110. {
  111. field: 'operIp',
  112. title: '主机'
  113. },
  114. {
  115. field: 'operLocation',
  116. title: '操作地点'
  117. },
  118. {
  119. field: 'status',
  120. title: '操作状态',
  121. align: 'center',
  122. formatter: function(value, row, index) {
  123. if (value == 0) {
  124. return '<span class="badge badge-primary">成功</span>';
  125. } else if (value == 1) {
  126. return '<span class="badge badge-danger">失败</span>';
  127. }
  128. }
  129. },
  130. {
  131. field: 'operTime',
  132. title: '操作时间',
  133. sortable: true
  134. },
  135. {
  136. title: '操作',
  137. align: 'center',
  138. formatter: function(value, row, index) {
  139. var actions = [];
  140. actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.operId + '\')"><i class="fa fa-search"></i>详细</a>');
  141. return actions.join('');
  142. }
  143. }]
  144. };
  145. $.table.init(options);
  146. });
  147. function queryParams(params) {
  148. var search = $.table.queryParams(params);
  149. search.businessTypes = $.common.join($('#businessTypes').selectpicker('val'));
  150. return search;
  151. }
  152. function searchPre() {
  153. $.table.search('operlog-form', 'bootstrap-table');
  154. }
  155. function resetPre() {
  156. $("#operlog-form")[0].reset();
  157. $("#businessTypes").selectpicker('refresh');
  158. $.table.search('operlog-form', 'bootstrap-table');
  159. }
  160. </script>
  161. </body>
  162. </html>