operlog.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. var prefix = ctx + "/monitor/operlog"
  2. $(function() {
  3. var columns = [{
  4. checkbox: true
  5. },
  6. {
  7. field: 'operId',
  8. title: '日志编号'
  9. },
  10. {
  11. field: 'title',
  12. title: '模块'
  13. },
  14. {
  15. field: 'action',
  16. title: '功能'
  17. },
  18. {
  19. field: 'loginName',
  20. title: '登录名称'
  21. },
  22. {
  23. field: 'deptName',
  24. title: '部门名称'
  25. },
  26. {
  27. field: 'operIp',
  28. title: '主机'
  29. },
  30. {
  31. field: 'status',
  32. title: '操作状态',
  33. align: 'center',
  34. formatter: function(value, row, index) {
  35. if (value == 0) {
  36. return '<span class="label label-success">成功</span>';
  37. } else if (value == 1) {
  38. return '<span class="label label-danger">异常</span>';
  39. }
  40. }
  41. },
  42. {
  43. field: 'operTime',
  44. title: '操作时间'
  45. },
  46. {
  47. title: '操作',
  48. align: 'center',
  49. formatter: function(value, row, index) {
  50. var actions = [];
  51. actions.push('<a class="btn btn-warning btn-sm ' + detailFlag + '" href="#" title="详细信息" onclick="detail(\'' + row.operId + '\')"><i class="fa fa-search"></i></a>');
  52. return actions.join('');
  53. }
  54. }];
  55. var url = prefix + "/list";
  56. $.initTable(columns, url);
  57. });
  58. /*操作日志-详细*/
  59. function detail(id) {
  60. var url = prefix + '/detail/' + id;
  61. layer_showAuto("操作日志详细", url);
  62. }
  63. // 批量删除
  64. function batchRemove() {
  65. var rows = $.getSelections("operId");
  66. if (rows.length == 0) {
  67. $.modalMsg("请选择要删除的数据", "warning");
  68. return;
  69. }
  70. $.modalConfirm("确认要删除选中的" + rows.length + "条数据吗?", function() {
  71. _ajax(prefix + '/batchRemove', { "ids": rows }, "post");
  72. });
  73. }