index.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <script src="{__PLUG_PATH}moment.js"></script>
  4. <link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
  5. <script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
  6. {/block}
  7. {block name="content"}
  8. <div class="layui-fluid">
  9. <div class="layui-card">
  10. <div class="layui-card-body">
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline" id="form" method="get">
  15. <select name="admin_id" aria-controls="editable" class="form-control input-sm">
  16. <option value="">管理员名称</option>
  17. {volist name="$admin" id="vo"}
  18. <option value="{$vo.id}" {eq name="where.admin_id" value="$vo.id"}selected="selected"{/eq}>{$vo.real_name}</option>
  19. {/volist}
  20. </select>
  21. <div class="input-group datepicker">
  22. <input style="width: 188px;" type="text" id="data" class="input-sm form-control" name="data" value="{$where.data}" placeholder="请选择日期" >
  23. </div>
  24. <div class="input-group">
  25. <input type="text" name="pages" value="{$where.pages}" placeholder="请输入行为" class="input-sm form-control"> <span class="input-group-btn">
  26. <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon">&#xe615;</i> 搜索</button> </span>
  27. </div>
  28. </form>
  29. </div>
  30. </div>
  31. <div class="table-responsive">
  32. <table class="table table-striped table-bordered">
  33. <thead>
  34. <tr>
  35. <th class="text-center" style="width:60px;">编号</th>
  36. <th class="text-center">ID/名称</th>
  37. <th class="text-center">行为</th>
  38. <th class="text-center">链接</th>
  39. <th class="text-center">操作ip</th>
  40. <th class="text-center">类型</th>
  41. <th class="text-center">操作时间</th>
  42. </tr>
  43. </thead>
  44. <tbody class="">
  45. {volist name="list" id="vo"}
  46. <tr>
  47. <td class="text-center">
  48. {$vo.id}
  49. </td>
  50. <td class="text-center">
  51. {$vo.admin_id} / {$vo.admin_name}
  52. </td>
  53. <td class="text-center">
  54. {$vo.page}
  55. </td>
  56. <td class="text-center">
  57. {$vo.path}({$vo.method})
  58. </td>
  59. <td class="text-center">
  60. {$vo.ip}
  61. </td>
  62. <td class="text-center">
  63. {$vo.type}
  64. </td>
  65. <td class="text-center">
  66. {$vo.add_time|date="Y-m-d H:i:s",###}
  67. </td>
  68. </tr>
  69. {/volist}
  70. </tbody>
  71. </table>
  72. </div>
  73. {include file="public/inner_page"}
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. {/block}
  79. {block name="script"}
  80. <script>
  81. var dateInput =$('.datepicker');
  82. dateInput.daterangepicker({
  83. autoUpdateInput: false,
  84. "opens": "center",
  85. "drops": "down",
  86. "ranges": {
  87. '今天': [moment(), moment().add(1, 'days')],
  88. '昨天': [moment().subtract(1, 'days'), moment()],
  89. '上周': [moment().subtract(6, 'days'), moment()],
  90. '前30天': [moment().subtract(29, 'days'), moment()],
  91. '本月': [moment().startOf('month'), moment().endOf('month')],
  92. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  93. },
  94. "locale" : {
  95. applyLabel : '确定',
  96. cancelLabel : '清空',
  97. fromLabel : '起始时间',
  98. toLabel : '结束时间',
  99. format : 'YYYY/MM/DD',
  100. customRangeLabel : '自定义',
  101. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  102. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  103. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  104. firstDay : 1
  105. }
  106. });
  107. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  108. $("#data").val('');
  109. });
  110. dateInput.on('apply.daterangepicker', function(ev, picker) {
  111. $("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  112. });
  113. </script>
  114. {/block}