opendir.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox">
  6. <div class="ibox-title">
  7. <h5>文件管理</h5>
  8. </div>
  9. <div class="ibox-content no-padding">
  10. <div class="table-responsive">
  11. <table class="table table-striped table-bordered">
  12. <thead>
  13. <tr>
  14. <th class="text-left" width="20%">列表</th>
  15. <th class="text-left">文件大小</th>
  16. <th class="text-left">更新时间</th>
  17. <th class="text-center" width="30%">操作</th>
  18. </tr>
  19. </thead>
  20. <tbody class="">
  21. <tr>
  22. <td class="text-left" colspan="3">
  23. <span> <i class="fa fa-folder-o"></i> <a href="{:Url('opendir')}?dir={$dir}&superior=1">返回上级</a></span>
  24. </td>
  25. <td class="text-center"></td>
  26. </tr>
  27. {volist name="fileAll['dir']" id="vo"}
  28. <tr>
  29. <td class="text-left">
  30. <span> <i class="fa fa-folder-o"></i> <a href="{:Url('opendir')}?dir={$dir}&filedir={$vo.filename}">{$vo.filename}</a></span>
  31. </td>
  32. <td class="text-left">
  33. <span> {$vo.size}</span>
  34. </td>
  35. <td class="text-left">
  36. <span> {$vo.mtime|date='Y-m-d H:i:s',###}</span>
  37. </td>
  38. <td class="text-center">
  39. <a class="btn btn-info btn-xs" href="{:Url('opendir')}?dir={$dir}&filedir={$vo.filename}"><i class="fa fa-paste"></i> 打开</a>
  40. </td>
  41. </tr>
  42. {/volist}
  43. {volist name="fileAll['file']" id="vo"}
  44. <tr>
  45. <td class="text-left">
  46. <span onclick="$eb.createModalFrame('{$vo.filename}','{:Url('openfile')}?file={$dir}/{$vo.filename}',{w:1260,h:600})"> <i class="fa fa-file-text-o"></i> {$vo.filename}</span>
  47. </td>
  48. <td class="text-left">
  49. <span> {$vo.size}</span>
  50. </td>
  51. <td class="text-left">
  52. <span> {$vo.mtime|date='Y-m-d H:i:s',###}</span>
  53. </td>
  54. <td class="text-center">
  55. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('{$vo.filename}','{:Url('openfile')}?file={$dir}/{$vo.filename}',{w:1260,h:660})"><i class="fa fa-paste"></i> 编辑</button>
  56. <!-- <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('{$vo.filename}','{:Url('openfile')}?file={$vo.filename}&dir={$dir}',{w:1260,h:600})"><i class="fa fa-paste"></i> 重命名</button>-->
  57. <!-- <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('{$vo.filename}','{:Url('openfile')}?file={$vo.filename}&dir={$dir}',{w:1260,h:600})"><i class="fa fa-paste"></i> 删除</button>-->
  58. <!-- <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('{$vo.filename}','{:Url('openfile')}?file={$vo.filename}&dir={$dir}',{w:1260,h:600})"><i class="fa fa-paste"></i> 下载</button>-->
  59. </td>
  60. </tr>
  61. {/volist}
  62. </tbody>
  63. </table>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. {/block}
  70. {block name="script"}
  71. <script>
  72. $('.btn-warning').on('click',function(){
  73. var _this = $(this),url =_this.data('url');
  74. $eb.$swal('delete',function(){
  75. $eb.axios.get(url).then(function(res){
  76. console.log(res);
  77. if(res.status == 200 && res.data.code == 200) {
  78. $eb.$swal('success',res.data.msg);
  79. _this.parents('tr').remove();
  80. }else
  81. return Promise.reject(res.data.msg || '删除失败')
  82. }).catch(function(err){
  83. $eb.$swal('error',err);
  84. });
  85. })
  86. });
  87. </script>
  88. {/block}