index.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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="row">
  9. <div class="col-sm-12">
  10. <div class="ibox">
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline" id="form">
  15. <select name="type" aria-controls="editable" class="form-control input-sm">
  16. <option value="">操作名称</option>
  17. {volist name="$mold" id="vo" key="k"}
  18. <option value="{$key}" {eq name="where.type" value="$key"}selected="selected"{/eq}>{$vo}</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="nickname" value="{$where.nickname}" placeholder="请输入操作用户" class="input-sm form-control"> <span class="input-group-btn">
  26. <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search" ></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">编号</th>
  36. <th class="text-center">操作用户</th>
  37. <th class="text-center">操作名称</th>
  38. <th class="text-center">关联内容</th>
  39. <th class="text-center">操作时间</th>
  40. </tr>
  41. </thead>
  42. <tbody class="">
  43. {volist name="list" id="vo"}
  44. <tr>
  45. <td class="text-center">
  46. {$vo.id}
  47. </td>
  48. <td class="text-center">
  49. {$vo.nickname}
  50. </td>
  51. <td class="text-center">
  52. {$vo.type_name}
  53. </td>
  54. <td class="text-center">
  55. {$vo['result_arr']['msg']}
  56. </td>
  57. <td class="text-center">
  58. {$vo.add_time|date="Y-m-d H:i:s"}
  59. </td>
  60. </tr>
  61. {/volist}
  62. </tbody>
  63. </table>
  64. </div>
  65. {include file="public/inner_page"}
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. {/block}
  71. {block name="script"}
  72. <script>
  73. var dateInput =$('.datepicker');
  74. dateInput.daterangepicker({
  75. autoUpdateInput: false,
  76. "opens": "center",
  77. "drops": "down",
  78. "ranges": {
  79. '今天': [moment(), moment().add(1, 'days')],
  80. '昨天': [moment().subtract(1, 'days'), moment()],
  81. '上周': [moment().subtract(6, 'days'), moment()],
  82. '前30天': [moment().subtract(29, 'days'), moment()],
  83. '本月': [moment().startOf('month'), moment().endOf('month')],
  84. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  85. },
  86. "locale" : {
  87. applyLabel : '确定',
  88. cancelLabel : '清空',
  89. fromLabel : '起始时间',
  90. toLabel : '结束时间',
  91. format : 'YYYY/MM/DD',
  92. customRangeLabel : '自定义',
  93. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  94. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  95. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  96. firstDay : 1
  97. }
  98. });
  99. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  100. $("#data").val('');
  101. });
  102. dateInput.on('apply.daterangepicker', function(ev, picker) {
  103. $("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  104. });
  105. </script>
  106. {/block}