"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[75816,44132],{22845:function(e,n,t){var i=t(82242),a=t.n(i),l=(t(59301),t(19779)),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,f=e.Buttonclass,m=e.ButtonTwo,h=e.imgStyles,_=e.loading,v=void 0!==_&&_;return(0,o.jsxs)("section",{className:"tc animated fadeIn",style:a()(a()({},{color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"}),s),children:[(0,o.jsx)("img",{src:n||l,style:a()({width:288,height:200},h)}),(0,o.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,o.jsx)(r.ZP,a()(a()({className:f,onClick:p},i),{},{children:d})),m&&m]})}},64173:function(e,n,t){t.d(n,{Z:function(){return j}});var i=t(82242),a=t.n(i),l=t(7557),r=t.n(l),o=t(41498),c=t.n(o),s=t(79800),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"},f=t(3113),m=t(74516),h=t(80304),_=t(6848),v=t(76279),y=t(77884),x=t(22845),g=t(68339),b=t(37712),j=function(e){var n,t,i,l,o,s,j,k=e.editOffice,A=void 0===k?"view":k,w=e.data,Z=(e.theme,e.type),N=e.filename,C=e.monacoEditor,F=e.className,I=e.style,S=e.close,E=e.onClose,T=e.hasMask,P=e.disabledDownload,D=e.onImgDimensions,B=e.showNodata,V=(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()(V,2),R=(O[0],O[1],(0,d.useState)("")),L=u()(R,2),W=(L[0],L[1]),q=(0,d.useState)(),K=u()(q,2),M=K[0],G=K[1],U="build"===window.ENV?"/react/build":"",Y=location.host.startsWith("localhost")?g.Z.PROXY_SERVER:g.Z.API_SERVER;console.log("disabledDownload---",P);var H=(0,d.useRef)();null!==(n=w)&&void 0!==n&&n.startsWith("/api")&&"txt"!==Z&&(w=g.Z.API_SERVER+w),N&&(C.filename=N),(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]&&W(n[1])}))}),[]),(0,d.useEffect)((function(){"office"===Z&&Q()}),[Z,w]);var Q=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,y.gJ)({attachment_id:t});case 6:i=e.sent,G(i);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),z=function(){w.startsWith("http")||w.startsWith("blob:")?J():(0,v.Sv)(N||"educoder",w,N)},J=function(){(0,v.Nd)(N||"educoder",decodeURIComponent(w))};return console.log(w,"data"),(0,b.jsxs)("div",{style:a()({},I||{}),className:"".concat(T&&p.bgBlack," ").concat(Z?p.wrp:"hide"),children:[S&&(0,b.jsxs)("div",{className:p.close,ref:H,children:[!!D&&(0,b.jsx)(_.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return H.current},children:(0,b.jsx)("span",{onClick:function(){E(),D()},children:(0,b.jsx)("i",{className:"icon-yulanpizhu"})})}),!P&&(0,b.jsx)(_.Z,{title:"点击下载此文件",getPopupContainer:function(){return H.current},children:(0,b.jsx)("span",{onClick:J,children:(0,b.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,b.jsx)(_.Z,{title:"关闭",getPopupContainer:function(){return H.current},children:(0,b.jsx)("span",{className:"",onClick:E,children:(0,b.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,b.jsx)("div",{className:"".concat(p[F]," ").concat(F," ").concat(p.monaco," ").concat("txt"===Z?"show":"hide"),children:"txt"===Z&&(0,b.jsx)(h.ZP,a()({},C))}),"audio"===Z&&(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"===Z&&(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"===Z&&M&&(0,b.jsx)("iframe",{src:"".concat(U,"/office.html?key=").concat(M.key,"&url=").concat(Y+M.url,"&callbackUrl=").concat(Y+M.callbackUrl,"&fileType=").concat(M.fileType,"&title=").concat(M.title,"&model=").concat(A,"&officeServer=").concat(g.Z.ONLYOFFICE,"&disabledDownload=").concat(!!P)}),"html"===Z&&(0,b.jsx)("iframe",{src:w+"&disposition=inline"}),"pdf"===Z&&(0,b.jsx)("iframe",{src:"".concat(U,"/js/pdfview/index.html?url=").concat(w,"&disabledDownload=").concat(!!P)}),"image"===Z&&(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"===Z||"download"===Z)&&(0,b.jsx)(b.Fragment,{children:B?(0,b.jsx)(x.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,b.jsx)(f.ZP,{icon:(0,b.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:z,children:"下载"})}):(0,b.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:z,children:[(0,b.jsx)(m.Z,{}),"点击下载"]})})]})}},44132:function(e,n,t){t.d(n,{Z:function(){return K}});var i=t(82242),a=t.n(i),l=t(37205),r=t.n(l),o=t(91232),c=t.n(o),s=t(79800),u=t.n(s),d=t(59301),p=(t(19546),t(32834)),f=t.n(p),m=t(11690);var h=[],_=["