index.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. function gouguInit() {
  29. var table = layui.table, form = layui.form;
  30. var tableIns = table.render({
  31. elem: '#log',
  32. title: '操作日志列表',
  33. toolbar: '#toolbarDemo',
  34. url: "/admin/log/index", //数据接口
  35. page: true, //开启分页
  36. limit: 20,
  37. cols: [
  38. [ //表头
  39. {
  40. field: 'id',
  41. title: 'ID号',
  42. align: 'center',
  43. width: 90
  44. }, {
  45. field: 'action',
  46. title: '操作',
  47. align: 'center',
  48. width: 80
  49. }, {
  50. field: 'content',
  51. title: '操作描述'
  52. }, {
  53. field: 'param_id',
  54. title: '操作数据ID',
  55. align: 'center',
  56. width: 100
  57. },{
  58. field: 'nickname',
  59. title: '操作用户',
  60. align: 'center',
  61. width: 100
  62. }, {
  63. field: 'ip',
  64. title: 'IP地址',
  65. align: 'center',
  66. width: 130
  67. }, {
  68. field: 'create_time',
  69. title: '操作时间',
  70. fixed: 'right',
  71. align: 'center',
  72. width: 160
  73. }
  74. ]
  75. ]
  76. });
  77. //监听搜索提交
  78. form.on('submit(webform)', function (data) {
  79. tableIns.reload({
  80. where: {
  81. keywords: data.field.keywords,
  82. action: data.field.action
  83. },
  84. page: {
  85. curr: 1
  86. }
  87. });
  88. return false;
  89. });
  90. }
  91. </script>
  92. {/block}
  93. <!-- /脚本 -->