record.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {extend name="common/base"/}
  2. {block name="style"}
  3. <style type="text/css">
  4. .layui-card-body .layui-timeline-title {
  5. padding-bottom: 0;
  6. font-size: 14px;
  7. }
  8. .layui-card-body .layui-timeline-item {
  9. padding-bottom: 5px;
  10. }
  11. .layui-timeline-title span {
  12. color: #999
  13. }
  14. .panel-more {
  15. width: 100%;
  16. height: 48px;
  17. line-height: 48px;
  18. text-align: center;
  19. position: absolute;
  20. bottom: 0;
  21. left: 0;
  22. }
  23. .panel-more a {
  24. color: #0088FF
  25. }
  26. </style>
  27. {/block}
  28. <!-- 主体 -->
  29. {block name="body"}
  30. <div class="p-3">
  31. <div class="layui-card">
  32. <div class="layui-card-header"><h3>用户操作记录</h3></div>
  33. <div class="layui-card-body">
  34. <ul class="layui-timeline" id="logs"></ul>
  35. <div class="panel-more"><a href="javascript:;">查看更多操作记录</a></div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. {/block}
  41. <!-- /主体 -->
  42. <!-- 脚本 -->
  43. {block name="script"}
  44. <script>
  45. var page=1,limit=20;
  46. function getLogs() {
  47. $.ajax({
  48. url: "/admin/user/record",
  49. type: 'get',
  50. data: {
  51. page:page,
  52. limit: limit
  53. },
  54. success: function(e) {
  55. if (e.code == 0) {
  56. var html = '';
  57. if(e.data.length>0){
  58. page++;
  59. $.each(e.data, function(key, value) {
  60. html += '<li class="layui-timeline-item">\
  61. <i class="layui-icon layui-timeline-axis"></i>\
  62. <div class="layui-timeline-content layui-text">\
  63. <div class="layui-timeline-title"><span title="'+value.id+'">'+value.times+'</span>,'+value.content+'</div>\
  64. </div>\
  65. </li>';
  66. });
  67. $('#logs').append(html);
  68. }else{
  69. $('.panel-more').remove();
  70. }
  71. }
  72. }
  73. })
  74. }
  75. function gouguInit() {
  76. getLogs();
  77. $('.panel-more').on('click',function(){
  78. getLogs();
  79. })
  80. }
  81. </script>
  82. {/block}
  83. <!-- /脚本 -->