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.
1 line
30 KiB
1 line
30 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[15402],{90921:function(e,t,n){var a=n(82242),r=n.n(a),c=(n(59301),n(93314)),s=n(3113),i=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,a=void 0===n?{}:n,l=e.styles,o=void 0===l?{}:l,u=e.customText,d=e.ButtonText,p=e.ButtonClick,f=e.Buttonclass,_=e.ButtonTwo,h=e.imgStyles,m=e.loading,x=void 0!==m&&m;return(0,i.jsxs)("section",{className:"tc animated fadeIn",style:r()(r()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),o),children:[(0,i.jsx)("img",{src:t||c,style:r()(r()({},h),{},{pointerEvents:"none",userSelect:"none"})}),(0,i.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,i.jsx)(s.ZP,r()(r()({className:f,onClick:p},a),{},{children:d})),_&&_]})}},59472:function(e,t,n){n.d(t,{Z:function(){return w}});var a=n(82242),r=n.n(a),c=n(7557),s=n.n(c),i=n(41498),l=n.n(i),o=n(79800),u=n.n(o),d=n(59301),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=n(3113),_=n(74516),h=n(17968),m=n(6848),x=n(26795),v=n(44239),g=n(90921),b=n(17985),j=n(13405),y=n(37712),w=function(e){var t,n,a,c,i,o,w=e.editOffice,k=void 0===w?"view":w,N=e.data,Z=(e.theme,e.type),S=e.filename,E=e.monacoEditor,A=e.className,I=e.style,C=e.close,T=e.onClose,P=e.hasMask,D=e.disabledDownload,L=e.onImgDimensions,R=e.showNodata,O=e.recordInfo,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"),W=u()(V,2),M=(W[0],W[1],(0,d.useState)("")),z=u()(M,2),F=(z[0],z[1]),H=(0,d.useState)(),B=u()(H,2),J=B[0],G=B[1],q="build"===window.ENV?"/react/build":"",U=location.host.startsWith("localhost")?b.Z.PROXY_SERVER:b.Z.API_SERVER,X=(0,d.useRef)();null!==(t=N)&&void 0!==t&&t.startsWith("/api")&&"txt"!==Z&&(N=b.Z.API_SERVER+N);S&&(E.filename=S),(0,d.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,d.useEffect)((function(){var e;"office"===Z&&(N.indexOf("bigfilescdn.")>-1||N.indexOf("bigfiles1")>-1?G({url:N,fileType:(e=N,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:N.indexOf("model=edit")?"edit":"view"}):K())}),[Z,N]);var K=function(){var e=l()(s()().mark((function e(){var t,n,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",N),t=N,N.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,v.gJ)({attachment_id:n});case 6:(a=e.sent).url=U+a.url,G(a);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){N.startsWith("http")||N.startsWith("blob:")?Y():(0,x.Sv)(S||"educoder",N,S)},Y=function(){O&&(0,j.fc)({id:null==O?void 0:O.id,watch_type:1,course_id:null==O?void 0:O.course_id}),(0,x.Nd)(S||"educoder",decodeURIComponent(N))};return(0,y.jsxs)("div",{style:r()({},I||{}),className:"".concat(P&&p.bgBlack," ").concat(Z?p.wrp:"hide"),children:[C&&(0,y.jsxs)("div",{className:p.close,ref:X,children:[!!L&&(0,y.jsx)(m.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{onClick:function(){T(),L()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!D&&(0,y.jsx)(m.Z,{title:"点击下载此文件",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{onClick:Y,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(m.Z,{title:"关闭",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{className:"",onClick:T,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(p[A]," ").concat(A," ").concat(p.monaco," ").concat("txt"===Z?"show":"hide"),children:"txt"===Z&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(h.ZP,r()({},E))})}),"audio"===Z&&(0,y.jsx)("audio",{src:"".concat((null===(n=N)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(a=N)||void 0===a?void 0:a.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(N),autoPlay:!0}),"video"===Z&&(0,y.jsx)(y.Fragment,{children:(null===(c=N)||void 0===c?void 0:c.indexOf("http"))>-1?(0,y.jsx)("video",{controls:!0,src:"".concat(N),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(N),autoPlay:!0})}),"office"===Z&&J&&(0,y.jsx)("iframe",{src:"".concat(q,"/office.html?key=").concat(J.key,"&url=").concat(btoa(J.url),"&callbackUrl=").concat(U+J.callbackUrl,"&fileType=").concat(J.fileType,"&title=").concat(J.title,"&model=").concat(k,"&officeServer=").concat(b.Z.ONLYOFFICE,"&disabledDownload=").concat(!!D)}),"html"===Z&&(0,y.jsx)("iframe",{src:N+"&disposition=inline"}),"pdf"===Z&&(0,y.jsx)("iframe",{src:"".concat(q,"/js/pdfview/index.html?url=").concat(encodeURIComponent(N),"&disabledDownload=").concat(!!D)}),"image"===Z&&(0,y.jsx)("img",{src:"".concat((null===(i=N)||void 0===i?void 0:i.indexOf("http://"))>-1||(null===(o=N)||void 0===o?void 0:o.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(N)}),("other"===Z||"download"===Z)&&(0,y.jsx)(y.Fragment,{children:R?(0,y.jsx)(g.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,y.jsx)(f.ZP,{icon:(0,y.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:$,children:"下载"})}):(0,y.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:$,children:[(0,y.jsx)(_.Z,{}),"点击下载"]})})]})}},90277:function(e,t,n){n.d(t,{z:function(){return y}});var a=n(82242),r=n.n(a),c=n(37205),s=n.n(c),i=n(91232),l=n.n(i),o=n(79800),u=n.n(o),d=n(59301),p=(n(92436),n(44728)),f=(n(64018),n(77373)),_=n(17985),h=n(26795),m=n(15342),x=n(1012),v=n(59472),g=n(37712),b="@▁@",j=/<pre[^>]*>/g;var y=function(e,t){e=e||"";var n=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return t?e.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(n,(function(e,t,n,a,r,c,s){var i=t||a||c,l=n||r||s||"?";return _.Z.API_SERVER+"/api/attachments/"+i+l+"&t="+(0,h.Jn)(i,Date.now())+(e.indexOf(")")>-1?")":"&")})).replaceAll('src="(','src="').replaceAll("src='(",'src="'):e=e.replace(n,(function(e,t,n,a,r,c,s){var i=t||a||c,l=n||r||s||"?";return _.Z.API_SERVER+"/api/attachments/"+i+l+"&t="+(0,h.Jn)(i,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,a,r){var c=t||a,s=n||r||"";return'"'+_.Z.API_SERVER+"/api/attachments/"+c+s+c+s+"&t="+(0,h.Jn)(c,Date.now())})).replace(/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,a,r){var c=t||a,s=n||r||"";return"("+_.Z.API_SERVER+"/files/uploads/"+c+s+c+s+"&t="+(0,h.Jn)(c,Date.now())})).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")};t.Z=function(e){var t=e.value,n=void 0===t?"":t,a=e.className,c=e.showTextOnly,i=e.showLines,o=e.style,h=void 0===o?{}:o,y=e.stylesPrev,w=void 0===y?{}:y,k=e.highlightKeywords,N=e.showProgramFill,Z=(e.isProgramFill,e.disabledFill),S=void 0!==Z&&Z,E=e.programFillValue,A=e.onFillChange,I=void 0===A?function(e){}:A,C=e.onFillBlur,T=void 0===C?function(){}:C,P=String(n),D=(0,d.useState)(""),L=u()(D,2),R=L[0],O=L[1],V=(0,d.useState)("office"),W=u()(V,2),M=W[0],z=W[1],F=(0,d.useState)([]),H=u()(F,2),B=H[0],J=H[1],G=(0,d.useRef)("a"+(0,x.Z)()),q={};var U=function(e){return e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,t){var n=t.replace(/(\n|\r)/g,"").split("}"),a=[];return n.map((function(e){""!=e&&a.push(".".concat(G.current," ").concat(e))})),"<style>".concat(a.join("}"),"</style>")}))},X=(0,d.useMemo)((function(){try{P=P.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+_.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+_.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+_.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")}catch(e){}if(N){var e=-1;return P=P.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(t,n,a){var r;return function(e,t,n){var a=document.createElement(e===b?"input":"textarea");a.style.width="100%",a.style.height=e===b?"40px":"151px",a.rows=5,a.spellcheck=!1,a.name="edu-program-fill",a.placeholder="请输入",a.dataset.id=t;var r=Object.keys(q).length;return q[r]=a,'<span class="edu-program-fill-wrap '.concat(e===b?"":"show",'" style="width:').concat(e===b?"400px":"100%",'" title=').concat(n||"","><span>").concat(a.outerHTML,'<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>')}(t,++e,null==E||null===(r=E[e])||void 0===r?void 0:r.value)})),'<pre style="background:#fff;padding:4px">'.concat(U(P||""),"</pre>")}var t=U(P);t=(0,p.ZP)(t);var n=(0,p.ez)();P.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",(0,p.Qv)()),(0,p.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var a=n[t],r=a.type,c=a.expression;return(0,m.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(c)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,p.AL)();var a=document.createElement("div");return a.innerHTML=t,c?a.innerText:k?(Y(a,k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a.innerHTML):(setTimeout((function(){return te()}),500),a.innerHTML)}),[P,k]);(0,d.useEffect)((function(){Q.current&&Q.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=K,e.onblur=$}))}),[B]),(0,d.useEffect)((function(){if(null!=E&&E.length)try{var e,t=Q.current.querySelectorAll(".edu-program-fill-score"),n=Q.current.querySelectorAll('[name="edu-program-fill"]'),a=l()(n.entries());try{for(a.s();!(e=a.n()).done;){var r,c,s,i=u()(e.value,2),o=i[0],d=i[1];d.value=(null==E||null===(r=E[o])||void 0===r?void 0:r.value)||"","warning"===(null==E||null===(c=E[o])||void 0===c?void 0:c.type)?d.className="program-fill-warning":"success"===(null==E||null===(s=E[o])||void 0===s?void 0:s.type)?d.className="program-fill-success":d.className=""}}catch(e){a.e(e)}finally{a.f()}var p,f=l()(t.entries());try{for(f.s();!(p=f.n()).done;){var _,h,m=u()(p.value,2),x=m[0];m[1].innerHTML=null!=E&&null!==(_=E[x])&&void 0!==_&&_.score?"".concat(null==E||null===(h=E[x])||void 0===h?void 0:h.score,"分"):""}}catch(e){f.e(e)}finally{f.f()}J(E)}catch(e){console.log(e,"error")}}),[E]);var K=function(e){B[e.target.dataset.id]=B[e.target.dataset.id]||{},B[e.target.dataset.id].value=e.target.value,J(s()(B)),I(B,e.target.dataset.id)},$=function(e){B[e.target.dataset.id]=B[e.target.dataset.id]||{},B[e.target.dataset.id].value=e.target.value,J(s()(B)),T(B,e.target.dataset.id)};function Y(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)Y(e,t);else if("IMG"!==e.nodeName)if(e.innerHTML){var n;e.innerHTML=null===(n=e.innerHTML)||void 0===n?void 0:n.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var a=document.createElement("span");a.innerHTML=e.textContent.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(a)}}))}var Q=(0,d.useRef)();function ee(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),O(n),z("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),O(n),z("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),O(n),z("html");else if(n.startsWith("#")){e.preventDefault();var a=document.getElementById(n.replace("#",""));a&&a.scrollIntoView(!0)}}}p.jb.WebkitLineClamp=i,i&&(h=r()(r()({},h),p.jb));var te=function(){var e,t=null===(e=Q.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(f.ZP.isSupported()){var t=new f.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};return(0,d.useEffect)((function(){if(Q.current&&X&&X.match(j)&&window.PR.prettyPrint(),Q.current)return Q.current.addEventListener("click",ee),function(){var e;null===(e=Q.current)||void 0===e||e.removeEventListener("click",ee),(0,p.AL)(),(0,p.Iy)()}}),[X,Q.current,ee]),(0,g.jsxs)(g.Fragment,{children:[c&&(0,g.jsx)("div",{ref:Q,children:X}),!c&&(0,g.jsx)("div",{ref:Q,style:r()({},h),className:"".concat(a||""," ").concat(S?"disabled-fill":""," markdown-body ").concat(G.current),dangerouslySetInnerHTML:{__html:X}}),(0,g.jsx)(v.Z,{close:!0,data:R,type:null!=R&&R.length?M:"",style:r()({},w),onClose:function(){return O("")}})]})}},31063:function(e,t,n){n.r(t),n.d(t,{default:function(){return I}});var a=n(7557),r=n.n(a),c=n(41498),s=n.n(c),i=n(82242),l=n.n(i),o=n(79800),u=n.n(o),d=n(59301),p=n(65233),f=n(66104),_=n(43418),h=n(99313),m=n(26795),x=n(86065),v=n(17985),g=n(90277),b=n(99232),j=n.n(b),y={flex_box_center:"flex_box_center___dn0xX",flex_space_between:"flex_space_between___JlcX8",flex_box_vertical_center:"flex_box_vertical_center___PGWCu",flex_box_center_end:"flex_box_center_end___sRxxV",flex_box_column:"flex_box_column___WPwan",top:"top___arr9I",desc:"desc___tW8Wt",liked:"liked___Bq9NY",likedActive:"likedActive___XzpPk",reply:"reply___12llT",replyList:"replyList___NJsYv",comment:"comment___RWWH5",headpic:"headpic___v_77H"},w=n(37712);j().locale("ZH-cn");var k=(0,p.connect)((function(e){return{userDetail:e.userDetail}}))((function(e){var t,n=e.userDetail,a=(e.dispatch,(0,p.useParams)()),r=(0,p.useLocation)();(0,d.useEffect)((function(){var e;a.type=null===(e=r.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[6]}),[r.pathname]);var c=n.homeworkBanksDetail;return(0,w.jsx)("section",{className:y.bg,children:(0,w.jsx)("section",{className:"",children:(0,w.jsxs)("aside",{className:[y.desc,"c-black","font14","bg-white"].join(" "),children:["编辑作业"!==n.actionTabs.key&&(0,w.jsx)(g.Z,{value:(null==c?void 0:c.description)||"暂无~"}),null==c||null===(t=c.attachments)||void 0===t?void 0:t.map((function(e,t){return(0,w.jsx)("div",{children:(0,w.jsxs)("a",{href:"".concat(v.Z.API_SERVER).concat(e.url),children:[(0,w.jsx)("span",{className:"iconfont icon-fujian c-green font14"}),(0,w.jsx)("span",{className:"ml10 c-black",children:e.title}),(0,w.jsx)("span",{className:"c-light-black ml20 font12",children:e.filesize})]})})})),"group"===a.type&&(0,w.jsxs)(w.Fragment,{children:[(c.min_num||c.max_num)&&(0,w.jsxs)("div",{className:"mt10",children:[(0,w.jsx)("span",{className:"c-grey-666",children:"分组要求:"}),(0,w.jsxs)("span",{className:"c-black-051",children:[c.min_num,"~ ",c.max_num," 人(学生提交作品时需要关联同组成员,组内成员作品共享)"]})]}),c.base_on_project?(0,w.jsxs)("p",{children:[(0,w.jsx)("span",{className:"c-grey-666",children:"基于项目实施"}),(0,w.jsx)("span",{className:"c-black-051",children:"(学生必须在本平台创建项目,项目管理员可以提交作品)"})]}):(0,w.jsxs)("p",{children:[(0,w.jsx)("span",{className:"c-grey-666",children:"不基于项目"}),(0,w.jsx)("span",{className:"c-black-051",children:"(无需在平台创建项目,任意小组成员均可以提交作品)"})]})]})]})})})})),N=n(90921),Z={flex_box_center:"flex_box_center___ukees",flex_space_between:"flex_space_between___PHPo4",flex_box_vertical_center:"flex_box_vertical_center___MgEzw",flex_box_center_end:"flex_box_center_end___owDkz",flex_box_column:"flex_box_column____I7hO",top:"top___DHLWM",desc:"desc___JJR8P",liked:"liked___knpCw",likedActive:"likedActive___KPZCk",reply:"reply___n7kXe",replyList:"replyList___MVu52",comment:"comment___Leq7e",headpic:"headpic___HL9zI"};j().locale("ZH-cn");var S=(0,p.connect)((function(e){return{userDetail:e.userDetail}}))((function(e){var t,n,a=e.userDetail,r=(e.dispatch,a.homeworkBanksDetail);return(0,w.jsx)("section",{className:Z.bg,children:(0,w.jsx)("section",{className:"",children:(0,w.jsx)("aside",{className:[Z.desc,"c-black","font14","bg-white"].join(" "),children:null!=r&&r.reference_answer||null!=r&&null!==(t=r.reference_attachments)&&void 0!==t&&t.length?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(g.Z,{value:(null==r?void 0:r.reference_answer)||""}),null==r||null===(n=r.reference_attachments)||void 0===n?void 0:n.map((function(e,t){return(0,w.jsx)("div",{children:(0,w.jsxs)("a",{href:"".concat(v.Z.API_SERVER).concat(e.url),children:[(0,w.jsx)("span",{className:"iconfont icon-fujian c-green font14"}),(0,w.jsx)("span",{className:"ml10 c-black",children:e.title}),(0,w.jsx)("span",{className:"c-light-black ml20 font12",children:e.filesize})]})})}))]}):(0,w.jsx)(N.Z,{})})})})})),E={flex_box_center:"flex_box_center___vHDeL",flex_space_between:"flex_space_between___rLrGx",flex_box_vertical_center:"flex_box_vertical_center___iGSf0",flex_box_center_end:"flex_box_center_end___mqG_2",flex_box_column:"flex_box_column___x9EJv",title:"title___LcvG_",export:"export___M5wlK",bg:"bg___XfKxA",tabs:"tabs___esytV"},A=n(55548),I=(0,p.connect)((function(e){return{userDetail:e.userDetail,loading:e.loading.effects}}))((function(e){var t=e.userDetail,n=e.dispatch,a=e.history,c=(0,p.useSearchParams)(),i=u()(c,1)[0],o=(0,p.useParams)(),v=(0,p.useLocation)(),g=(0,d.useState)(i.get("tabs")||0),b=u()(g,2),j=b[0],y=(b[1],t.homeworkBanksDetail);(0,d.useEffect)((function(){var e;o.type=null===(e=v.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[6],n({type:"userDetail/getHomeworkBanksDetail",payload:l()({},o)})}),[o.topicId,v.pathname]);var N=[{name:"内容详情",id:0,compontent:(0,w.jsx)("div",{className:"minH500",children:(0,w.jsx)(k,{})})},{name:"参考答案",id:1,compontent:(0,w.jsx)(S,{})}];return(0,w.jsxs)("section",{className:E.bg,children:[(0,w.jsxs)("div",{className:"edu-container",children:[(0,w.jsxs)("section",{className:"animated fadeIn",children:[(0,w.jsx)("aside",{className:"mt10",children:(0,w.jsxs)(f.Z,{separator:">",children:[(0,w.jsx)(f.Z.Item,{children:(0,w.jsx)(p.Link,{to:"/users/".concat(o.username,"/").concat("personal"===o.topictype?"topics":"topicbank","/").concat(o.topictype),children:"personal"===o.topictype?"我的课堂资源":"公共题库"})}),(0,w.jsx)(f.Z.Item,{children:"详情"})]})}),(0,w.jsxs)("aside",{className:[E.title,"mt20"].join(" "),children:[(0,w.jsx)("strong",{className:"font20 ml5",children:y.name}),y.is_public&&(0,w.jsx)(m.VV,{status:["公开"]})]})]}),(0,w.jsxs)("aside",{className:"mt30 relative bg-white mb20",children:[(0,w.jsxs)("div",{className:E.export,children:[(null==y?void 0:y.authorize)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("a",{onClick:function(e){var t;e.preventDefault(),_.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"是否确认删除?",onOk:(t=s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,x.Tv)({object_type:"normal",object_id:[o.topicId]});case 2:0===e.sent.status&&a.push("/users/".concat(o.username,"/topics/personal"));case 4:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})})},children:"删除"}),(0,w.jsx)(p.Link,{to:"/users/".concat(o.username,"/topics/").concat(o.topicId,"/").concat(o.topictype,"/").concat(o.type,"/edit"),children:"编辑"})]}),(0,w.jsx)("a",{onClick:function(e){e.preventDefault(),n({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[o.topicId],object_type:o.type}}})},children:"发送"})]}),(0,w.jsx)(h.Z,{defaultActiveKey:j,className:E.tabs,children:N.map((function(e,t){return(0,w.jsx)(h.Z.TabPane,{tab:e.name,children:e.compontent},e.id)}))})]})]}),(0,w.jsx)(A.Z,{})]})}))},55548:function(e,t,n){n.d(t,{Z:function(){return L}});var a=n(82242),r=n.n(a),c=n(7557),s=n.n(c),i=n(41498),l=n.n(i),o=n(79800),u=n.n(o),d=n(39647),p=n.n(d),f=n(59301),_=n(65233),h=n(8591),m=n(43418),x=n(99313),v=n(56511),g=n(5112),b={title:"title___XAxiE",radioWrap:"radioWrap___k0pOB",radio:"radio___x9kMt",colorFF0000:"colorFF0000___IMgd0",pagination:"pagination___ou2ht",checkboxWrapper:"checkboxWrapper___kF7xI"},j=n(26795),y=n(25914),w=n(37205),k=n.n(w),N=n(71418),Z=n(24905),S=n(86065),E=n(26724),A=n.n(E),I=n(37712),C=function(e){var t=e.username,n=e.setStages,a=e.stages,r=e.hasError,c=e.setHasError,i=(0,f.useState)(""),o=u()(i,2),d=o[0],p=o[1],_=(0,f.useState)(1),h=u()(_,2),m=h[0],x=h[1],v=(0,f.useState)([]),j=u()(v,2),w=j[0],E=j[1],C=(0,f.useState)(!1),T=u()(C,2),P=T[0],D=T[1],L=(0,f.useState)(0),R=u()(L,2),O=R[0],V=R[1];(0,f.useEffect)((function(){W({page:1,search:""},!0)}),[]);var W=function(){var e=l()(s()().mark((function e(n,a){var r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),e.next=3,(0,S.w3)({username:t,category:"manage",page:n.page,search:n.search});case 3:r=e.sent,D(!1),E((function(e){return a?null==r?void 0:r.subjects:[].concat(k()(e),k()(null==r?void 0:r.subjects))})),V(null==r?void 0:r.count);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),M=(0,f.useRef)();return(0,I.jsxs)("div",{className:b.wrap,children:[(0,I.jsx)("div",{className:"mb10",children:(0,I.jsx)(y.t7,{placeholder:"请输入实践课程名称的关键字进行搜索",value:d,style:{width:500},onChange:function(e){p(e),x(1),M.current.scrollTo({behavior:"smooth",top:0}),W({page:1,search:e},!0)}})}),(0,I.jsx)(N.Z,{spinning:P,children:(0,I.jsx)("div",{className:b.radioWrap,ref:M,children:(0,I.jsx)(A(),{initialLoad:!1,pageStart:1,threshold:6,loadMore:function(){x(m+1),W({page:m+1,search:d},!1)},hasMore:w.length<O,useWindow:!1,children:(0,I.jsx)(g.ZP.Group,{value:a.subjectId,onChange:function(e){n({subjectId:e.target.value,stage_ids:[]}),c(!1)},children:w.map((function(e){var t=e.stages.map((function(e){return{label:e.name,value:e.id}}));return(0,I.jsxs)("div",{children:[(0,I.jsx)(g.ZP,{className:b.radio,value:e.id,children:e.name}),e.id===a.subjectId&&(0,I.jsxs)("div",{className:b.checkboxWrapper,children:[t.length>0&&(0,I.jsx)(Z.Z,{indeterminate:a.stage_ids.length>0&&a.stage_ids.length<t.length,onChange:function(a){n({subjectId:e.id,stage_ids:a.target.checked?t.map((function(e){return e.value})):[]})},checked:a.stage_ids.length===t.length,children:"全选"}),(0,I.jsx)(Z.Z.Group,{options:t,value:a.stage_ids,onChange:function(t){return n({subjectId:e.id,stage_ids:t})}})]})]},e.id)}))})})})}),r&&(0,I.jsx)("div",{className:b.colorFF0000,children:"请先选择实践课程及章节"})]})},T=n(34933),P=n(75924),D=["userDetail","globalSetting","loading","user","dispatch"],L=(0,_.connect)((function(e){var t=e.userDetail,n=e.loading,a=e.globalSetting,r=e.user;return{userDetail:t,globalSetting:a,loading:n.effects,user:r}}))((function(e){var t,n,a,c=e.userDetail,i=(e.globalSetting,e.loading),o=e.user,d=e.dispatch,_=(p()(e,D),(0,f.useState)("course")),w=u()(_,2),k=w[0],N=w[1],Z=(0,f.useState)(""),S=u()(Z,2),E=S[0],A=S[1],L=(0,f.useState)([]),R=u()(L,2),O=R[0],V=R[1],W=(0,f.useState)(),M=u()(W,2),z=M[0],F=M[1],H=(0,f.useState)(!1),B=u()(H,2),J=B[0],G=B[1],q=(0,f.useState)(!1),U=u()(q,2),X=U[0],K=U[1];(0,f.useEffect)((function(){"UserDetail-SendToClass"===c.actionTabs.key&&$(E)}),[c.actionTabs.key]);var $=function(){var e=l()(s()().mark((function e(t){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return G(!0),e.next=3,d({type:"userDetail/topicGetCourseList",payload:{search:t}});case 3:(n=e.sent)&&V((null==n?void 0:n.courses)||[]),G(!1);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Y=(0,f.useState)({subjectId:"",stage_ids:[]}),Q=u()(Y,2),ee=Q[0],te=Q[1],ne=function(){var e=l()(s()().mark((function e(){var t,n,a,i,l,u;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("course"!==k){e.next=11;break}if(z){e.next=4;break}return K(!0),e.abrupt("return");case 4:return e.next=6,d({type:"userDetail/topicSendToClass",payload:r()({course_id:z},null===(t=c.actionTabs)||void 0===t?void 0:t.params)});case 6:n=e.sent,d({type:"userDetail/setActionTabs",payload:{}}),n&&0===n.status&&(i={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll",videos:"video"},(0,j.xg)("/classrooms/".concat(z,"/").concat(i[null===(a=c.actionTabs)||void 0===a||null===(a=a.params)||void 0===a?void 0:a.object_type]))),e.next=18;break;case 11:if(ee.subjectId&&ee.stage_ids.length){e.next=14;break}return K(!0),e.abrupt("return");case 14:return e.next=16,(0,P.nI)({id:null===(l=c.actionTabs)||void 0===l||null===(l=l.params)||void 0===l?void 0:l.object_id,login:null===(u=o.userInfo)||void 0===u?void 0:u.login},{stage_ids:ee.stage_ids});case 16:0===e.sent.status&&(h.ZP.success("发送成功"),d({type:"userDetail/setActionTabs",payload:{}}),(0,j.xg)("/paths/".concat(ee.subjectId)));case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,I.jsx)(m.Z,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:"UserDetail-SendToClass"===c.actionTabs.key,title:"发送",okText:"确定",cancelText:"取消",confirmLoading:i["userDetail/sendToClass"],width:600,afterClose:function(){K(!1),V([]),te({subjectId:"",stage_ids:[]}),A("")},onOk:ne,wrapClassName:T.Z.CustomCss,onCancel:function(){d({type:"userDetail/setActionTabs",payload:{}})},children:(0,I.jsx)(x.Z,{activeKey:k,onChange:function(e){K(!1),N(e)},items:[{label:"课堂",key:"course",children:(0,I.jsxs)("div",{className:b.wrap,children:[(0,I.jsx)("div",{className:"mb10",children:(0,I.jsx)(y.t7,{placeholder:"请输入课堂名称的关键字进行搜索",value:E,style:{width:500},onChange:function(e){A(e),$(e)}})}),(0,I.jsx)(v.Z,{active:!0,loading:J,children:(0,I.jsx)("div",{className:b.radioWrap,children:(0,I.jsx)(g.ZP.Group,{value:z,onChange:function(e){F(e.target.value),K(!1)},children:O.map((function(e,t){return(0,I.jsx)(g.ZP,{className:b.radio,value:e.course_id,children:e.course_name},e.course_id)}))})})}),"videos"!==(null===(t=c.actionTabs)||void 0===t||null===(t=t.params)||void 0===t?void 0:t.object_type)&&(0,I.jsx)("div",{className:b.title,children:"温馨提示:选择的题将会发送到指定课堂"}),X&&(0,I.jsx)("div",{className:b.colorFF0000,children:"请先选择课堂"})]}),show:!0},{label:"实践课程",key:"subject",children:(0,I.jsx)(C,{username:null===(n=o.userInfo)||void 0===n?void 0:n.login,stages:ee,setStages:te,hasError:X,setHasError:K}),show:"videos"===(null===(a=c.actionTabs)||void 0===a||null===(a=a.params)||void 0===a?void 0:a.object_type)}].filter((function(e){return e.show}))})})}))},44728:function(e,t,n){n.d(t,{AL:function(){return y},Iy:function(){return p},Qv:function(){return h},ez:function(){return j},jb:function(){return f}});var a=n(79800),r=n.n(a),c=n(32834),s=n.n(c),i=n(11690);var l=[],o=["<ul>"],u=new(s().Renderer),d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){l.length=0,o=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function _(e,t,n,a){if(t>=e.length||e[t].level<=n)return t;var r=e[t];a.push("<li><a href='#"+r.anchor+"'>"+r.text+"</a>");var c=[];return t=_(e,++t,r.level,c),c.length>0&&(a.push("<ul>"),c.forEach((function(e){a.push(e)})),a.push("</ul>")),a.push("</li>"),t=_(e,t,n,a)}function h(){return _(l,0,0,o),o.push("</ul>"),o.join("")}var m={heading:function(e){var t=d.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],a=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var a=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:r()(t,1)[0].length>=a.length?e.slice(a.length):e})).join("\n")}(n,t[3]||""),c=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(c)>=0){var s=g(),i=a;a=s,b[s]={type:"block",expression:i}}return{type:"code",raw:n,lang:c,text:a}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,g=function(){return"__special_katext_id_".concat(v++,"__")},b={};function j(){return b}function y(){v=0,b={}}function w(e){return e=e.replace(x,(function(e,t){var n=g();return b[n]={type:"inline",expression:t},n}))}var k=u.listitem;u.listitem=function(e){return k(w(e))};var N=u.paragraph;u.paragraph=function(e){return N(w(e))};var Z=u.tablecell;u.tablecell=function(e,t){return Z(w(e),t)},u.code=function(e,t,n){var a=(t||"").match(/\S*/)[0];return a?["latex","katex","math"].indexOf(a)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:(0,i.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:(0,i.escape)(e,!0))+"</code></pre>"},u.heading=function(e,t,n){var a=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:a,level:t,text:e}),"<h"+t+' id="'+a+'">'+e+"</h"+t+">"},s().setOptions({silent:!0,gfm:!0,pedantic:!1}),s().use({tokenizer:m,renderer:u}),t.ZP=s()},34933:function(e,t){t.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}}}]); |