opendir.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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-left">更新时间</th>
  18. <th class="text-center" width="30%">操作</th>
  19. </tr>
  20. </thead>
  21. <tbody class="">
  22. <tr>
  23. <td class="text-left" colspan="4">
  24. <span> <i class="fa fa-folder-o"></i> <a href="{:Url('opendir')}?dir={$dir}&superior=1">返回上级</a></span>
  25. </td>
  26. <td class="text-center"></td>
  27. </tr>
  28. {volist name="fileAll['dir']" id="vo"}
  29. <tr>
  30. <td class="text-left">
  31. <span> <i class="fa fa-folder-o"></i> <a href="{:Url('opendir')}?dir={$dir}&filedir={$vo.filename}">{$vo.filename}</a></span>
  32. </td>
  33. <td class="text-left">
  34. <span> {$vo.size}</span>
  35. </td>
  36. <td class="text-left">
  37. <span> {if condition="$vo.isWritable"}可写{else/}不可写{/if}</span>
  38. </td>
  39. <td class="text-left">
  40. <span> {$vo.mtime|date='Y-m-d H:i:s'}</span>
  41. </td>
  42. <td class="text-center">
  43. <a class="btn btn-info btn-xs" href="{:Url('opendir')}?dir={$dir}&filedir={$vo.filename}"><i class="fa fa-paste"></i> 打开</a>
  44. </td>
  45. </tr>
  46. {/volist}
  47. {volist name="fileAll['file']" id="vo"}
  48. <tr>
  49. <td class="text-left">
  50. <span onclick="$eb.createModalFrame('{$vo.filename}','{:Url('openfile')}?file={$vo.pathname}',{w:1260,h:600})"> <i class="fa fa-file-text-o"></i> {$vo.filename}</span>
  51. </td>
  52. <td class="text-left">
  53. <span> {$vo.size}</span>
  54. </td>
  55. <td class="text-left">
  56. <span> {if condition="$vo.isWritable"}可写{else/}不可写{/if}</span>
  57. </td>
  58. <td class="text-left">
  59. <span> {$vo.mtime|date='Y-m-d H:i:s'}</span>
  60. </td>
  61. <td class="text-center">
  62. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('{$vo.filename}','{:Url('openfile')}?file={$vo.pathname}',{w:1260,h:660})"><i class="fa fa-edit"></i> 编辑</button>
  63. <!-- <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>-->
  64. <!-- <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>-->
  65. <!-- <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>-->
  66. </td>
  67. </tr>
  68. {/volist}
  69. </tbody>
  70. </table>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. {/block}
  77. {block name="script"}
  78. <script>
  79. $('.btn-danger').on('click',function(){
  80. var _this = $(this),url =_this.data('url');
  81. $eb.$swal('delete',function(){
  82. $eb.axios.get(url).then(function(res){
  83. console.log(res);
  84. if(res.status == 200 && res.data.code == 200) {
  85. $eb.$swal('success',res.data.msg);
  86. _this.parents('tr').remove();
  87. }else
  88. return Promise.reject(res.data.msg || '删除失败')
  89. }).catch(function(err){
  90. $eb.$swal('error',err);
  91. });
  92. })
  93. });
  94. </script>
  95. {/block}