"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[12303,80416],{57732:function(e,t,n){var r=n(26801),a=n.n(r),i=(n(59301),n(93314)),s=n(3113),o=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,r=void 0===n?{}:n,l=e.styles,c=void 0===l?{}:l,d=e.customText,u=e.ButtonText,m=e.ButtonClick,p=e.Buttonclass,h=e.ButtonTwo,f=e.imgStyles,x=e.loading,v=void 0!==x&&x;return(0,o.jsxs)("section",{className:"tc animated fadeIn",style:a()(a()({},{color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"}),c),children:[(0,o.jsx)("img",{src:t||i,style:a()({},f)}),(0,o.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,o.jsx)(s.ZP,a()(a()({className:p,onClick:m},r),{},{children:u})),h&&h]})}},78075:function(e,t,n){n.d(t,{Z:function(){return w}});var r=n(26801),a=n.n(r),i=n(10574),s=n.n(i),o=n(39343),l=n.n(o),c=n(11006),d=n.n(c),u=n(59301),m={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=n(3113),h=n(98915),f=n(55989),x=n(6848),v=n(85578),g=n(86018),_=n(57732),j=n(67871),y=n(37712),w=function(e){var t,n,r,i,o,c,w,k=e.editOffice,b=void 0===k?"view":k,S=e.data,Z=(e.theme,e.type),N=e.filename,I=e.monacoEditor,C=e.className,P=e.style,$=e.close,E=e.onClose,T=e.hasMask,O=e.disabledDownload,H=e.onImgDimensions,L=e.showNodata,W=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),A=d()(W,2),B=(A[0],A[1],(0,u.useState)("")),R=d()(B,2),F=(R[0],R[1]),z=(0,u.useState)(),M=d()(z,2),V=M[0],J=M[1],D="build"===window.ENV?"/react/build":"",G=location.host.startsWith("localhost")?j.Z.PROXY_SERVER:j.Z.API_SERVER;console.log("disabledDownload---",O);var X=(0,u.useRef)();null!==(t=S)&&void 0!==t&&t.startsWith("/api")&&"txt"!==Z&&(S=j.Z.API_SERVER+S),N&&(I.filename=N),(0,u.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&F(t[1])}))}),[]),(0,u.useEffect)((function(){"office"===Z&&U()}),[Z,S]);var U=function(){var e=l()(s()().mark((function e(){var t,n,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",S),t=S,S.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:n});case 6:r=e.sent,J(r);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){S.startsWith("http")||S.startsWith("blob:")?q():(0,v.Sv)(N||"educoder",S,N)},q=function(){(0,v.Nd)(N||"educoder",decodeURIComponent(S))};return console.log(S,"data"),(0,y.jsxs)("div",{style:a()({},P||{}),className:"".concat(T&&m.bgBlack," ").concat(Z?m.wrp:"hide"),children:[$&&(0,y.jsxs)("div",{className:m.close,ref:X,children:[!!H&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{onClick:function(){E(),H()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!O&&(0,y.jsx)(x.Z,{title:"点击下载此文件",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{onClick:q,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(x.Z,{title:"关闭",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{className:"",onClick:E,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(m[C]," ").concat(C," ").concat(m.monaco," ").concat("txt"===Z?"show":"hide"),children:"txt"===Z&&(0,y.jsx)(f.ZP,a()({},I))}),"audio"===Z&&(0,y.jsx)("audio",{src:(null===(n=S)||void 0===n?void 0:n.indexOf("http"))>-1||null!==(r=S)&&void 0!==r&&r.startsWith("/api")?S:"data:image/png;base64,".concat(S),autoPlay:!0}),"video"===Z&&(0,y.jsx)(y.Fragment,{children:(null===(i=S)||void 0===i?void 0:i.indexOf("http"))>-1||null!==(o=S)&&void 0!==o&&o.startsWith("/api")?(0,y.jsx)("video",{controls:!0,src:"".concat(S),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(S),autoPlay:!0})}),"office"===Z&&V&&(0,y.jsx)("iframe",{src:"".concat(D,"/office.html?key=").concat(V.key,"&url=").concat(G+V.url,"&callbackUrl=").concat(G+V.callbackUrl,"&fileType=").concat(V.fileType,"&title=").concat(V.title,"&model=").concat(b,"&officeServer=").concat(j.Z.ONLYOFFICE,"&disabledDownload=").concat(!!O)}),"html"===Z&&(0,y.jsx)("iframe",{src:S+"&disposition=inline"}),"pdf"===Z&&(0,y.jsx)("iframe",{src:"".concat(D,"/js/pdfview/index.html?url=").concat(S,"&disabledDownload=").concat(!!O)}),"image"===Z&&(0,y.jsx)("img",{src:(null===(c=S)||void 0===c?void 0:c.indexOf("http"))>-1||null!==(w=S)&&void 0!==w&&w.startsWith("/api")?S:"data:image/png;base64,".concat(S)}),("other"===Z||"download"===Z)&&(0,y.jsx)(y.Fragment,{children:L?(0,y.jsx)(_.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,y.jsx)(p.ZP,{icon:(0,y.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Y,children:"下载"})}):(0,y.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:Y,children:[(0,y.jsx)(h.Z,{}),"点击下载"]})})]})}},80416:function(e,t,n){n.d(t,{Z:function(){return M}});var r=n(26801),a=n.n(r),i=n(93923),s=n.n(i),o=n(98190),l=n.n(o),c=n(11006),d=n.n(c),u=n(59301),m=(n(31020),n(32834)),p=n.n(m),h=n(11690);var f=[],x=["