index.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {extend name="public/container"}
  2. {block name="head"}
  3. <style>
  4. .layui-table th, .layui-table td {
  5. text-align: center;
  6. }
  7. </style>
  8. {/block}
  9. {block name="content"}
  10. <div class="layui-fluid">
  11. <div class="layui-card">
  12. <div class="layui-card-body">
  13. <table class="layui-table">
  14. <thead>
  15. <tr>
  16. <th>类型</th>
  17. <th>文件地址</th>
  18. <th>校验码</th>
  19. <th>上次访问时间</th>
  20. <th>上次修改时间</th>
  21. <th>上次改变时间</th>
  22. </tr>
  23. </thead>
  24. <tbody class="">
  25. {volist name="cha" id="vo"}
  26. <tr>
  27. <td>
  28. <span style="color: #ff0000">[{$vo.type}]</span>
  29. </td>
  30. <td>
  31. {$vo.filename}
  32. </td>
  33. <td>
  34. {$vo.cthash}
  35. </td>
  36. <td>
  37. {$vo.atime|date='Y-m-d H:i:s',###}
  38. </td>
  39. <td>
  40. {$vo.mtime|date='Y-m-d H:i:s',###}
  41. </td>
  42. <td>
  43. {$vo.ctime|date='Y-m-d H:i:s',###}
  44. </td>
  45. </tr>
  46. {/volist}
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. </div>
  52. {/block}
  53. {block name="script"}
  54. <script>
  55. $('.btn-warning').on('click',function(){
  56. var _this = $(this),url =_this.data('url');
  57. $eb.$swal('delete',function(){
  58. $eb.axios.get(url).then(function(res){
  59. if(res.status == 200 && res.data.code == 200) {
  60. $eb.$swal('success',res.data.msg);
  61. _this.parents('tr').remove();
  62. }else
  63. return Promise.reject(res.data.msg || '删除失败')
  64. }).catch(function(err){
  65. $eb.$swal('error',err);
  66. });
  67. })
  68. });
  69. </script>
  70. {/block}