2 lines
27 KiB
JavaScript
2 lines
27 KiB
JavaScript
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[73976],{43347:function(fe,Y,d){"use strict";d.d(Y,{Z:function(){return de}});var Q=d(28991),N=d(67294),ie={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},oe=ie,R=d(27029),U=function(ne,q){return N.createElement(R.Z,(0,Q.Z)((0,Q.Z)({},ne),{},{ref:q,icon:oe}))};U.displayName="InboxOutlined";var de=N.forwardRef(U)},42762:function(fe,Y,d){"use strict";d.d(Y,{Z:function(){return de}});var Q=d(28991),N=d(67294),ie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"},oe=ie,R=d(27029),U=function(ne,q){return N.createElement(R.Z,(0,Q.Z)((0,Q.Z)({},ne),{},{ref:q,icon:oe}))};U.displayName="MenuOutlined";var de=N.forwardRef(U)},84391:function(fe,Y,d){"use strict";d.d(Y,{Z:function(){return de}});var Q=d(28991),N=d(67294),ie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},oe=ie,R=d(27029),U=function(ne,q){return N.createElement(R.Z,(0,Q.Z)((0,Q.Z)({},ne),{},{ref:q,icon:oe}))};U.displayName="UploadOutlined";var de=N.forwardRef(U)},55459:function(fe){fe.exports={uploadBox:"uploadBox___2sJxS",buttonBox:"buttonBox___2kMhq",emptyBox:"emptyBox___4Vsdr"}},73976:function(fe,Y,d){"use strict";d.r(Y),d.d(Y,{default:function(){return dr}});var Q=d(54421),N=d(38272),ie=d(74379),oe=d(38648),R=d(39428),U=d(3182),de=d(34792),G=d(48086),ne=d(59250),q=d(13013),le=d(11849),ke=d(91220),Ve=d(2824),Ae=d(34895),Se=d(80129),ue=d(67294),ye=d(37406),ur=d(96486),Re=d(69847),n=d(85893);window.WebUploader=WebUploader;var cr=h=>{var t=parseInt(h),e=1024*1024*1024*1024,a=1024*1024*1024,s=1024*1024,i=1024;if(t>e)return(t/e).toFixed(2)+"T";if(t>a)return(t/a).toFixed(2)+"G";if(t>s)return(t/s).toFixed(2)+"M";if(t>i)return(t/i).toFixed(2)+"kb"};function We(h){for(var t=document.cookie,e=t.split("; "),a=0;a<e.length;a++){var s=e[a].split("=");if(s[0]==h)return s[1]}return""}var pr=h=>{if(h){var t,e,a,s=(h==null?void 0:h.fullPath)||(h==null||(t=h.source)===null||t===void 0||(e=t.source)===null||e===void 0?void 0:e.fullPath)||(h==null||(a=h.source)===null||a===void 0?void 0:a.fullPath)||"";return s.split("/").filter(i=>i)}else return[]};class Pe extends ue.Component{constructor(t){super(t);this.uloadRegister=()=>{},this.uploadCheckFile=(e,a,s)=>{var i,c,x,g,p,v,w=this,I=this.props,B=I.busType,V=I.directoryId,C=V===void 0?void 0:V,P=I.userId,Z=P===void 0?void 0:P,K=I.fileId,_=K===void 0?void 0:K,ce=I.directoryName,pe=ce===void 0?void 0:ce,A=I.isCommon,J=A===void 0?void 0:A,m=I.batchDirectory,xe={busType:B,sourceID:a||C,path:window.newVersionId||void 0,userId:Z,fileId:_,checksum:e.checksum,hashMd5:e.hashMd5,fileName:e.name,size:e.size,taskID:e.taskID||"",webkitRelativePath:(e==null?void 0:e.fullPath)||(e==null||(i=e.source)===null||i===void 0||(c=i.source)===null||c===void 0?void 0:c.fullPath)||(e==null||(x=e.source)===null||x===void 0?void 0:x.fullPath)||"",fullPath:(e==null?void 0:e.fullPath)||(e==null||(g=e.source)===null||g===void 0||(p=g.source)===null||p===void 0?void 0:p.fullPath)||(e==null||(v=e.source)===null||v===void 0?void 0:v.fullPath)||""};fetch("/api/disk/upload/check?".concat((0,Se.stringify)(xe)),{credentials:"include",headers:{token:this.token}}).then(r=>r.status==200?r.json():{success:!1}).then(r=>{s(r,a||C,Z,pe,J,_)})},this.uploadInit=()=>{var e=this,a=e.props,s=a.options,i=a.events,c=a.busType,x=a.cancelFile,g=a.isreplace,p=a.directoryId,v=p===void 0?void 0:p,w=a.userId,I=w===void 0?void 0:w,B=a.fileId,V=B===void 0?void 0:B,C=a.directoryName,P=C===void 0?void 0:C,Z=a.folderList,K=Z===void 0?[]:Z,_=a.notupload,ce=_===void 0?!1:_,pe=1,A="jpg,doc,docx,ppt,flv,mp4,mp3,jpeg,png,gif,xls,xlsx,pdf,pptx,avi,swf,mov,pps,wmv,mpg,rmvb,zip,msi";s.pick&&(s.pick=(0,le.Z)((0,le.Z)({},s.pick),{},{id:".picker"}));var J=(0,le.Z)((0,le.Z)({},{auto:!1,swf:"/design/designstatic/aroom/common/js/Uploader.swf",server:"/api/disk/upload",pick:{id:".picker",multiple:!0},dnd:".dropbox",resize:!1,disableGlobalDnd:!0,compress:!1,prepareNextFile:!0,timeout:6e4*5,chunked:!0,chunkSize:2*1024*1024,chunkRetry:3,threads:5,formData:{},fileSizeLimit:200*1024*1024*1024,fileSingleSizeLimit:20*1024*1024*1024,duplicate:!1,accept:{title:"\u5927\u6587\u4EF6\u4E0A\u4F20",extensions:A},widgetList:{"before-send-file":function(o){var y=WebUploader.Deferred();o.ext==="DS_Store"&&m.removeFile(o,!0);var D,S=e.props.directoryId;return i&&i.fileQueued,o.uploadStatus=0,e.shownumC=1,m.md5File(o).progress(function(M){o.md5Progress=M,e.getFiles()}).then(function(M){var O,F,E,u,ee,X;o.checksum=M,o.hashMd5=M,o.taskID=(0,ye.fW)();var te={busType:c,sourceID:o.directoryId,path:window.newVersionId||void 0,checksum:o.checksum,hashMd5:o.hashMd5,fileName:o.name,size:o.size,taskID:o.taskID||"",webkitRelativePath:(o==null?void 0:o.fullPath)||(o==null||(O=o.source)===null||O===void 0||(F=O.source)===null||F===void 0?void 0:F.fullPath)||(o==null||(E=o.source)===null||E===void 0?void 0:E.fullPath)||"",fullPath:(o==null?void 0:o.fullPath)||(o==null||(u=o.source)===null||u===void 0||(ee=u.source)===null||ee===void 0?void 0:ee.fullPath)||(o==null||(X=o.source)===null||X===void 0?void 0:X.fullPath)||""};$.ajax({headers:{token:e.token},type:"GET",url:"/api/disk/upload/check?".concat((0,Se.stringify)(te)),data:{},dataType:"json",async:!0,success:function(z){if(o.uploadStatus==4)return!1;if(z.code=="admin.role.ignoreFileSizeTips")return G.ZP.error(z.message),!1;if(z.code=="explorer.spaceIsFull"&&e.showerrorNum)return G.ZP.error(z.message),e.showerrorNum=0,m.reset(),!1;if(o.userId=I,o.fileId=V,o.sourceID=o.directoryId,o.directoryName=P||"",o.path=window.newVersionId||void 0,z.success){var ae=z.data||{};ae.fileExists?(o.uploadStatus=2,o.uploadProgress=1,o.response=z,o.sourceId=ae.sourceId,i&&i.uploadSuccess&&i.uploadSuccess(o,e.props.refresh),y.reject()):(o.size&&(o.chunkList=ae.chunkList,o.uploadStatus=0),y.resolve())}else y.resolve();e.getFiles()},error:function(z){y.resolve(),e.getFiles()}})}),y.promise()},"before-send":function(o){var y=WebUploader.Deferred(),D=o.file.chunkList||[],S={};D.forEach(F=>{S[F+""]=!0});var M=o.chunk,O=o.chunks;return S[M+""]?y.reject():y.resolve(),y.promise()}}}),s);A=J.accept.extensions;var m=WebUploader.create(J);e.uploader=m,window.filesboxUploader=m;var xe="\u8BF7\u9009\u62E9\u6B63\u786E\u6587\u4EF6\u7C7B\u578B:".concat(A);m.on("error",function(r,o){switch(r){case"Q_EXCEED_NUM_LIMIT":e.shownumC&&(e.shownumC=0,G.ZP.error({content:"\u53EA\u5141\u8BB8\u4E0A\u4F20".concat(J.fileNumLimit,"\u4E2A\u6587\u4EF6"),key:"asasasasasas",duration:2}));break;case"Q_EXCEED_SIZE_LIMIT":break;case"Q_TYPE_DENIED":break;case"F_EXCEED_SIZE":break;default:break}}),m.on("beforeFileQueued",function(r){var o,y,D,S=r&&r.name?r.name:"",M=S?S.split(".")[S.split(".").length-1]=="url":!1;if(ce&&!window.selectuploadx||M)return m.removeFile(r,!0),!1;var O=e.directoryId,F=(r==null||(o=r.source)===null||o===void 0||(y=o.source)===null||y===void 0?void 0:y.fullPath)||(r==null||(D=r.source)===null||D===void 0?void 0:D.fullPath)||"";if(r.isFile=r.source.isFile,r.directoryId=O,F){var E=F.split("/").filter(De=>De),u=(0,Re.Ej)(e.props.folderList,E[0]);u&&(E[0]=E[0]+(u?"("+u+")":"")),r.fullPath=E.join("/")}var ee=!r.directoryId||r.directoryId==null||r.directoryId=="undefined";if(ee||ee||r.ext=="DS_Store")return m.removeFile(r,!0),!1;if(!r.isFile){var X,te,ve,z=(r==null?void 0:r.fullPath)||(r==null||(X=r.source)===null||X===void 0||(te=X.source)===null||te===void 0?void 0:te.fullPath)||(r==null||(ve=r.source)===null||ve===void 0?void 0:ve.fullPath)||"",ae={name:z,sourceID:r.directoryId||0};return $.ajax({type:"POST",headers:{token:e.token},url:"/api/disk/mkDir",contentType:"application/json",dataType:"json",data:JSON.stringify(ae),async:!1,success:function(Le){}}),m.removeFile(r,!0),!1}if(g&&(r.name=r.name.replace(/\^/g,"")),i&&i.beforeFileQueued)return i.beforeFileQueued(r);if(r.type.indexOf("image")>-1&&r.size>20*1024*1024*1024)return!1;if(r.size>20*1024*1024*1024)return!1}),m.on("fileQueued",function(r){}),m.on("uploadStart",function(r,o){r.uploadStatus=1,e.getFiles()}),m.on("uploadBeforeSend",function(r,o,y){var D,S,M,O,F,E,u=r.file||{};y.token=e.token,o.busType=e.props.busType,o.sourceID=u.directoryId,o.path=window.newVersionId||void 0,o.userId=u.userId,o.fileId=u.fileId,o.webkitRelativePath=(u==null?void 0:u.fullPath)||(u==null||(D=u.source)===null||D===void 0||(S=D.source)===null||S===void 0?void 0:S.fullPath)||(u==null||(M=u.source)===null||M===void 0?void 0:M.fullPath)||"",o.fullPath=(u==null?void 0:u.fullPath)||(u==null||(O=u.source)===null||O===void 0||(F=O.source)===null||F===void 0?void 0:F.fullPath)||(u==null||(E=u.source)===null||E===void 0?void 0:E.fullPath)||"",o.checksum=u.checksum,o.hashMd5=u.checksum,o.chunk=r.chunk,o.chunkSize=r.end-r.start,o.chunks=r.chunks,o.taskID=u.taskID}),m.on("uploadProgress",function(r,o){r.uploadStatus=1,r.uploadProgress=o,e.getFiles()}),m.on("uploadSuccess",function(r,o){var y=o||{},D=y.data||{},S=D.sourceID;S?(r.uploadStatus=2,r.sourceId=S,r.uploaderTime=Math.round(new Date),r.response=y,i&&i.uploadSuccess&&i.uploadSuccess(r,e.props.refresh)):r.uploadStatus=3,e.getFiles()}),m.on("uploadError",function(r){var o=r.response||{},y=o.data||{},D=y.sourceID;D?i&&i.uploadSuccess&&i.uploadSuccess(r,e.props.refresh):r.uploadStatus=3}),m.on("fileDequeued",function(r){r.uploadStatus!==void 0&&(r.uploadStatus=4),e.getFiles()}),m.on("uploadFinished",function(){i&&i.uploadFinished()}),m.on("uploadComplete",function(){i&&i.uploadComplete()})},this.getFiles=()=>{var e=this,a=this.props.onChange,s=e.uploader,i=s.getFiles();a&&a(i,e.uploader)},this.addUploads=(e,a)=>{var s=this,i=s.uploader.getFiles().length;if(i<=20&&s.queue.length){a=="success"?s.queueSuccess.push(e):s.queueError.push(e),s.uploader.removeFile(e,!0);var c=s.queue.splice(0,20);s.uploader.addFiles(c)}},this.extImg=e=>{switch(e.toLowerCase()){case"avi":return"/design/designstatic/chatroom/img/dialog_avi.png";case"bmp":return"/design/designstatic/chatroom/img/dialog_bmp.png";case"bt":return"/design/designstatic/chatroom/img/dialog_bt.png";case"camera":return"/design/designstatic/chatroom/img/dialog_camera.png";case"course":return"/design/designstatic/chatroom/img/dialog_course.png";case"doc":return"/design/designstatic/chatroom/img/dialog_doc.png";case"docx":return"/design/designstatic/chatroom/img/dialog_doc.png";case"exam":return"/design/designstatic/chatroom/img/dialog_exam.png";case"flv":return"/design/designstatic/chatroom/img/dialog_flv.png";case"gif":return"/design/designstatic/chatroom/img/dialog_gif.png";case"html":return"/design/designstatic/chatroom/img/dialog_html.png";case"jpeg":return"/design/designstatic/chatroom/img/dialog_jpeg.png";case"jpg":return"/design/designstatic/chatroom/img/dialog_jpg.png";case"mov":return"/design/designstatic/chatroom/img/dialog_mov.png";case"mp3":return"/design/designstatic/chatroom/img/dialog_mp3.png";case"mp4":return"/design/designstatic/chatroom/img/dialog_mp4.png";case"mpg":return"/design/designstatic/chatroom/img/dialog_mpg.png";case"pdf":return"/design/designstatic/chatroom/img/dialog_pdf.png";case"png":return"/design/designstatic/chatroom/img/dialog_png.png";case"ppt":return"/design/designstatic/chatroom/img/dialog_ppt.png";case"pptx":return"/design/designstatic/chatroom/img/dialog_ppt.png";case"pps":return"/design/designstatic/chatroom/img/dialog_ppt.png";case"rar":return"/design/designstatic/chatroom/img/dialog_rar.png";case"rmvb":return"/design/designstatic/chatroom/img/dialog_rmvb.png";case"survey":return"/design/designstatic/chatroom/img/dialog_survey.png";case"swf":return"/design/designstatic/chatroom/img/dialog_swf.png";case"txt":return"/design/designstatic/chatroom/img/dialog_txt.png";case"wmv":return"/design/designstatic/chatroom/img/dialog_wmv.png";case"xls":return"/design/designstatic/chatroom/img/dialog_xls.png";case"xlsx":return"/design/designstatic/chatroom/img/dialog_xls.png";case"zip":return"/design/designstatic/chatroom/img/dialog_zip.png"}},this.updateList=[],this.uploading=!0,this.stopUpload=!1}componentDidMount(){this.token=We("token"),this.directoryId=this.props.directoryId,this.queue=[],this.queueDoing=[],this.queueError=[],this.queueSuccess=[],this.messagekey="xxxaaasss",this.showerrorNum=1,this.shownumC=1,this.uploadInit()}componentDidUpdate(t){var e=this,a=this.props.directoryId,s=t.directoryId;s!=a&&setTimeout(function(){e.directoryId=a},1500)}componentWillUnmount(){var t=this.props.dispatch;window.filesboxUploader&&window.filesboxUploader.destroy()}render(){var t=this.props,e=t.children,a=t.disabled,s=a===void 0?!1:a,i=x=>{$(".webuploader-element-invisible").trigger("click")},c=[{key:"1",label:"\u4E0A\u4F20\u6587\u4EF6"},{key:"2",label:"\u4E0A\u4F20\u6587\u4EF6\u5939"}];return(0,n.jsxs)(n.Fragment,{children:[e,(0,n.jsx)("a",{style:{display:"none"},className:"picker",children:"\u4E0A\u4F20"})]})}}Pe.defaultProps={options:{},events:{},busType:"cloud",isreplace:!1,onChange:()=>{},refresh:()=>{},addDirectory:()=>{},searchdirectoryId:()=>{},treeList:[],batchDirectory:[]};var He=Pe,Qe=He,Ie=d(28991),Ge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},Ke=Ge,Fe=d(27029),$e=function(t,e){return ue.createElement(Fe.Z,(0,Ie.Z)((0,Ie.Z)({},t),{},{ref:e,icon:Ke}))};$e.displayName="PlayCircleOutlined";var Je=ue.forwardRef($e),Xe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm-88-532h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z"}}]},name:"pause-circle",theme:"outlined"},Ye=Xe,je=function(t,e){return ue.createElement(Fe.Z,(0,Ie.Z)((0,Ie.Z)({},t),{},{ref:e,icon:Ye}))};je.displayName="PauseCircleOutlined";var qe=ue.forwardRef(je),_e=d(42762),er=d(43347),we=d(84391),rr=d(19675),or=d(28216),tr=d(51964),ar=d.n(tr),W=d(30672),sr=d(55459),be=d.n(sr),Ce,Ze,Me=h=>{var t=h.split("/").filter(e=>e);return t.slice(0,t.length-1)},Ee=(h,t)=>{var e=h,a=(0,ke.Z)(t.entries()),s;try{for(a.s();!(s=a.n()).done;){for(var i=s.value,c=(0,Ve.Z)(i,2),x=c[0],g=c[1],p=null,v=0;v<e.length;v++)e[v]&&(e[v].oldName||e[v].name)==g&&(p=e[v]);if(!p)return 0;if(x===t.length-1)return p.sourceID;e=p.children}}catch(w){a.e(w)}finally{a.f()}return 0},ir=(h,t,e,a)=>{if(!t)throw Error("\u65B0\u8282\u70B9\u6784\u5EFA\u5931\u8D25");var s=!1,i=(c,x)=>{if(s!==!0)for(var g=0;g<c.length;g++)c[g].children&&c[g].children.length>0&&i(c[g].children,x),(JSON.stringify(x)===JSON.stringify(c[g])||s)&&(s||(c[g]=t[0]),s=!0)};return i(a,e),a},dr=(Ce=(0,or.$j)(h=>{var t=h.common;return{common:t}}),Ce(Ze=class extends ue.PureComponent{constructor(){super(...arguments);this.state={open:!1,modelZindex:100,isWebkitdirectory:!1,btnvalue:"",cloudfileList:[],isstop:!1,treeList:[]},this.dropNewFile=()=>{var t=this,e=$("#uploadEmpty"),a=e[0],s=function(B){var V=t.props,C=V.dispatch,P=V.common,Z=P.viewType,K=P.addressPath,_=P.selectAddressIndex,ce=Z==3?K[_]:K[K.length-1];B.preventDefault(),x();var pe=B.dataTransfer,A=pe.files[0],J=pe.getData("Text"),m=!1,xe=J.slice(0,5)+".txt";if(A){C({type:"common/setState",payload:{uploadVisible:!0}});return}},i=0,c=()=>{clearTimeout(i),e.css({borderColor:"#7459e3"})},x=()=>{i=setTimeout(()=>{e.css({borderColor:"#d9d9d9"})},300)},g=I=>{I.preventDefault(),c()},p=I=>{I.preventDefault(),x()},v=I=>{I.preventDefault(),i&&clearTimeout(i)},w=I=>{};a.removeEventListener("dragenter",g,!1),a.removeEventListener("dragleave",p,!1),a.removeEventListener("dragover",v,!1),a.removeEventListener("drop",w,!1),a.addEventListener("dragenter",g,!1),a.addEventListener("dragleave",p,!1),a.addEventListener("dragover",v,!1),a.addEventListener("drop",w,!1)},this.getList=(t,e)=>{var a=this,s=a.props,i=s.dispatch,c=s.common,x=s.open,g=s.setOpenModel,p=c.getParams;i({payload:(0,le.Z)({},t||p),type:"common/getListPath",callback:()=>{if(!!(e!=null&&e.length)){var v=document.querySelector('.itemBox[sourceid="'.concat(e[0],'"]'));v==null||v.scrollIntoView(!1)}}}),i({type:"common/setState",payload:{isUpdateVersion:!0}})}}componentDidMount(){var t=this;t.dropNewFile()}componentDidUpdate(t){var e=this,a=e.props,s=a.open,i=a.common,c=a.dispatch,x=e.state.modelZindex;s!=t.open&&(e.setState({modelZindex:window.globalZindex+1}),window.globalZindex=window.globalZindex+1)}renderRightMenu(){var t=this,e=t.props,a=e.dispatch,s=e.common,i=s.getParams,c=s.checkFolderParams,x=this.state,g=x.btnvalue,p=x.isstop,v=()=>{t.clouduploadDom&&(t.clouduploadDom.upload(),t.setState({isstop:!p}))},w=()=>{t.clouduploadDom&&(t.clouduploadDom.stop(!0),t.setState({isstop:!p}))},I=()=>{t.clouduploadDom&&(t.clouduploadDom.reset(),t.getFiles())},B=()=>{if(t.clouduploadDom){var C=t.clouduploadDom.getFiles("complete");if(C.length)for(var P=0;P<C.length;P++)t.clouduploadDom.removeFile(C[P],!0)}},V=[p?{key:"1",label:(0,n.jsx)("a",{onClick:v,children:(0,n.jsx)(W._H,{id:"common.start"})}),icon:(0,n.jsx)(Je,{})}:{key:"1",label:(0,n.jsx)("a",{onClick:w,children:(0,n.jsx)(W._H,{id:"common.stop"})}),icon:(0,n.jsx)(qe,{})},{key:"2",label:(0,n.jsx)("a",{onClick:I,children:(0,n.jsx)(W._H,{id:"explorer.upload.clearAll"})})},{key:"3",label:(0,n.jsx)("a",{onClick:B,children:(0,n.jsx)(W._H,{id:"explorer.upload.clear"})})}];return(0,n.jsx)("div",{className:"right",children:(0,n.jsx)(q.Z,{menu:{items:V},placement:"bottomRight",children:(0,n.jsx)(_e.Z,{})})})}renderEmpty(){var t=this,e=t.props,a=e.dispatch,s=e.common,i=s.checkFolderParams,c=t.state.cloudfileList,x=(0,W.lw)((0,W.Kd)()),g=w=>{if(!i.sourceID)return G.ZP.warning(x.formatMessage({id:"common.thefoldernosupport"})),!1;window.newVersionId=void 0,$(".webuploader-element-invisible").attr("accept","*"),$(".webuploader-element-invisible").attr("multiple","multiple"),$(".webuploader-element-invisible").removeAttr("webkitdirectory"),$(".webuploader-element-invisible").trigger("click")},p=()=>{var w=$("#uploadEmpty");clearTimeout(timeIndex),w.css({borderColor:"#7459e3"})},v=()=>{var w=$("#uploadEmpty");timeIndex=setTimeout(()=>{w.css({borderColor:"#d9d9d9"})},300)};return(0,n.jsx)("div",{onDragEnter:p,onDragLeave:v,className:be().emptyBox,id:"uploadEmpty",onClick:g,style:{display:c.length?"none":""},children:(0,n.jsxs)("div",{className:"contentBox",children:[(0,n.jsx)(er.Z,{}),(0,n.jsxs)("p",{children:[" ",(0,W.Kd)()=="en-US"?"Click here or drag and drop files to upload here":"\u70B9\u51FB\u6B64\u5904\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20"]})]})})}render(){var t=this,e=t.props,a=e.dispatch,s=e.common,i=e.open,c=e.setOpenModel,x=e.isDestopView,g=s.getParams,p=s.checkFolderParams,v=s.addressPath,w=s.selectAddressIndex,I=s.viewType,B=s.uploadSourceID,V=s.listData,C=s.isIframe,P=s.shareCode,Z=this.state,K=Z.modelZindex,_=Z.isWebkitdirectory,ce=Z.btnvalue,pe=Z.isstop,A=Z.cloudfileList,J=A===void 0?[]:A,m=V.folderList,xe=m===void 0?[]:m,r=(0,W.lw)((0,W.Kd)()),o=I==3?v[w]||{}:v[v.length-1]||{},y=r.formatMessage({id:"admin.index.fileUpload"}),D=r.formatMessage({id:"common.upload"}),S=r.formatMessage({id:"common.start"}),M=r.formatMessage({id:"common.stop"}),O=r.formatMessage({id:"explorer.uploadFolder"}),F=l=>{t.setState({modelZindex:l})},E=()=>{a({type:"common/setState",payload:{sourceID:sourceID+1}})},u=l=>{if(!o.sourceID)return G.ZP.warning(r.formatMessage({id:"common.thefoldernosupport"})),!1;window.newVersionId=void 0,$(".webuploader-element-invisible").attr("accept","*"),$(".webuploader-element-invisible").attr("multiple","multiple"),$(".webuploader-element-invisible").removeAttr("webkitdirectory"),$(".webuploader-element-invisible").trigger("click")},ee=l=>{if(!o.sourceID)return G.ZP.warning(r.formatMessage({id:"common.thefoldernosupport"})),!1;window.newVersionId=void 0,$(".webuploader-element-invisible").attr("accept","*"),$(".webuploader-element-invisible").attr("multiple","multiple"),l.key=="2"?$(".webuploader-element-invisible").attr("webkitdirectory",""):$(".webuploader-element-invisible").removeAttr("webkitdirectory"),$(".webuploader-element-invisible").trigger("click")},X=[{label:y,key:"1",icon:(0,n.jsx)(we.Z,{})},{label:O,key:"2",icon:(0,n.jsx)(we.Z,{})}],te={items:X,onClick:ee},ve=function(){var l=(0,U.Z)((0,R.Z)().mark(function b(f,j){var T,H,k,re,se;return(0,R.Z)().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(re=(f==null||(T=f.source)===null||T===void 0||(H=T.source)===null||H===void 0?void 0:H.fullPath)||(f==null||(k=f.source)===null||k===void 0?void 0:k.fullPath)||"",se=Ee(j,Me(re)),!se){L.next=8;break}return L.next=5,se;case 5:return L.abrupt("return",L.sent);case 8:return L.next=10,ae(j,Me(re));case 10:return L.abrupt("return",L.sent);case 11:case"end":return L.stop()}},b)}));return function(f,j){return l.apply(this,arguments)}}(),z=l=>{a({type:"common/addmkDir",payload:{name:l,sourceID:p.sourceID||0},callback:b=>{}})},ae=function(){var l=(0,U.Z)((0,R.Z)().mark(function b(f,j){var T,H,k,re,se,me,L,Oe,ze,Te;return(0,R.Z)().wrap(function(he){for(;;)switch(he.prev=he.next){case 0:T=0,H=0,k={},re=f,se=0,me=(0,ke.Z)(j);try{for(Oe=function(){var Ue=L.value,ge=re.find(Be=>(Be.oldName||Be.name)==Ue);ge||(ge={name:Ue,children:[]},T!==1&&(T++,H=se||0,k=ge),re.push(ge)),se=T!==1&&ge.sourceID,re=ge.children},me.s();!(L=me.n()).done;)Oe()}catch(Ne){me.e(Ne)}finally{me.f()}return he.next=9,Le([k],H);case 9:return ze=he.sent,Te=ir(H,ze,k,f),he.abrupt("return",Ee(Te,j));case 12:case"end":return he.stop()}},b)}));return function(f,j){return l.apply(this,arguments)}}(),De=l=>new Promise((b,f)=>{a({type:"common/addmkDir",payload:{name:l,sourceID:p.sourceID||0},callback:j=>{b(j.data)}})}),Le=(l,b)=>new Promise((f,j)=>{a({type:"common/addBatchDirectory",payload:{children:l,sourceID:b!==0?b:p.sourceID?p.sourceID:0},callback:T=>{f(T.data)}})}),nr={busType:"cloud",directoryId:B||o.sourceID,folderList:xe||[],notupload:!!(C&&!x||P),options:{auto:!0,chunkSize:2*1024*1024,duplicate:!1,pick:{multiple:window.newVersionId?void 0:!0},accept:{mimeTypes:"*",extensions:"doc,docx,rtf,xls,xlsx,ppt,pptx,wps,txt,md,htm,html,js,json,css,spl,xml,java,cs,svg,vsdu,jpg,jpeg,png,bmp,gif,ico,tiff,psd,ai,ofd,pdf,epub,skp,dwfx,fbx,rar,zip,7z,tar,tar.gz,gz,mp4,avi,m4v,mov,f4v,flv,ogv,webmv,pmg,rmvb,mp3,wav,aac,m4a,pga,ogg,webma,exe,msi,swf"},formData:{},fileNumLimit:1e4,fileSingleSizeLimit:window.ignoreFileSize?window.ignoreFileSize*1024*1024*1024:20*1024*1024*1024},events:{beforeFileQueued:l=>{if(window.newVersionId&&l.ext!==window.newVersionFileType&&window.newVersionFileType)return oe.Z.info({message:"".concat(r.formatMessage({id:"explorer.upload.errorExt"}))}),!1},fileQueued:l=>{},uploadSuccess:l=>{var b=l.response||{},f=b.data||{};window.filesboxUploadSuccess&&window.filesboxUploadSuccess(f),l.commonSourceId=f.sourceID,window.zipSourceId=f.sourceID?[f.sourceID]:[]},checkFinished:l=>{l.length=0},uploadFinished:l=>{t.getList(null,window.zipSourceId)},uploadComplete:l=>{}},onChange:(l,b)=>{t.clouduploadDom||(t.clouduploadDom=b);var f=l.filter(k=>!k.uploadStatus).slice(0,10),j=l.filter(k=>k.uploadStatus==3).slice(0,20),T=l.filter(k=>k.uploadStatus==1).slice(0,10),H=l.filter(k=>k.uploadStatus==2).slice(-30);t.setState({cloudfileList:[...T,...f,...j,...H]})},searchdirectoryId:z,treeList:t.state.treeList},lr=()=>{t.clouduploadDom&&t.setState({cloudfileList:t.clouduploadDom.getFiles()})};t.getFiles=lr;var vr=[r.formatMessage({id:"explorer.download.waiting"}),"",r.formatMessage({id:"explorer.upload.success"}),r.formatMessage({id:"explorer.upload.error"})];return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ae.Z,{open:i,modelZindex:K,setOpenModel:c,setModelZindex:F,type:"upload",title:(0,n.jsx)("span",{children:(0,n.jsx)(W._H,{id:"admin.index.fileUpload"})}),children:(0,n.jsxs)("div",{className:be().uploadBox,children:[(0,n.jsxs)("div",{className:"uploadBtns",children:[(0,n.jsx)(Qe,(0,le.Z)({},nr)),(0,n.jsx)("div",{className:"left",children:(0,n.jsxs)(q.Z.Button,{menu:te,placement:"bottomLeft",icon:(0,n.jsx)(rr.Z,{}),onClick:u,className:be().buttonBox,overlayStyle:{zIndex:2e3},children:[(0,n.jsx)(we.Z,{style:{fontSize:12}})," ",D]})}),t.renderRightMenu()]}),(0,n.jsx)("div",{style:{display:J.length?"":"none"},className:"uploadList",children:(0,n.jsx)(ar(),{children:(0,n.jsx)("div",{className:"bordrBox",children:(0,n.jsx)(N.ZP,{itemLayout:"horizontal",rowKey:"taskID",dataSource:this.state.cloudfileList,renderItem:l=>(0,n.jsxs)(N.ZP.Item,{children:[l.checksum&&l.uploadStatus==1?(0,n.jsx)("div",{className:"progress progress-striped active",children:(0,n.jsx)("div",{className:"progress-bar",style:{width:(0,ye.Fn)(l.uploadProgress)+"%"}})}):"",(0,n.jsxs)("div",{className:"uploadliflex",style:{display:"flex",overflow:"hidden",width:"100%"},children:[(0,n.jsx)("div",{title:l.name,style:{width:"35%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",padding:"0px 6px"},children:l.name}),(0,n.jsx)("div",{style:{width:"20%",padding:"0px 6px"},children:(0,ye.NR)(l.size)}),(0,n.jsx)("div",{style:{flex:1,overflow:"hidden",color:l.uploadStatus==3?"red":"#666",fontWeight:400},children:l.checksum?l.uploadStatus==3?r.formatMessage({id:"explorer.upload.error"}):l.uploadStatus==2?r.formatMessage({id:"explorer.upload.success"}):l.uploadStatus==1&&l.uploadProgress==1?"".concat(r.formatMessage({id:"common.verifyingmerging"}),"..."):"":"".concat(r.formatMessage({id:"common.fileverifying"})," : ").concat((0,ye.Fn)(l.md5Progress,2),"%")}),(0,n.jsxs)("div",{style:{paddingRight:8,fontWeight:400},children:[(0,n.jsx)("a",{style:{marginRight:8,display:l.uploadStatus==3?"":"none"},onClick:()=>{$(".webuploader-element-invisible").attr("accept","*"),window.filesboxUploader.retry(l)},children:"\u91CD\u4F20"}),(0,n.jsx)("a",{onClick:()=>{if(t.clouduploadDom){var b=t.clouduploadDom.getFiles(),f=b.filter(j=>j.id==l.id);t.clouduploadDom.removeFile(f[0],!0)}},children:r.formatMessage({id:"common.delete"})})]})]})]})})})})}),t.renderEmpty()]})})})}})||Ze)}}]);
|