log.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <div class="p-3">
  5. <form class="layui-form gg-form-bar border-t border-x">
  6. <div class="layui-input-inline" style="width:300px;">
  7. <input type="text" name="keywords" placeholder="昵称/操作数据id/操作描述" class="layui-input" autocomplete="off" />
  8. </div>
  9. <div class="layui-input-inline">
  10. <select name="action">
  11. <option value="">请选择类型</option>
  12. {volist name="$type_action" id="vo"}
  13. <option value="{$vo}">{$vo}</option>
  14. {/volist}
  15. </select>
  16. </div>
  17. <div class="layui-input-inline">
  18. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">提交搜索</button>
  19. </div>
  20. </form>
  21. <table class="layui-hide" id="log" lay-filter="log"></table>
  22. </div>
  23. {/block}
  24. <!-- /主体 -->
  25. <!-- 脚本 -->
  26. {block name="script"}
  27. <script>
  28. const moduleInit = ['tool'];
  29. function gouguInit() {
  30. var table = layui.table, form = layui.form;
  31. var tableIns = table.render({
  32. elem: '#log',
  33. title: '用户操作日志列表',
  34. toolbar: '#toolbarDemo',
  35. url: '/admin/user/log', //数据接口
  36. page: true, //开启分页
  37. limit: 20,
  38. cols: [
  39. [
  40. {
  41. field: 'id',
  42. title: 'ID号',
  43. align: 'center',
  44. width: 80
  45. }, {
  46. field: 'title',
  47. title: '操作类型',
  48. align: 'center',
  49. width: 80
  50. }, {
  51. field: 'content',
  52. title: '操作描述',
  53. width: 300
  54. },{
  55. field: 'param_id',
  56. title: '操作数据ID',
  57. align: 'center',
  58. width: 100
  59. }, {
  60. field: 'param',
  61. title: '操作数据'
  62. }, {
  63. field: 'nickname',
  64. title: '昵称',
  65. align: 'center',
  66. width: 90
  67. }, {
  68. field: 'ip',
  69. title: 'IP地址',
  70. align: 'center',
  71. width: 130
  72. }, {
  73. field: 'create_time',
  74. title: '操作时间',
  75. align: 'center',
  76. width: 160
  77. }
  78. ]
  79. ]
  80. });
  81. //监听搜索提交
  82. form.on('submit(webform)', function (data) {
  83. tableIns.reload({
  84. where: {
  85. keywords: data.field.keywords,
  86. action: data.field.action
  87. },
  88. page: {
  89. curr: 1
  90. }
  91. });
  92. return false;
  93. });
  94. }
  95. </script>
  96. {/block}
  97. <!-- /脚本 -->