recycle.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <div class="row-content am-cf">
  2. <div class="row">
  3. <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
  4. <div class="widget am-cf">
  5. <div class="widget-head am-cf">
  6. <div class="widget-title am-cf">文件列表</div>
  7. </div>
  8. <div class="widget-body am-fr">
  9. <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
  10. <div class="am-form-group">
  11. </div>
  12. </div>
  13. <div class="am-scrollable-horizontal am-u-sm-12">
  14. <table width="100%" class="am-table am-table-compact am-table-striped
  15. tpl-table-black am-text-nowrap">
  16. <thead>
  17. <tr>
  18. <th>文件ID</th>
  19. <th>文件名称</th>
  20. <th>所属分组</th>
  21. <th>存储方式</th>
  22. <th>存储域名</th>
  23. <th>文件大小</th>
  24. <th>文件类型</th>
  25. <th>文件后缀</th>
  26. <th>上传时间</th>
  27. <th>操作</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
  32. <tr>
  33. <td class="am-text-middle"><?= $item['file_id'] ?></td>
  34. <td class="am-text-middle">
  35. <a href="<?= $item['file_path'] ?>"
  36. target="_blank"><?= $item['file_name'] ?></a>
  37. </td>
  38. <td class="am-text-middle">
  39. <?= !empty($item['group']) ? $item['group']['name'] : '--' ?>
  40. </td>
  41. <td class="am-text-middle"><?= $item['storage'] ?></td>
  42. <td class="am-text-middle"><?= $item['file_url'] ?: '--' ?></td>
  43. <td class="am-text-middle"><?= $item['file_size'] ?></td>
  44. <td class="am-text-middle"><?= $item['file_type'] ?></td>
  45. <td class="am-text-middle"><?= $item['extension'] ?></td>
  46. <td class="am-text-middle"><?= $item['create_time'] ?></td>
  47. <td class="am-text-middle">
  48. <div class="tpl-table-black-operation">
  49. <?php if (checkPrivilege('content.files/restore')): ?>
  50. <a href="javascript:void(0);" class="item-move"
  51. data-id="<?= $item['file_id'] ?>">
  52. <i class="am-icon-undo"></i> 还原
  53. </a>
  54. <?php endif; ?>
  55. <?php if (checkPrivilege('content.files/delete')): ?>
  56. <a href="javascript:void(0);"
  57. class="item-delete tpl-table-black-operation-del"
  58. data-id="<?= $item['file_id'] ?>">
  59. <i class="am-icon-trash"></i> 删除
  60. </a>
  61. <?php endif; ?>
  62. </div>
  63. </td>
  64. </tr>
  65. <?php endforeach; else: ?>
  66. <tr>
  67. <td colspan="10" class="am-text-center">暂无记录</td>
  68. </tr>
  69. <?php endif; ?>
  70. </tbody>
  71. </table>
  72. </div>
  73. <div class="am-u-lg-12 am-cf">
  74. <div class="am-fr"><?= $list->render() ?> </div>
  75. <div class="am-fr pagination-total am-margin-right">
  76. <div class="am-vertical-align-middle">总记录:<?= $list->total() ?></div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <script>
  85. $(function () {
  86. // 移出回收站
  87. $('.item-move').delete('file_id', "<?= url('content.files/restore') ?>", '确定要还原吗?');
  88. // 删除元素
  89. var url = "<?= url('content.files/delete') ?>";
  90. $('.item-delete').delete('file_id', url, '确定要删除该文件吗?删除后不可恢复');
  91. });
  92. </script>