operlog.html 6.4 KB

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