No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upload_frame.htm 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <html lang="zh-cn">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  4. <title>文件管理</title>
  5. <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/webuploader/webuploader.css?v={$version|default='1.2.9'}">
  6. <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/webuploader/css/style.css?v={$version|default='1.2.9'}">
  7. <script type="text/javascript">
  8. var eyou_basefile = "{$Request.baseFile}";
  9. var module_name = "{$Think.const.MODULE_NAME}";
  10. var __root_dir__ = "__ROOT_DIR__";
  11. </script>
  12. </head>
  13. <body>
  14. <div class="upload-box" style="height: 90%;">
  15. <ul class="tabs">
  16. <li class="checked" id="upload_tab">本地上传</li>
  17. <a href="javascript:void(0);" onclick="picture_folder(this);" data-url="{:url('Uploadify/picture_folder',['num'=>$info['num'],'input'=>$info['input'],'path'=>$info['path'],'func'=>$info['func']])}"><li>在线管理</li></a>
  18. <!-- <li id="search_tab">文件搜索</li> -->
  19. </ul>
  20. <div class="container">
  21. <div class="area upload-area area-checked" id="upload_area">
  22. <div id="uploader">
  23. <div class="statusBar" style="display:none;">
  24. <div class="progress">
  25. <span class="text">0%</span>
  26. <span class="percentage"></span>
  27. </div><div class="info"></div>
  28. <div class="btns">
  29. <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
  30. <div class="saveBtn">确定使用</div>
  31. </div>
  32. </div>
  33. <div class="queueList">
  34. <div id="dndArea" class="placeholder">
  35. <div id="filePicker"></div>
  36. <p>或将文件拖到这里,本次最多可选{$info.num|default=1}个</p>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="area manage-area" id="manage_area">
  42. <ul class="choose-btns">
  43. <li class="btn sure checked">确定</li>
  44. <li class="btn cancel">取消</li>
  45. </ul>
  46. <div class="file-list">
  47. <ul id="file_all_list">
  48. <!--<li class="checked">
  49. <div class="img">
  50. <img src="" />
  51. <span class="icon"></span>
  52. </div>
  53. <div class="desc"></div>
  54. </li>-->
  55. </ul>
  56. </div>
  57. </div>
  58. <div class="area search-area" id="search_area">
  59. <ul class="choose-btns">
  60. <li class="search">
  61. <div class="search-condition">
  62. <input class="key" type="text" />
  63. <input class="submit" type="button" hidefocus="true" value="搜索" />
  64. </div>
  65. </li>
  66. <li class="btn sure checked">确定</li>
  67. <li class="btn cancel">取消</li>
  68. </ul>
  69. <div class="file-list">
  70. <ul id="file_search_list">
  71. <!--<li>
  72. <div class="img">
  73. <img src="" />
  74. <span class="icon"></span>
  75. </div>
  76. <div class="desc"></div>
  77. </li>-->
  78. </ul>
  79. </div>
  80. </div>
  81. <div class="fileWarp" style="display:none;">
  82. <fieldset>
  83. <legend>列表</legend>
  84. <ul>
  85. </ul>
  86. </fieldset>
  87. </div>
  88. </div>
  89. </div>
  90. {load href="__STATIC__/common/js/jquery.min.js" /}
  91. <script type="text/javascript" src="__PUBLIC__/plugins/webuploader/webuploader.min.js?v={$version|default='1.2.9'}"></script>
  92. <script type="text/javascript" src="__PUBLIC__/plugins/webuploader/upload.js?v={$version|default='1.2.9'}"></script>
  93. <script type="text/javascript" src="__PUBLIC__/plugins/layer-v3.1.0/layer.js?v={$version|default='1.2.9'}"></script>
  94. <script src="__SKIN__/js/global.js?v={$version}"></script>
  95. <script type="text/javascript">
  96. $(function(){
  97. var config = {
  98. "swf":"__PUBLIC__/plugins/webuploader/Uploader.swf",
  99. "server":"{$info.upload}",
  100. "filelistPah":"{$info.fileList}",
  101. "delPath":"{:url('Uploadify/delupload')}",
  102. "chunked":false,
  103. "chunkSize":524288,
  104. "fileNumLimit":{$info.num|default=1},
  105. "fileSizeLimit":209715200,
  106. "fileSingleSizeLimit":{$info.size},
  107. "fileVal":"file",
  108. "auto":true,
  109. "formData":{},
  110. "duplicate": true, // 允许上传重复文件
  111. // "accept": {
  112. // "title": 'Images',
  113. // "extensions": '{$info.type}',
  114. // "mimeTypes": 'image/*'
  115. // },
  116. "pick":{"id":"#filePicker","label":"点击选择图片","name":"file"},
  117. "thumb":{"width":110,"height":110,"quality":70,"allowMagnify":true,"crop":true,"preserveHeaders":false,"type":"image\/jpeg"},
  118. "compress": {
  119. "width": 380000,
  120. "height": 380000,
  121. "quality": 100,
  122. "allowMagnify": false,
  123. "crop": false,
  124. "preserveHeaders": true
  125. }
  126. };
  127. Manager.upload($.extend(config, {type : "Images"}));
  128. /*点击保存按钮时
  129. *判断允许上传数,检测是单一文件上传还是组文件上传
  130. *如果是单一文件,上传结束后将地址存入$input元素
  131. *如果是组文件上传,则创建input样式,添加到$input后面
  132. *隐藏父框架,清空列队,移除已上传文件样式*/
  133. $(".statusBar .saveBtn").click(function(){
  134. var callback = "{$info.func}";
  135. var num = {$info.num|default=1};
  136. var fileurl_tmp = [];
  137. if(callback != "undefined"){
  138. if(num > 1){
  139. var src = '';
  140. ("input[name^='fileurl_tmp']").each(function(index,dom){
  141. src = $('.WU_FILE_'+index).find("input[name^='fileurl_tmp']").val() || dom.value;
  142. fileurl_tmp[index] = src;
  143. });
  144. }else{
  145. fileurl_tmp = $("input[name^='fileurl_tmp']").val();
  146. }
  147. /*防止图片上传过程中用户点击确定,导致获取图片失败 by 小虎哥*/
  148. if (fileurl_tmp == undefined || fileurl_tmp.length == 0) {
  149. layer.msg('正在处理……', {icon: 6,time: 2000});
  150. return false;
  151. }
  152. /*--end*/
  153. eval('window.parent.'+callback+'(fileurl_tmp)');
  154. window.parent.layer.closeAll();
  155. return;
  156. }
  157. if(num > 1){
  158. var fileurl_tmp = "";
  159. $("input[name^='fileurl_tmp']").each(function(){
  160. fileurl_tmp += '<li rel="'+ this.value +'"><input class="input-text" type="text" name="{$info.input}[]" value="'+ this.value +'" /><a href="javascript:void(0);" onclick="ClearPicArr(\''+ this.value +'\',\'\')">删除</a></li>';
  161. });
  162. $(window.parent.document).find("#{$info.input}").append(fileurl_tmp);
  163. }else{
  164. $(window.parent.document).find("#{$info.input}").val($("input[name^='fileurl_tmp']").val());
  165. }
  166. window.parent.layer.closeAll();
  167. });
  168. });
  169. function picture_folder(obj)
  170. {
  171. var url = $(obj).attr('data-url');
  172. layer_loading('正在跳转');
  173. window.location.href = url;
  174. }
  175. </script>
  176. </body>
  177. </html>