filesbox/web/dist/81025.22689b67.async.js
2024-07-26 14:10:54 +08:00

2 lines
7.0 KiB
JavaScript

(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[81025],{30537:function(E){E.exports={ConvertFileModalbox:"ConvertFileModalbox___1poC3",selectConvertbox:"selectConvertbox___iXfMm"}},81025:function(E,N,a){"use strict";a.r(N),a.d(N,{default:function(){return G}});var oe=a(34792),Z=a(48086),ne=a(34669),p=a(54458),ie=a(74379),x=a(38648),de=a(57663),u=a(71577),ce=a(43358),F=a(34041),R=a(34895),S=a(28216),t=a(30672),$=a(67294),k=a(30537),l=a.n(k),X=a(69847),z=a(37406),e=a(85893),D,P,G=(D=(0,S.$j)(O=>{var o=O.common;return{common:o}}),D(P=class extends $.PureComponent{constructor(){super(...arguments);this.state={modelZindex:100,fullScreen:!1,current:1,total:0,target:{},getInfoLoading:!0,viewUrl:"",taskId:(0,z.fW)(),psddom:"",postName:"",convertFileType:"doc",options:[]}}componentDidMount(){var o=this,s=o.props,g=s.dispatch,I=s.common,T=s.open,_=s.setOpenModel,H=s.videoOption,U=s.issmall,J=s.path,b=s.name,Q=s.showIndex,h=s.saveParams,M=h===void 0?{}:h,V=s.okBtn,Y=s.mask,j=s.convertparams,f=j===void 0?{}:j,v=s.sourceID,n=f.fileType,i=[],C="pdf";n=="jpg"||n=="png"?i=[{value:"pdf",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxpdf"}),(0,e.jsx)("div",{className:"selecttext",children:" pdf "})," "]})}]:n=="doc"||n=="docx"?i=[{value:"pdf",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxpdf"}),(0,e.jsx)("div",{className:"selecttext",children:" pdf "})," "]})},{value:"jpg",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxjpg"}),(0,e.jsx)("div",{className:"selecttext",children:" jpg "})," "]})},{value:"png",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxpng"}),(0,e.jsx)("div",{className:"selecttext",children:" png "})," "]})}]:n=="ppt"||n=="pptx"?i=[{value:"pdf",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxpdf"}),(0,e.jsx)("div",{className:"selecttext",children:" pdf "})," "]})},{value:"jpg",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxjpg"}),(0,e.jsx)("div",{className:"selecttext",children:" jpg "})," "]})},{value:"png",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxpng"}),(0,e.jsx)("div",{className:"selecttext",children:" png "})," "]})}]:n=="pdf"&&(i=[{value:"doc",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxdoc"}),(0,e.jsx)("div",{className:"selecttext",children:" doc "})," "]})},{value:"docx",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxdocx"}),(0,e.jsx)("div",{className:"selecttext",children:" docx "})," "]})},{value:"jpg",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxjpg"}),(0,e.jsx)("div",{className:"selecttext",children:" jpg "})," "]})},{value:"png",label:(0,e.jsxs)("div",{className:l().selectConvertbox,children:[(0,e.jsx)("div",{className:"boxpng"}),(0,e.jsx)("div",{className:"selecttext",children:" png "})," "]})}],C="doc"),o.setState({options:i,convertFileType:C})}componentWillUnmount(){var o=this}render(){var o=this,s=o.props,g=s.dispatch,I=s.common,T=s.open,_=s.setOpenModel,H=s.videoOption,U=s.issmall,J=s.path,b=s.name,Q=s.fileType,h=s.showIndex,M=s.saveParams,V=M===void 0?{}:M,Y=s.okBtn,j=s.mask,f=s.convertparams,v=f===void 0?{}:f,n=s.sourceID,i=s.getListPath,C=I.shareCode,c=this.state,w=c.modelZindex,re=c.fullScreen,ve=c.getInfoLoading,y=c.taskId,me=c.postName,K=c.convertFileType,L=c.options,q=L===void 0?[]:L,d=(0,t.lw)((0,t.Kd)()),ee=r=>{o.setState({modelZindex:r})};return(0,e.jsx)(R.Z,{open:T,issmall:U,modelZindex:w,setOpenModel:_,setModelZindex:ee,type:"convertFile",showIndex:h,mask:j,title:b,children:(0,e.jsx)("div",{className:l().ConvertFileModalbox,children:(0,e.jsxs)("div",{className:"Transcoding",children:[(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:(0,t.Kd)()=="en-US"?"File Name":"\u6587\u4EF6\u540D\u79F0"}),(0,e.jsx)("div",{className:"cropright",children:v.name})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:(0,t.Kd)()=="en-US"?"Size":"\u6587\u4EF6\u5927\u5C0F"}),(0,e.jsx)("div",{className:"cropright",children:(0,X.lX)(v.size)})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:(0,t.Kd)()=="en-US"?"Format":"\u6587\u4EF6\u7C7B\u578B"}),(0,e.jsx)("div",{className:"cropright",children:v.fileType})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:(0,t.Kd)()=="en-US"?"Convert to...":"\u8F6C\u6362\u4E3A..."}),(0,e.jsx)("div",{className:"cropright",children:(0,e.jsx)(F.Z,{placeholder:d.formatMessage({id:"common.select"}),style:{width:"100%"},value:K,onChange:r=>{o.setState({convertFileType:r})},options:q})})]}),(0,e.jsxs)("div",{className:"submitbox",children:[(0,e.jsx)(u.Z,{onClick:()=>{_(!1,"visible")},children:d.formatMessage({id:"common.cancel"})}),(0,e.jsx)(u.Z,{onClick:()=>{g({type:"common/docconvert",payload:{sourceID:n,sourceIDTo:v.parentID||0,suffix:K,taskID:y},callback:r=>{if(r.success){_(!1,"visible");var B=r.data||{},se=B.progress||0,ae=B.status||0,m=y;ae==0?(x.Z.info({message:d.formatMessage({id:"common.tips"}),key:m,description:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{children:[" ",(0,t.Kd)()=="en-US"?"File transcoding, please wait...":"\u6587\u4EF6\u8F6C\u7801\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."]})," ",(0,e.jsx)("div",{children:(0,e.jsx)(p.Z,{percent:se})})]}),duration:100}),window.ConverttaskTimer&&clearInterval(window.ConverttaskTimer),window.ConverttaskTimer=setInterval(function(){g({type:"common/getConverttaskAction",payload:{taskID:m},callback:W=>{if(W.success){var A=W.data||{},le=A.status||0,te=parseInt(A.progress||0);le?(window.ConverttaskTimer&&clearInterval(window.ConverttaskTimer),x.Z.success({message:d.formatMessage({id:"common.tips"}),key:m,description:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{children:[" ",(0,t.Kd)()=="en-US"?"File transcoding successful":"\u6587\u4EF6\u8F6C\u7801\u6210\u529F"]})," ",(0,e.jsx)("div",{children:(0,e.jsx)(p.Z,{percent:100})})]}),duration:4.5}),i()):x.Z.info({message:d.formatMessage({id:"common.tips"}),key:m,description:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{children:[" ",(0,t.Kd)()=="en-US"?"File transcoding, please wait...":"\u6587\u4EF6\u8F6C\u7801\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."]})," ",(0,e.jsx)("div",{children:(0,e.jsx)(p.Z,{percent:te})})]}),duration:100})}}})},1500)):(x.Z.success({message:d.formatMessage({id:"common.tips"}),key:m,description:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{children:[" ",(0,t.Kd)()=="en-US"?"File transcoding successful":"\u6587\u4EF6\u8F6C\u7801\u6210\u529F"]})," ",(0,e.jsx)("div",{children:(0,e.jsx)(p.Z,{percent:100})})]}),duration:4.5}),i())}else Z.ZP.error(d.formatMessage({id:r.code}))}})},type:"primary",children:d.formatMessage({id:"common.ok"})})]})]})})})}})||P)}}]);