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_full.htm 7.4KB

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