filesbox/web/dist/46221.e688d92d.async.js

2 lines
13 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[46221],{51695:function(x){x.exports={upLoadBox:"upLoadBox___3dYrI"}},55462:function(x){x.exports={root:"root___1saff",colorWeak:"colorWeak___RnDog","ant-layout":"ant-layout___2uVwk",globalSpin:"globalSpin___3pVwv","ant-table":"ant-table___25eIk","ant-table-thead":"ant-table-thead___i1WvX","ant-table-tbody":"ant-table-tbody___Encg9",formBox:"formBox___2RqtD",videoModal:"videoModal___2VWaM"}},99267:function(x,T,t){"use strict";t.d(T,{Z:function(){return O}});var Q=t(34792),m=t(48086),C=t(11849),W=t(67294),k=t(80129),K=t.n(k),Z=t(51695),A=t.n(Z),z=t(94301),b=t.n(z),D=t(85893),j=y=>{var a=parseInt(y),i=1024*1024*1024*1024,u=1024*1024*1024,r=1024*1024,v=1024;if(a>i)return(a/i).toFixed(2)+"T";if(a>u)return(a/u).toFixed(2)+"G";if(a>r)return(a/r).toFixed(2)+"M";if(a>v)return(a/v).toFixed(2)+"kb"};function F(y){for(var a=document.cookie,i=a.split("; "),u=0;u<i.length;u++){var r=i[u].split("=");if(r[0]==y)return r[1]}return""}var R=F("stoken")||F("token");class O extends W.Component{constructor(){super(...arguments);this.uloadRegister=()=>{WebUploader.Uploader.register({"before-send":"beforeSend"},{beforeSend:function(i){var u=WebUploader.Deferred(),r=i.file.chunkList||[],v={};r.forEach(P=>{v[P+""]=!0});var I=i.chunk,M=i.chunks;return v[I+""]?u.reject():u.resolve(),u.promise()}})},this.uploadCheckFile=(a,i)=>{var u=this.props,r=u.busType,v=u.directoryId,I=v===void 0?void 0:v,M=u.userId,P=M===void 0?void 0:M,B=u.directoryName,d=B===void 0?void 0:B,S={busType:r,directoryId:I,userId:P,checksum:a.checksum,fileName:a.name,size:a.size};b()("/api/disk/upload/checkFile?".concat((0,k.stringify)(S)),{credentials:"include",headers:{token:R}}).then(E=>E.status==200?E.json():{success:!1}).then(E=>{i(E,I,P,d)})},this.uploadInit=()=>{var a=this,i=this.props,u=i.options,r=i.events,v=i.busType,I=i.cancelFile,M=i.isreplace,P=i.directoryId,B=P===void 0?void 0:P,d=i.userId,S=d===void 0?void 0:d,E=i.directoryName,G=E===void 0?void 0:E,X=i.coursewareType,H=1,L="jpg,doc,docx,ppt,flv,mp4,mp3,jpeg,png,gif,xls,xlsx,pdf,pptx,avi,swf,mov,pps,wmv,mpg,rmvb,doc, docx, ppt, pptx, pdf, xls, xlsx, pps, wps, txt, rar, zip, arj, gz, z, ta";u.pick&&(u.pick=(0,C.Z)((0,C.Z)({},u.pick),{},{id:".picker"}));var h=(0,C.Z)((0,C.Z)({},{auto:!1,swf:"/design/designstatic/aroom/common/js/Uploader.swf",server:"/api/disk/upload?projectid=45",pick:{id:".picker",multiple:!1},resize:!1,disableGlobalDnd:!0,compress:!1,prepareNextFile:!0,timeout:6e4*5,chunked:!0,chunkSize:2*1024*1024,chunkRetry:3,threads:5,formData:{},fileNumLimit:20,fileSizeLimit:200*1024*1024*1024,fileSingleSizeLimit:2*1024*1024*1024,duplicate:!1,accept:{title:"\u5927\u6587\u4EF6\u4E0A\u4F20",extensions:L}}),u);L=h.accept.extensions;var s=WebUploader.create(h);s.option("accept",[this.props.accept]),this.uploader=s;var c="\u8BF7\u9009\u62E9\u6B63\u786E\u6587\u4EF6\u7C7B\u578B:".concat(L);s.on("error",function(e,o){switch(e){case"Q_EXCEED_NUM_LIMIT":m.ZP.error("\u53EA\u5141\u8BB8\u4E0A\u4F20".concat(h.fileNumLimit,"\u4E2A\u6587\u4EF6"));break;case"Q_EXCEED_SIZE_LIMIT":m.ZP.error("\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(j(h.fileSizeLimit)));break;case"Q_TYPE_DENIED":m.ZP.error(c);break;case"F_EXCEED_SIZE":m.ZP.error("\u6587\u4EF6\u603B\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(j(h.fileSingleSizeLimit)));break;default:m.ZP.error("\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002");break}}),s.on("beforeFileQueued",function(e){if(M&&(e.name=e.name.replace(/\^/g,"")),a.props.accept){var o=a.props.accept.extensions;if(o.indexOf(e.ext)<0)return m.ZP.error("\u8BF7\u9009\u62E9\u6B63\u786E\u6587\u4EF6\u7C7B\u578B:".concat(o)),!1}if(r&&r.beforeFileQueued)return r.beforeFileQueued(e);if(e.type.indexOf("image")>-1&&e.size>2*1024*1024)return m.ZP.error("\u5355\u4E2A\u56FE\u7247\u6700\u5927\u4E0D\u8D85\u8FC72MB"),!1;if(e.size>2*1024*1024*1024)return m.ZP.error("\u5355\u4E2A\u8BFE\u4EF6\u6700\u5927\u4E0D\u8D85\u8FC72G"),!1}),s.on("fileQueued",function(e){r&&r.fileQueued&&s.makeThumb(e,function(o,l){if(o){r.fileQueue