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