You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/85142.async.js

1 line
11 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[85142],{36579:function(e,n,t){t.d(n,{Z:function(){return k}});var a=t(42122),i=t.n(a),s=t(17061),c=t.n(s),o=t(17156),r=t.n(o),l=t(27424),u=t.n(l),d=t(67294),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},h=t(71577),f=t(77171),m=t(8691),v=t(83062),x=t(29427),g=t(51412),j=t(82982),b=t(59758),y=t(85893),k=function(e){e.editOffice;var n,t,a,s,o,l,k,S=e.data,w=(e.theme,e.type),_=e.filename,C=e.monacoEditor,Z=e.className,P=e.style,N=e.close,E=e.onClose,R=e.hasMask,F=e.disabledDownload,B=e.onImgDimensions,I=e.showNodata,T=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),V=u()(T,2),D=(V[0],V[1],(0,d.useState)("")),O=u()(D,2),W=(O[0],O[1]),L=(0,d.useState)(),A=u()(L,2),J=A[0],z=A[1],M="build"===window.ENV?"/react/build":"",q=location.host.startsWith("localhost")?b.Z.PROXY_SERVER:b.Z.API_SERVER,U=(0,d.useRef)();null!==(n=S)&&void 0!==n&&n.startsWith("/api")&&"txt"!==w&&(S=b.Z.API_SERVER+S),_&&(C.filename=_),(0,d.useEffect)((function(){var e,n,t=null===(e=document.cookie)||void 0===e||null===(n=e.replace(/\s/g,""))||void 0===n?void 0:n.split(";");null==t||t.map((function(e){var n=e.split("=");"_educoder_session"===n[0]&&W(n[1])}))}),[]),(0,d.useEffect)((function(){"office"===w&&X()}),[w,S]);var X=function(){var e=r()(c()().mark((function e(){var n,t,a;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=S,S.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=5,(0,g.gJ)({attachment_id:t});case 5:a=e.sent,z(a);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){H()},H=function(){(0,x.Nd)(_||"educoder",decodeURIComponent(S))};return(0,y.jsxs)("div",{style:i()({},P||{}),className:"".concat(R&&p.bgBlack," ").concat(w?p.wrp:"hide"),children:[N&&(0,y.jsxs)("div",{className:p.close,ref:U,children:[!!B&&(0,y.jsx)(v.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return U.current},children:(0,y.jsx)("span",{onClick:function(){E(),B()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!F&&(0,y.jsx)(v.Z,{title:"点击下载此文件",getPopupContainer:function(){return U.current},children:(0,y.jsx)("span",{onClick:H,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(v.Z,{title:"关闭",getPopupContainer:function(){return U.current},children:(0,y.jsx)("span",{className:"",onClick:E,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(p[Z]," ").concat(Z," ").concat(p.monaco," ").concat("txt"===w?"show":"hide"),children:"txt"===w&&(0,y.jsx)(m.ZP,i()({},C))}),"audio"===w&&(0,y.jsx)("audio",{src:(null===(t=S)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(a=S)&&void 0!==a&&a.startsWith("/api")?S:"data:image/png;base64,".concat(S),autoPlay:!0}),"video"===w&&(0,y.jsx)(y.Fragment,{children:(null===(s=S)||void 0===s?void 0:s.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"===w&&J&&(0,y.jsx)("iframe",{src:"https://preview.sysu.edu.cn/op/view.aspx?src=".concat(q+J.url)}),"html"===w&&(0,y.jsx)("iframe",{src:S+"&disposition=inline"}),"pdf"===w&&(0,y.jsx)("iframe",{src:"".concat(M,"/js/pdfview/index.html?url=").concat(S,"&disabledDownload=").concat(!!F)}),"image"===w&&(0,y.jsx)("img",{src:(null===(l=S)||void 0===l?void 0:l.indexOf("http"))>-1||null!==(k=S)&&void 0!==k&&k.startsWith("/api")?S:"data:image/png;base64,".concat(S)}),("other"===w||"download"===w)&&(0,y.jsx)(y.Fragment,{children:I?(0,y.jsx)(j.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,y.jsx)(h.ZP,{icon:(0,y.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:G,children:"下载"})}):(0,y.jsxs)(h.ZP,{type:"primary",size:"middle",onClick:G,children:[(0,y.jsx)(f.Z,{}),"点击下载"]})})]})}},97501:function(e,n,t){t.d(n,{h:function(){return x}});var a=t(42122),i=t.n(a),s=t(27424),c=t.n(s),o=t(67294),r=t(96101),l=t(91773),u=t(71577),d=t(4631),p=t.n(d),h=(t(71749),t(30483),t(85893)),f=r.Z.Option,m={labelCol:{span:4},wrapperCol:{span:20}},v={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function x(e){var n=e.value,t=e.onChange,a=e.mode,s=e.options,r=void 0===s?{}:s,l=(0,o.useRef)(),u=(0,o.useState)(),d=c()(u,2),f=d[0],m=d[1];return(0,o.useEffect)((function(){if(f){var e=function(e){var n=e.getValue();t&&t(n)};return f.on("change",e),function(){f.off("change",e)}}}),[f,t]),(0,o.useEffect)((function(){f&&f.setOption("mode",a)}),[f,a]),(0,o.useEffect)((function(){f&&(n===f.getValue()&&""!==n||setTimeout((function(){f.setValue(n||"")}),300))}),[f,n]),(0,o.useEffect)((function(){if(l.current&&!f){var e=p().fromTextArea(l.current,i()({mode:a,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},r));m(e)}}),[l.current,f]),(0,h.jsx)("div",{className:"my-codemirror-container",children:(0,h.jsx)("textarea",{ref:l})})}n.Z=function(e){var n=e.callback,t=e.onCancel,a=(0,o.useState)("python"),s=c()(a,2),d=s[0],p=s[1];return(0,h.jsxs)(l.Z,i()(i()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},children:[(0,h.jsx)(l.Z.Item,{label:"代码语言",name:"language",children:(0,h.jsx)(r.Z,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(v[e][1])},children:Object.keys(v).map((function(e){return(0,h.jsx)(f,{value:e,children:v[e][0]},e)}))})}),(0,h.jsx)(l.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,h.jsx)(x,{mode:d})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(u.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},39026:function(e,n,t){t.d(n,{Z:function(){return k}});var a=t(42122),i=t.n(a),s=t(17061),c=t.n(s),o=t(17156),r=t.n(o),l=t(27424),u=t.n(l),d=t(67294),p=t(88275),h=t(91773),f=t(2453),m=t(14446),v=t(11486),x="wrap___TwY3U",g="content___Ks95W",j="mainPathWrap___CrMaa",b="colorBlue___dvWbP",y=t(85893),k=(0,p.connect)((function(e){var n=e.shixunsDetail,t=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,loading:t.models.index}}))((function(e){var n=e.shixunsDetail,t=(e.globalSetting,e.loading,e.dispatch),a=e.title,s=e.pathList,o=void 0===s?[]:s,l=e.showInputPath,k=void 0!==l&&l,S=e.isMergeSelectFile,w=void 0!==S&&S,_=e.onFinish,C=void 0===_?function(){}:_,Z=h.Z.useForm(),P=u()(Z,1)[0],N=(0,p.useParams)(),E=(0,p.useLocation)(),R=(0,d.useRef)(),F=(0,d.useState)(""),B=u()(F,2),I=B[0],T=B[1],V=(0,d.useState)(""),D=u()(V,2),O=D[0],W=D[1],L=(0,d.useState)([]),A=u()(L,2),J=A[0],z=A[1],M=(0,d.useState)([]),q=u()(M,2),U=q[0],X=q[1];(0,d.useEffect)((function(){var e,n;R.current="repository"===(null===(e=E.pathname)||void 0===e||null===(n=e.split("/"))||void 0===n?void 0:n[3])}),[]),(0,d.useEffect)((function(){if("Repository-SelectFilePath"===n.actionTabs.key){var e=o.join("/"),t=[];o.map((function(n,a){0===a?t.push({val:"根目录",path:""},{val:"/".concat(n),path:e}):t.push({val:"/".concat(n),path:e})})),z(t),T(e),W(e),G(e)}}),[n.actionTabs.key]);var G=function(){var e=r()(c()().mark((function e(n){var a;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({type:R.current?"shixunsDetail/getRepository":"shixunsDetail/getSecretRepository",payload:{id:N.id,path:n}});case 2:(a=e.sent)&&X(a.trees||[]);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),H=function(){var e=r()(c()().mark((function e(){var n,a,s;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null==P?void 0:P.getFieldsValue(),a=I?"".concat(I).concat(null!=n&&n.name?"/".concat(null==n?void 0:n.name):""):null==n?void 0:n.name,!w){e.next=6;break}return C(a),Y(),e.abrupt("return");case 6:if(!k){e.next=16;break}return e.next=9,P.validateFields();case 9:return e.next=11,t({type:"shixunsDetail/uploadGitFolder",payload:i()(i()({},{id:N.id,path:a}),R.current?{}:{secret_repository:!0})});case 11:s=e.sent,C(O),0===s.status&&f.ZP.info("新建成功"),e.next=18;break;case 16:C(a),f.ZP.success("选择文件目录成功");case 18:Y();case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){t({type:"shixunsDetail/setActionTabs",payload:{}}),P.resetFields()};return(0,y.jsx)(m.Z,{centered:!0,title:a||"新建文件夹",closable:!1,keyboard:!1,open:"Repository-SelectFilePath"===n.actionTabs.key,onOk:H,onCancel:Y,children:(0,y.jsxs)("div",{className:x,children:[(0,y.jsxs)("div",{className:g,children:[(0,y.jsx)("div",{className:j,children:!(null==J||!J.length)&&J.map((function(e,n){return(0,y.jsx)("a",{onClick:function(){return function(e,n){var t=J.filter((function(e,t){return t<=n}));z(t);var a=t.filter((function(e,n){return 0!==n})).map((function(e){return e.val})).join("").substr(1);T(a),G(a)}(0,n)},children:e.val},n)}))}),!(null==U||!U.length)&&U.map((function(e,n){return"tree"===e.type&&(0,y.jsxs)("a",{onClick:function(){return function(e){var n=I;"tree"===e.type&&(J.length?J.push({val:"/".concat(e.name),path:e.name}):J.push({val:"根目录",path:""},{val:"/".concat(e.name),path:e.name}),z(J),n=I?"".concat(I,"/").concat(e.name):e.name,T(n)),G(n)}(e)},children:[(0,y.jsx)("i",{className:"iconfont icon-wenjianjia ".concat(b)}),e.name]},n)}))]}),(0,y.jsx)("label",{className:"mt5",children:"选中的新建文件夹目录:"}),(0,y.jsx)("div",{className:"mt5 mb5",children:I}),k&&(0,y.jsx)(h.Z,{form:P,scrollToFirstError:!0,className:"mt20",children:(0,y.jsx)(h.Z.Item,{name:"name",rules:[{required:!0,message:"请输入名称"},{whitespace:!0,message:"请勿输入空格"}],children:(0,y.jsx)(v.Z,{placeholder:"请输入新文件夹名/子文件夹名。src/step1"})})})]})})}))}}]);