exportlog.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {extend name="public/layout" /} {block name="title"}活动编辑{/block}
  2. {block name="body"}
  3. <style>
  4. a{
  5. color:#249efb
  6. }
  7. </style>
  8. <body>
  9. <div class="layui-form">
  10. <table class="layui-table">
  11. <thead>
  12. <tr>
  13. <th>时间</th>
  14. <th>操作人</th>
  15. <th>条件</th>
  16. <th>操作</th>
  17. </tr>
  18. </thead>
  19. <tbody id="data-list">
  20. </tbody>
  21. </table>
  22. </div>
  23. </body>
  24. {/block}
  25. {block name="js"}
  26. <script>
  27. layui.config({
  28. base: '__LAYUI__/',
  29. urlbase: '/sys'
  30. }).extend({
  31. index: 'lib/index' //主入口模块
  32. }).use(['flow'], function () {
  33. let flow = layui.flow;
  34. let $ = layui.jquery;
  35. flow.load({
  36. elem: '#data-list' //流加载容器
  37. , done: function (page, next) {
  38. var row = [];
  39. $.get("{:url('activity/exportlog', ['id'=>$id])}&page=" + page, function (res) {
  40. if (res.code == 1) {
  41. layer.msg(res.msg, { anim: 6 });
  42. return;
  43. }
  44. layui.each(res.data, function(index, i){
  45. row.push('<tr>');
  46. row.push('<td>' + i['addtime'] + '</td>');
  47. row.push('<td>' + i['op'] + '</td>');
  48. row.push('<td>' + i['s'] + '</td>');
  49. if (i['state'] == 2)
  50. row.push('<td><a href="' + i['file'] + '">下载</a></td>');
  51. else if (i['state'] == -1)
  52. row.push('<td>导出失败</td>');
  53. else if (i['state'] == 1)
  54. row.push('<td>导出中</td>');
  55. else if (i['state'] == 0)
  56. row.push('<td>未导出</td>');
  57. row.push('</tr>');
  58. });
  59. next(row.join(''), page < res.pages);
  60. })
  61. }
  62. });
  63. });
  64. </script>
  65. {/block}