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/p__User__Detail__Topics__De...

1 line
28 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[15402],{7406: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,x=e.loading,m=void 0!==x&&x;return(0,i.jsxs)("section",{className:"tc animated fadeIn",style:r()(r()({},{color:"#999",margin:"100px auto",visibility:m?"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})),_&&_]})}},84143:function(e,t,n){n.d(t,{Z:function(){return k}});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(60889),h=n(94049),x=n(6848),m=n(6457),v=n(83),g=n(7406),b=n(27065),j=n(6288),y=n(37712),k=function(e){var t,n,a,c,i,o,k=e.editOffice,w=void 0===k?"view":k,N=e.data,Z=(e.theme,e.type),S=e.filename,C=e.monacoEditor,T=e.className,E=e.style,I=e.close,P=e.onClose,D=e.hasMask,L=e.disabledDownload,A=e.onImgDimensions,O=e.showNodata,R=e.recordInfo,W=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),M=u()(W,2),F=(M[0],M[1],(0,d.useState)("")),H=u()(F,2),V=(H[0],H[1]),B=(0,d.useState)(),z=u()(B,2),G=z[0],q=z[1],J="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&&(C.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]&&V(t[1])}))}),[]),(0,d.useEffect)((function(){var e;"office"===Z&&(N.indexOf("bigfilescdn.")>-1||N.indexOf("bigfiles1")>-1?q({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,q(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,m.Sv)(S||"educoder",N,S)},Y=function(){R&&(0,j.fc)({id:null==R?void 0:R.id,watch_type:1,course_id:null==R?void 0:R.course_id}),(0,m.Nd)(S||"educoder",decodeURIComponent(N))};return(0,y.jsxs)("div",{style:r()({},E||{}),className:"".concat(D&&p.bgBlack," ").concat(Z?p.wrp:"hide"),children:[I&&(0,y.jsxs)("div",{className:p.close,ref:X,children:[!!A&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{onClick:function(){P(),A()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!L&&(0,y.jsx)(x.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)(x.Z,{title:"关闭",getPopupContainer:function(){return X.current},children:(0,y.jsx)("span",{className:"",onClick:P,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(p[T]," ").concat(T," ").concat(p.monaco," ").concat("txt"===Z?"show":"hide"),children:"txt"===Z&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(h.ZP,r()({},C))})}),"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&&G&&(0,y.jsx)("iframe",{src:"".concat(J,"/office.html?key=").concat(G.key,"&url=").concat(btoa(G.url),"&callbackUrl=").concat(U+G.callbackUrl,"&fileType=").concat(G.fileType,"&title=").concat(G.title,"&model=").concat(w,"&officeServer=").concat(b.Z.ONLYOFFICE,"&disabledDownload=").concat(!!L)}),"html"===Z&&(0,y.jsx)("iframe",{src:N+"&disposition=inline"}),"pdf"===Z&&(0,y.jsx)("iframe",{src:"".concat(J,"/js/pdfview/index.html?url=").concat(N,"&disabledDownload=").concat(!!L)}),"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:O?(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,{}),"点击下载"]})})]})}},42783:function(e,t,n){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(98253),n(55369)),f=(n(64018),n(63824)),_=n(27065),h=n(15342),x=n(1012),m=n(84143),v=n(37712),g="@▁@",b=/<pre[^>]*>/g;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,j=void 0===o?{}:o,y=e.stylesPrev,k=void 0===y?{}:y,w=e.highlightKeywords,N=e.showProgramFill,Z=(e.isProgramFill,e.disabledFill),S=void 0!==Z&&Z,C=e.programFillValue,T=e.onFillChange,E=void 0===T?function(e){}:T,I=e.onFillBlur,P=void 0===I?function(){}:I,D=String(n),L=(0,d.useState)(""),A=u()(L,2),O=A[0],R=A[1],W=(0,d.useState)("office"),M=u()(W,2),F=M[0],H=M[1],V=(0,d.useState)([]),B=u()(V,2),z=B[0],G=B[1],q=(0,d.useRef)("a"+(0,x.Z)()),J={},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(q.current," ").concat(e))})),"<style>".concat(a.join("}"),"</style>")}))},X=(0,d.useMemo)((function(){try{D=D.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 D=D.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,(function(t,n,a){var r;return function(e,t,n){var a=document.createElement(e===g?"input":"textarea");a.style.width="100%",a.style.height=e===g?"40px":"151px",a.rows=5,a.spellcheck=!1,a.name="edu-program-fill",a.placeholder="请输入",a.dataset.id=t;var r=Object.keys(J).length;return J[r]=a,'<span class="edu-program-fill-wrap '.concat(e===g?"":"show",'" style="width:').concat(e===g?"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==C||null===(r=C[e])||void 0===r?void 0:r.value)})),'<pre style="background:#fff;padding:4px">'.concat(U(D||""),"</pre>")}var t=U(D);t=(0,p.ZP)(t);var n=(0,p.ez)();D.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,h.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,w?(Y(a,w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a.innerHTML):c?a.innerText:(setTimeout((function(){return te()}),500),a.innerHTML)}),[D,w]);(0,d.useEffect)((function(){Q.current&&Q.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=K,e.onblur=$}))}),[z]),(0,d.useEffect)((function(){if(null!=C&&C.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==C||null===(r=C[o])||void 0===r?void 0:r.value)||"","warning"===(null==C||null===(c=C[o])||void 0===c?void 0:c.type)?d.className="program-fill-warning":"success"===(null==C||null===(s=C[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,x=u()(p.value,2),m=x[0];x[1].innerHTML=null!=C&&null!==(_=C[m])&&void 0!==_&&_.score?"".concat(null==C||null===(h=C[m])||void 0===h?void 0:h.score,"分"):""}}catch(e){f.e(e)}finally{f.f()}G(C)}catch(e){console.log(e,"error")}}),[C]);var K=function(e){z[e.target.dataset.id]=z[e.target.dataset.id]||{},z[e.target.dataset.id].value=e.target.value,G(s()(z)),E(z,e.target.dataset.id)},$=function(e){z[e.target.dataset.id]=z[e.target.dataset.id]||{},z[e.target.dataset.id].value=e.target.value,G(s()(z)),P(z,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(),R(n),H("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),R(n),H("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),R(n),H("html");else if(n.startsWith("#")){e.preventDefault();var a=document.getElementById(n.replace("#",""));a&&a.scrollIntoView(!0)}}}p.jb.WebkitLineClamp=i,i&&(j=r()(r()({},j),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(b)&&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,v.jsxs)(v.Fragment,{children:[c&&(0,v.jsx)("div",{ref:Q,children:X}),!c&&(0,v.jsx)("div",{ref:Q,style:r()({},j),className:"".concat(a||""," ").concat(S?"disabled-fill":""," markdown-body ").concat(q.current),dangerouslySetInnerHTML:{__html:X}}),(0,v.jsx)(m.Z,{close:!0,data:O,type:null!=O&&O.length?F:"",style:r()({},k),onClose:function(){return R("")}})]})}},17897:function(e,t,n){n.r(t),n.d(t,{default:function(){return E}});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(7880),f=n(66104),_=n(43418),h=n(99313),x=n(6457),m=n(37231),v=n(27065),g=n(42783),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"},k=n(37712);j().locale("ZH-cn");var w=(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,k.jsx)("section",{className:y.bg,children:(0,k.jsx)("section",{className:"",children:(0,k.jsxs)("aside",{className:[y.desc,"c-black","font14","bg-white"].join(" "),children:["编辑作业"!==n.actionTabs.key&&(0,k.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,k.jsx)("div",{children:(0,k.jsxs)("a",{href:"".concat(v.Z.API_SERVER).concat(e.url),children:[(0,k.jsx)("span",{className:"iconfont icon-fujian c-green font14"}),(0,k.jsx)("span",{className:"ml10 c-black",children:e.title}),(0,k.jsx)("span",{className:"c-light-black ml20 font12",children:e.filesize})]})})})),"group"===a.type&&(0,k.jsxs)(k.Fragment,{children:[(c.min_num||c.max_num)&&(0,k.jsxs)("div",{className:"mt10",children:[(0,k.jsx)("span",{className:"c-grey-666",children:"分组要求:"}),(0,k.jsxs)("span",{className:"c-black-051",children:[c.min_num,"~ ",c.max_num," 人(学生提交作品时需要关联同组成员,组内成员作品共享)"]})]}),c.base_on_project?(0,k.jsxs)("p",{children:[(0,k.jsx)("span",{className:"c-grey-666",children:"基于项目实施"}),(0,k.jsx)("span",{className:"c-black-051",children:"(学生必须在本平台创建项目,项目管理员可以提交作品)"})]}):(0,k.jsxs)("p",{children:[(0,k.jsx)("span",{className:"c-grey-666",children:"不基于项目"}),(0,k.jsx)("span",{className:"c-black-051",children:"(无需在平台创建项目,任意小组成员均可以提交作品)"})]})]})]})})})})),N=n(7406),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,k.jsx)("section",{className:Z.bg,children:(0,k.jsx)("section",{className:"",children:(0,k.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,k.jsxs)(k.Fragment,{children:[(0,k.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,k.jsx)("div",{children:(0,k.jsxs)("a",{href:"".concat(v.Z.API_SERVER).concat(e.url),children:[(0,k.jsx)("span",{className:"iconfont icon-fujian c-green font14"}),(0,k.jsx)("span",{className:"ml10 c-black",children:e.title}),(0,k.jsx)("span",{className:"c-light-black ml20 font12",children:e.filesize})]})})}))]}):(0,k.jsx)(N.Z,{})})})})})),C={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"},T=n(68317),E=(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,k.jsx)("div",{className:"minH500",children:(0,k.jsx)(w,{})})},{name:"参考答案",id:1,compontent:(0,k.jsx)(S,{})}];return(0,k.jsxs)("section",{className:C.bg,children:[(0,k.jsxs)("div",{className:"edu-container",children:[(0,k.jsxs)("section",{className:"animated fadeIn",children:[(0,k.jsx)("aside",{className:"mt10",children:(0,k.jsxs)(f.Z,{separator:">",children:[(0,k.jsx)(f.Z.Item,{children:(0,k.jsx)(p.Link,{to:"/users/".concat(o.username,"/").concat("personal"===o.topictype?"topics":"topicbank","/").concat(o.topictype),children:"personal"===o.topictype?"我的课堂资源":"公共题库"})}),(0,k.jsx)(f.Z.Item,{children:"详情"})]})}),(0,k.jsxs)("aside",{className:[C.title,"mt20"].join(" "),children:[(0,k.jsx)("strong",{className:"font20 ml5",children:y.name}),y.is_public&&(0,k.jsx)(x.VV,{status:["公开"]})]})]}),(0,k.jsxs)("aside",{className:"mt30 relative bg-white mb20",children:[(0,k.jsxs)("div",{className:C.export,children:[(null==y?void 0:y.authorize)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.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,m.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,k.jsx)(p.Link,{to:"/users/".concat(o.username,"/topics/").concat(o.topicId,"/").concat(o.topictype,"/").concat(o.type,"/edit"),children:"编辑"})]}),(0,k.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,k.jsx)(h.Z,{defaultActiveKey:j,className:C.tabs,children:N.map((function(e,t){return(0,k.jsx)(h.Z.TabPane,{tab:e.name,children:e.compontent},e.id)}))})]})]}),(0,k.jsx)(T.Z,{})]})}))},68317:function(e,t,n){n.d(t,{Z:function(){return A}});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(7880),h=n(8591),x=n(43418),m=n(99313),v=n(87876),g=n(5112),b={title:"title___XAxiE",radioWrap:"radioWrap___k0pOB",radio:"radio___x9kMt",colorFF0000:"colorFF0000___IMgd0",pagination:"pagination___ou2ht",checkboxWrapper:"checkboxWrapper___kF7xI"},j=n(6457),y=n(90963),k=n(37205),w=n.n(k),N=n(71418),Z=n(24905),S=n(37231),C=n(26724),T=n.n(C),E=n(37712),I=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),x=h[0],m=h[1],v=(0,f.useState)([]),j=u()(v,2),k=j[0],C=j[1],I=(0,f.useState)(!1),P=u()(I,2),D=P[0],L=P[1],A=(0,f.useState)(0),O=u()(A,2),R=O[0],W=O[1];(0,f.useEffect)((function(){M({page:1,search:""},!0)}),[]);var M=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 L(!0),e.next=3,(0,S.w3)({username:t,category:"manage",page:n.page,search:n.search});case 3:r=e.sent,L(!1),C((function(e){return a?null==r?void 0:r.subjects:[].concat(w()(e),w()(null==r?void 0:r.subjects))})),W(null==r?void 0:r.count);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),F=(0,f.useRef)();return(0,E.jsxs)("div",{className:b.wrap,children:[(0,E.jsx)("div",{className:"mb10",children:(0,E.jsx)(y.t7,{placeholder:"请输入实践课程名称的关键字进行搜索",value:d,style:{width:500},onChange:function(e){p(e),m(1),F.current.scrollTo({behavior:"smooth",top:0}),M({page:1,search:e},!0)}})}),(0,E.jsx)(N.Z,{spinning:D,children:(0,E.jsx)("div",{className:b.radioWrap,ref:F,children:(0,E.jsx)(T(),{initialLoad:!1,pageStart:1,threshold:6,loadMore:function(){m(x+1),M({page:x+1,search:d},!1)},hasMore:k.length<R,useWindow:!1,children:(0,E.jsx)(g.ZP.Group,{value:a.subjectId,onChange:function(e){n({subjectId:e.target.value,stage_ids:[]}),c(!1)},children:k.map((function(e){var t=e.stages.map((function(e){return{label:e.name,value:e.id}}));return(0,E.jsxs)("div",{children:[(0,E.jsx)(g.ZP,{className:b.radio,value:e.id,children:e.name}),e.id===a.subjectId&&(0,E.jsxs)("div",{className:b.checkboxWrapper,children:[t.length>0&&(0,E.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,E.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,E.jsx)("div",{className:b.colorFF0000,children:"请先选择实践课程及章节"})]})},P=n(14661),D=n(92001),L=["userDetail","globalSetting","loading","user","dispatch"],A=(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,L),(0,f.useState)("course")),k=u()(_,2),w=k[0],N=k[1],Z=(0,f.useState)(""),S=u()(Z,2),C=S[0],T=S[1],A=(0,f.useState)([]),O=u()(A,2),R=O[0],W=O[1],M=(0,f.useState)(),F=u()(M,2),H=F[0],V=F[1],B=(0,f.useState)(!1),z=u()(B,2),G=z[0],q=z[1],J=(0,f.useState)(!1),U=u()(J,2),X=U[0],K=U[1];(0,f.useEffect)((function(){"UserDetail-SendToClass"===c.actionTabs.key&&$(C)}),[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 q(!0),e.next=3,d({type:"userDetail/topicGetCourseList",payload:{search:t}});case 3:(n=e.sent)&&W((null==n?void 0:n.courses)||[]),q(!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"!==w){e.next=11;break}if(H){e.next=4;break}return K(!0),e.abrupt("return");case 4:return e.next=6,d({type:"userDetail/topicSendToClass",payload:r()({course_id:H},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(H,"/").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,D.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,E.jsx)(x.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),W([]),te({subjectId:"",stage_ids:[]}),T("")},onOk:ne,wrapClassName:P.Z.CustomCss,onCancel:function(){d({type:"userDetail/setActionTabs",payload:{}})},children:(0,E.jsx)(m.Z,{activeKey:w,onChange:function(e){K(!1),N(e)},items:[{label:"课堂",key:"course",children:(0,E.jsxs)("div",{className:b.wrap,children:[(0,E.jsx)("div",{className:"mb10",children:(0,E.jsx)(y.t7,{placeholder:"请输入课堂名称的关键字进行搜索",value:C,style:{width:500},onChange:function(e){T(e),$(e)}})}),(0,E.jsx)(v.Z,{active:!0,loading:G,children:(0,E.jsx)("div",{className:b.radioWrap,children:(0,E.jsx)(g.ZP.Group,{value:H,onChange:function(e){V(e.target.value),K(!1)},children:R.map((function(e,t){return(0,E.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,E.jsx)("div",{className:b.title,children:"温馨提示:选择的题将会发送到指定课堂"}),X&&(0,E.jsx)("div",{className:b.colorFF0000,children:"请先选择课堂"})]}),show:!0},{label:"实践课程",key:"subject",children:(0,E.jsx)(I,{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}))})})}))},55369: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 x={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}}}},m=/(?:\${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 k(e){return e=e.replace(m,(function(e,t){var n=g();return b[n]={type:"inline",expression:t},n}))}var w=u.listitem;u.listitem=function(e){return w(k(e))};var N=u.paragraph;u.paragraph=function(e){return N(k(e))};var Z=u.tablecell;u.tablecell=function(e,t){return Z(k(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:x,renderer:u}),t.ZP=s()},14661: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"}}}]);