operlog.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 btn-del 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" data-mobile-responsive="true"></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. sortName: "operTime",
  75. sortOrder: "desc",
  76. modalName: "操作日志",
  77. escape: true,
  78. showPageGo: true,
  79. rememberSelected: true,
  80. columns: [{
  81. field: 'state',
  82. checkbox: true
  83. },
  84. {
  85. field: 'operId',
  86. title: '日志编号'
  87. },
  88. {
  89. field: 'title',
  90. title: '系统模块'
  91. },
  92. {
  93. field: 'businessType',
  94. title: '操作类型',
  95. align: 'center',
  96. formatter: function(value, row, index) {
  97. return $.table.selectDictLabel(datas, value);
  98. }
  99. },
  100. {
  101. field: 'operName',
  102. title: '操作人员',
  103. sortable: true
  104. },
  105. {
  106. field: 'deptName',
  107. title: '部门名称'
  108. },
  109. {
  110. field: 'operIp',
  111. title: '主机'
  112. },
  113. {
  114. field: 'operLocation',
  115. title: '操作地点'
  116. },
  117. {
  118. field: 'status',
  119. title: '操作状态',
  120. align: 'center',
  121. formatter: function(value, row, index) {
  122. if (value == 0) {
  123. return '<span class="badge badge-primary">成功</span>';
  124. } else if (value == 1) {
  125. return '<span class="badge badge-danger">失败</span>';
  126. }
  127. }
  128. },
  129. {
  130. field: 'operTime',
  131. title: '操作时间',
  132. sortable: true
  133. },
  134. {
  135. title: '操作',
  136. align: 'center',
  137. formatter: function(value, row, index) {
  138. var actions = [];
  139. 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>');
  140. return actions.join('');
  141. }
  142. }]
  143. };
  144. $.table.init(options);
  145. });
  146. function searchPre() {
  147. var data = {};
  148. data.businessTypes = $.common.join($('#businessTypes').selectpicker('val'));
  149. $.table.search('operlog-form', data);
  150. }
  151. function resetPre() {
  152. $.form.reset();
  153. $("#businessTypes").selectpicker('refresh');
  154. }
  155. </script>
  156. </body>
  157. </html>