diff --git a/p__CoreCurriculum__Lists__Overview__index.async.js b/p__CoreCurriculum__Lists__Overview__index.async.js index 690ba011df..ba0d952849 100644 --- a/p__CoreCurriculum__Lists__Overview__index.async.js +++ b/p__CoreCurriculum__Lists__Overview__index.async.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[45334],{2006:function(e,n,t){var i=t(82242),l=t.n(i),o=(t(59301),t(19779)),r=t(3113),s=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,i=void 0===t?{}:t,a=e.styles,c=void 0===a?{}:a,d=e.customText,u=e.ButtonText,m=e.ButtonClick,h=e.Buttonclass,p=e.ButtonTwo,f=e.imgStyles,x=e.loading,v=void 0!==x&&x;return(0,s.jsxs)("section",{className:"tc animated fadeIn",style:l()(l()({},{color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"}),c),children:[(0,s.jsx)("img",{src:n||o,style:l()({width:288,height:200},f)}),(0,s.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,s.jsx)(r.ZP,l()(l()({className:h,onClick:m},i),{},{children:u})),p&&p]})}},6708:function(e,n,t){t.d(n,{Z:function(){return b}});var i=t(82242),l=t.n(i),o=t(7557),r=t.n(o),s=t(41498),a=t.n(s),c=t(79800),d=t.n(c),u=t(59301),m={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},h=t(3113),p=t(74516),f=t(42541),x=t(6848),v=t(97514),g=t(86268),j=t(2006),_=t(44394),y=t(37712),b=function(e){var n,t,i,o,s,c,b,Z=e.editOffice,C=void 0===Z?"view":Z,k=e.data,w=(e.theme,e.type),N=e.filename,I=e.monacoEditor,S=e.className,P=e.style,F=e.close,E=e.onClose,R=e.hasMask,z=e.disabledDownload,O=e.onImgDimensions,T=e.showNodata,B=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),L=d()(B,2),D=(L[0],L[1],(0,u.useState)("")),V=d()(D,2),K=(V[0],V[1]),A=(0,u.useState)(),U=d()(A,2),W=U[0],H=U[1],M="build"===window.ENV?"/react/build":"",q=location.host.startsWith("localhost")?_.Z.PROXY_SERVER:_.Z.API_SERVER;console.log("disabledDownload---",z);var G=(0,u.useRef)();null!==(n=k)&&void 0!==n&&n.startsWith("/api")&&"txt"!==w&&(k=_.Z.API_SERVER+k),N&&(I.filename=N),(0,u.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,u.useEffect)((function(){"office"===w&&J()}),[w,k]);var J=function(){var e=a()(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:",k),n=k,k.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:t});case 6:i=e.sent,H(i);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){k.startsWith("http")||k.startsWith("blob:")?X():(0,v.Sv)(N||"educoder",k,N)},X=function(){(0,v.Nd)(N||"educoder",decodeURIComponent(k))};return console.log(k,"data"),(0,y.jsxs)("div",{style:l()({},P||{}),className:"".concat(R&&m.bgBlack," ").concat(w?m.wrp:"hide"),children:[F&&(0,y.jsxs)("div",{className:m.close,ref:G,children:[!!O&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return G.current},children:(0,y.jsx)("span",{onClick:function(){E(),O()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!z&&(0,y.jsx)(x.Z,{title:"点击下载此文件",getPopupContainer:function(){return G.current},children:(0,y.jsx)("span",{onClick:X,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(x.Z,{title:"关闭",getPopupContainer:function(){return G.current},children:(0,y.jsx)("span",{className:"",onClick:E,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(m[S]," ").concat(S," ").concat(m.monaco," ").concat("txt"===w?"show":"hide"),children:"txt"===w&&(0,y.jsx)(f.ZP,l()({},I))}),"audio"===w&&(0,y.jsx)("audio",{src:(null===(t=k)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(i=k)&&void 0!==i&&i.startsWith("/api")?k:"data:image/png;base64,".concat(k),autoPlay:!0}),"video"===w&&(0,y.jsx)(y.Fragment,{children:(null===(o=k)||void 0===o?void 0:o.indexOf("http"))>-1||null!==(s=k)&&void 0!==s&&s.startsWith("/api")?(0,y.jsx)("video",{controls:!0,src:"".concat(k),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(k),autoPlay:!0})}),"office"===w&&W&&(0,y.jsx)("iframe",{src:"".concat(M,"/office.html?key=").concat(W.key,"&url=").concat(q+W.url,"&callbackUrl=").concat(q+W.callbackUrl,"&fileType=").concat(W.fileType,"&title=").concat(W.title,"&model=").concat(C,"&officeServer=").concat(_.Z.ONLYOFFICE,"&disabledDownload=").concat(!!z)}),"html"===w&&(0,y.jsx)("iframe",{src:k+"&disposition=inline"}),"pdf"===w&&(0,y.jsx)("iframe",{src:"".concat(M,"/js/pdfview/index.html?url=").concat(k,"&disabledDownload=").concat(!!z)}),"image"===w&&(0,y.jsx)("img",{src:(null===(c=k)||void 0===c?void 0:c.indexOf("http"))>-1||null!==(b=k)&&void 0!==b&&b.startsWith("/api")?k:"data:image/png;base64,".concat(k)}),("other"===w||"download"===w)&&(0,y.jsx)(y.Fragment,{children:T?(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:Y,children:"下载"})}):(0,y.jsxs)(h.ZP,{type:"primary",size:"middle",onClick:Y,children:[(0,y.jsx)(p.Z,{}),"点击下载"]})})]})}},3306:function(e,n,t){var i=t(82242),l=t.n(i),o=t(39647),r=t.n(o),s=t(93370),a=(t(59301),t(37712)),c=["value","scrollId","onChange"];n.Z=function(e){e.value;var n=e.scrollId,t=e.onChange,i=r()(e,c);return(0,a.jsx)("div",{id:n||"",children:(0,a.jsx)(s.Z,l()(l()({},i),{},{onChange:function(e,n){null!=n&&n.length?t(e,n):t(e)}}))})}},93370:function(e,n,t){t.d(n,{Z:function(){return v}});var i=t(82242),l=t.n(i),o=t(7557),r=t.n(o),s=t(41498),a=t.n(s),c=t(79800),d=t.n(c),u=t(59301),m=t(84686),h=t(91203),p=t(87167),f=(t(6234),{editor_css:"editor_css___cm3Z8"}),x=t(37712),v=(0,p.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,i=e.style,o=e.user,s=e.placeholder,c=2097152,p=(0,u.useRef)(null),v=(0,u.useState)(null),g=d()(v,2),j=g[0],_=g[1],y=(0,u.useState)(""),b=d()(y,2),Z=b[0],C=b[1];(0,u.useEffect)((function(){C(n)}),[n]),(0,u.useEffect)((function(){t(Z)}),[Z]);var k={placeholder:s||"请输入内容...",MENU_CONF:{}};k.MENU_CONF.uploadImage={customUpload:function(e,n){return a()(r()().mark((function t(){var i,l;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=new FormData).append("file",e),t.next=4,(0,h.ZP)("/api/attachments.json",{method:"post",body:i},!0);case 4:l=t.sent,n(null==l?void 0:l.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},k.MENU_CONF.uploadVideo={customUpload:function(e,n){return a()(r()().mark((function t(){var i,l,s,a,d,u,m,f,x,v,g,j,_,y;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.size,l=Math.ceil(i/c),t.prev=2,t.next=5,(0,h.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:l,user_id:null==o||null===(s=o.userInfo)||void 0===s?void 0:s.user_id}});case 5:if(0===(null==(d=t.sent)?void 0:d.status)){t.next=8;break}throw new Error;case 8:u=d.upload_id,p.current=new AbortController,m=[],0,f=r()().mark((function n(){var t,l,o,s;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=x*c,l=Math.min(t+c,i),o=e.slice(t,l),(s=new FormData).append("chunk",o),s.append("fileName",e.name),s.append("chunkIndex",(x+1).toString()),s.append("uploadId",u),m.push((function(){return(0,h.ZP)("/api/attachments/multipart_upload",{method:"POST",body:s,signal:p.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),x=0;case 14:if(!(x0)){t.next=29;break}return t.next=27,Promise.all(_);case 27:t.sent,v+=g;case 29:t.next=22;break;case 31:return t.next=33,(0,h.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:l,uploadId:u,user_id:null==o||null===(a=o.userInfo)||void 0===a?void 0:a.user_id}});case 33:y=t.sent,n(null==y?void 0:y.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}};return(0,u.useEffect)((function(){return function(){null!=j&&(j.destroy(),_(null))}}),[j]),(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{className:null==f?void 0:f.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,x.jsx)(m.o,{editor:j,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,x.jsx)(m.M,{defaultConfig:k,value:Z,onCreated:_,onChange:function(e){var n;!function(e){return""==e||new RegExp("^[ ]+$").test(e)}((n=e.getHtml(),n.replace(/<[^

]+>/g,"").replace(/<[

$]+>/g,"").replace(/ /gi,"").replace(/<[^
]+>/g,"")))?C(e.getHtml()):C("")},mode:"default",style:l()({height:"500px",overflowY:"hidden"},i)})]})})}))},59091:function(e,n,t){t.r(n),t.d(n,{default:function(){return J}});var i=t(39647),l=t.n(i),o=t(82242),r=t.n(o),s=t(7557),a=t.n(s),c=t(41498),d=t.n(c),u=t(79800),m=t.n(u),h=t(59301),p=t(87167),f=t(78241),x=t(8591),v=t(46651),g=t(95237),j=t(36381),_=t(6848),y=t(43604),b=t(43418),Z=t(37906),C=t(5112),k=t(98135),w=t(71418),N=t(79817),I="AnchorStyle___GFnIq",S="DetailImg___umbs6",P="ResTeacher___WcXnc",F="ResSchool___KSEaJ",E="KnowledgeList___sogb8",R="CollapseActive___ROjw1",z="CollapseHeader___CMx87",O="CollapseHeaderIndex___gdbKP",T="CollapseHeaderTitle___IzNZk",B="CollapseHeaderTag___d2QQu",L="box_style___GqWzp",D=t(14477),V=t(3306),K=t(2006),A=t(47192),U=t(44394),W=t(97514),H=t(91203),M=t(6708),q=t(37712),G=["key","name"],J=(0,p.connect)((function(e){var n=e.coreCurriculum,t=e.user;return{coreCurriculum:n,loading:e.loading,user:t}}))((function(e){var n,t,i,o=e.coreCurriculum,s=(e.user,e.dispatch),c=e.loading,u=(0,p.useParams)(),J=f.Z.useForm(),Y=m()(J,1)[0],X=f.Z.useForm(),Q=m()(X,1)[0],$=(0,h.useState)({design:"One"}),ee=m()($,2),ne=ee[0],te=ee[1],ie=o.OverView,le=o.coreCE,oe=o.CoreDetail,re=o.KnowledgeList,se=re.subject_modules_en,ae=re.subject_modules_cn,ce=(0,h.useState)(!1),de=m()(ce,2),ue=de[0],me=de[1],he=(0,h.useState)(!1),pe=m()(he,2),fe=pe[0],xe=pe[1],ve=(0,h.useState)([]),ge=m()(ve,2),je=ge[0],_e=ge[1],ye=(0,h.useState)({formKey:"",title:"",language:le,isEdit:!1,okText:""}),be=m()(ye,2),Ze=be[0],Ce=be[1],ke=(0,h.useState)({content:"",type:""}),we=m()(ke,2),Ne=we[0],Ie=we[1],Se=(0,h.useRef)(),Pe=(0,h.useState)(!1),Fe=m()(Pe,2),Ee=Fe[0],Re=Fe[1],ze={maxCount:1,accept:".xlsx, .xls",beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(x.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),v.Z.LIST_IGNORE):Promise.reject()}},Oe={beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(x.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),v.Z.LIST_IGNORE):Promise.resolve()},action:"".concat(U.Z.API_SERVER,"/api/attachments.json"),onRemove:(i=d()(a()().mark((function e(n){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/attachments/".concat(n.response.id,".json"),{method:"delete"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},Te=function(){var e=d()(a()().mark((function e(n){var t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/attachments/".concat(n,"/detail.json"),{method:"get"});case 2:if(-1===(null==(t=e.sent)?void 0:t.status)){e.next=10;break}if("txt"!==t.file_type){e.next=9;break}return e.next=7,(0,H.ZP)(t.url,{method:"get",headers:{"Content-Type":"application/xml"}});case 7:i=e.sent,Se.current=i;case 9:Ie({type:t.file_type,content:t.url+"&nocredentials=true"});case 10:Re(!0);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Be=function(){var e=d()(a()().mark((function e(n,t,i){var l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/core_subjects/".concat(null==u?void 0:u.coreId,"/core_subject_knowledge_systems/change_content_postion.json"),{method:"post",body:{id:null==u?void 0:u.coreId,new_item_id:t,origin_item_id:n}});case 2:0==(null==(l=e.sent)?void 0:l.status)&&(x.ZP.success(i),Ve());case 4:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Le={color:"#1B8565",textAlign:"CN"==le?"justify":"right",textAlignLast:"CN"==le?"justify":"right",width:"CN"==le?".56rem":"1.55rem",fontSize:"0.14rem",fontWeight:500,display:"block"},De=[{key:"core-orientation",href:"#core-orientation",title:"CN"==le?"课程定位":"Introduction",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){Ce({formKey:"core-orientation",title:"编辑课程定位"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"编辑课程定位"]}),content:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:"CN"==le?null==ie?void 0:ie.positioning:null==ie?void 0:ie.positioning_en}}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"positioning",label:"中文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.positioning,style:{height:"300px"}})}),(0,q.jsx)(f.Z.Item,{name:"positioning_en",label:"英文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.positioning_en,style:{height:"300px"}})})]})},{key:"core-target",href:"#core-target",title:"CN"==le?"课程目标":"Goals",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){Ce({formKey:"core-target",title:"编辑课程目标"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"编辑课程目标"]}),content:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:"CN"==le?null==ie?void 0:ie.target:null==ie?void 0:ie.target_en}}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"target",label:"中文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.target,style:{height:"300px"}})}),(0,q.jsx)(f.Z.Item,{name:"target_en",label:"英文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.target_en,style:{height:"300px"}})})]})},{key:"core-design",href:"#core-design",title:"CN"==le?"课程设计":"Curriculum design ideas",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){Ce({formKey:"core-design",title:"编辑课程设计"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"编辑课程设计"]}),content:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:"CN"==le?null==ie?void 0:ie.design:null==ie?void 0:ie.design_en}}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"design",label:"中文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.design,style:{height:"300px"}})}),(0,q.jsx)(f.Z.Item,{name:"design_en",label:"英文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.design_en,style:{height:"300px"}})})]})},{key:"core-knowledge",href:"#core-knowledge",title:"CN"==le?"课程知识点":"Covered Topics",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)(g.Z,{children:[(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){Q.setFieldValue("knowledge_point_total",null==oe?void 0:oe.knowledge_point_total),Q.setFieldValue("study_time",null==oe?void 0:oe.study_time),xe(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"设置"]}),(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem",marginLeft:".2rem"},onClick:function(){Y.setFieldsValue({language:"CN"}),Ce({formKey:"core-knowledge",title:"新增中文知识点",language:"CN",okText:"确定新增"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"新增中文知识点"]}),(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem",marginLeft:".2rem"},onClick:function(){Y.setFieldsValue({language:"EN"}),Ce({formKey:"core-knowledge",title:"新增英文知识点",language:"EN",okText:"确定新增"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"新增英文知识点"]})]}),content:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{style:{fontSize:14,color:"#1b8565",marginLeft:"28px"},children:[(0,q.jsxs)("span",{children:["课程参考总学时:",(null==oe?void 0:oe.study_time)||"--"]}),(0,q.jsxs)("span",{style:{marginLeft:"40px"},children:["课程知识点总数:",(null==oe?void 0:oe.knowledge_point_total)||"--"]})]}),(0,q.jsx)(j.Z,{bordered:!1,ghost:!0,className:E,onChange:function(e){_e(e)},children:null===(n="CN"==le?ae:se)||void 0===n?void 0:n.map((function(e,n){var t,i;return(0,q.jsxs)(j.Z.Panel,{showArrow:!1,header:(0,q.jsxs)("div",{className:z,children:[(0,q.jsx)("div",{className:O,children:String(n+1).padStart(2,"0")}),(0,q.jsx)("div",{className:T,children:"".concat("CN"==le?"模块":"Modules").concat(n+1,":").concat(null==e?void 0:e.module_name)}),(0,q.jsx)(_.Z,{title:"参考总学时",color:"#1B8565",children:(0,q.jsxs)("div",{className:B,children:[(0,q.jsx)("i",{className:"iconfont icon-xueshi",style:{fontSize:".14rem"}}),(null==e?void 0:e.total_class_hours)||0]})}),(0,q.jsx)(_.Z,{title:"知识点总数",color:"#1B8565",children:(0,q.jsxs)("div",{className:B,children:[(0,q.jsx)("i",{className:"iconfont icon-zhishidian",style:{fontSize:".14rem"}}),(null==e?void 0:e.total_knowledge_points)||0]})})]}),extra:(0,q.jsxs)(g.Z,{gutter:20,align:"middle",style:{color:"#1B8565"},children:[((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)(q.Fragment,{children:[!(null!=e&&e.first_position)&&(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"上移",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-xiangshangyi current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(){var t=d()(a()().mark((function t(i){var l;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i.stopPropagation(),i.preventDefault(),Be(null==e?void 0:e.subject_module_id,null===(l="CN"==le?ae:se)||void 0===l||null===(l=l[n-1])||void 0===l?void 0:l.subject_module_id,"上移成功");case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})})}),!(null!=e&&e.last_position)&&(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"下移",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-xiangxiayi current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(){var t=d()(a()().mark((function t(i){var l;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i.stopPropagation(),i.preventDefault(),Be(null==e?void 0:e.subject_module_id,null===(l="CN"==le?ae:se)||void 0===l||null===(l=l[n+1])||void 0===l?void 0:l.subject_module_id,"下移成功");case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"编辑",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-bianji-moren current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(n){var t;n.stopPropagation(),n.preventDefault(),Y.setFieldsValue(r()(r()({},e),{},{module_content:null==e||null===(t=e.module_content)||void 0===t?void 0:t.map((function(e){return r()(r()({},e),{},{attachment_ids:null==e?void 0:e.attachments.map((function(e){return r()(r()({},e),{},{uid:null==e?void 0:e.id,name:null==e?void 0:e.title,status:"done",response:{id:null==e?void 0:e.id}})}))})}))})),Ce(r()(r()({},Ze),{},{design:"One",formKey:"core-knowledge",title:"CN"==le?"编辑中文知识点":"编辑英文知识点",isEdit:!0})),me(!0)}})})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"删除",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-shanchutimu current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(n){n.stopPropagation(),n.preventDefault();var t,i=b.Z.confirm({title:"删除知识点",icon:null,content:"确定删除该知识点吗?",okText:"确定删除",cancelText:"取消",onOk:(t=d()(a()().mark((function n(){return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s({type:"coreCurriculum/delKnowledgePoint",payload:{coreId:null==u?void 0:u.coreId,module_id:null==e?void 0:e.subject_module_id}});case 2:0==n.sent.status&&(x.ZP.success("删除成功"),i.destroy(),Ve());case 4:case"end":return n.stop()}}),n)}))),function(){return t.apply(this,arguments)}),onCancel:function(){return i.destroy()}})}})})})]}),(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:null!=je&&je.includes("".concat(null==e?void 0:e.subject_module_id))?"收起":"展开",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-zhankai7 ".concat(null!=je&&je.includes("".concat(null==e?void 0:e.subject_module_id))?R:""),style:{fontSize:".14rem",transition:"all .3s",display:"block",marginRight:".2rem"}})})})]}),children:[!(null!=e&&null!==(t=e.module_content)&&void 0!==t&&t.length)&&(0,q.jsx)(K.Z,{}),null==e||null===(i=e.module_content)||void 0===i?void 0:i.map((function(e,n){var t;return(0,q.jsx)(Z.Z,{column:1,colon:!1,items:[{label:"CN"==le?"知识点":"List of Topics",labelStyle:Le,key:"knowledge_point",children:null==e?void 0:e.knowledge_point},{label:"CN"==le?"主要内容":"Contents",labelStyle:Le,key:"content",children:null==e?void 0:e.content},{label:"CN"==le?"教学目标":"Teaching objectives",labelStyle:Le,key:"target",children:null==e?void 0:e.target},{label:"CN"==le?"参考学时":"Suggested credit hours",labelStyle:Le,key:"class_hour",children:null==e?void 0:e.class_hour},{label:"CN"==le?"课程教案":"Teaching plan",labelStyle:Le,key:"attachments",children:null==e||null===(t=e.attachments)||void 0===t?void 0:t.map((function(e,n){return(0,q.jsxs)("div",{style:{display:"flex",flexWrap:"nowrap",alignItems:"center",gap:"0.1rem"},children:[(0,q.jsx)("div",{style:{width:".08rem",height:".08rem",background:"#3061D0",borderRadius:"50%"}}),(0,q.jsx)("a",{onClick:function(){Te(null==e?void 0:e.id)},children:null==e?void 0:e.title})]},n)}))}]},n)}))]},null==e?void 0:e.subject_module_id)}))})]}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"language",label:"中文或英文",hidden:!0}),(null==Ze?void 0:Ze.isEdit)&&(0,q.jsx)(f.Z.Item,{name:"subject_module_id",label:"模块id",hidden:!0}),["新增中文知识点","新增英文知识点"].includes(null==Ze?void 0:Ze.title)&&(0,q.jsx)(f.Z.Item,{name:"design",label:"新增模式",initialValue:"One",children:(0,q.jsxs)(C.ZP.Group,{children:[(0,q.jsx)(C.ZP,{value:"One",children:"单个新增"}),(0,q.jsx)(C.ZP,{value:"import",children:"批量导入"})]})}),"One"==ne.design?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"module_name",label:"模块名称",rules:[{required:!0,message:"请输入模块名称"}],children:(0,q.jsx)(k.Z,{})}),["编辑中文知识点","编辑英文知识点","新增中文知识点","新增英文知识点"].includes(null==Ze?void 0:Ze.title)&&(0,q.jsx)(f.Z.Item,{name:"total_class_hours",label:"参考总学时",rules:[{required:!0,message:"请输入参考学时"}],children:(0,q.jsx)(k.Z,{maxLength:10,showCount:!0})}),(0,q.jsxs)(g.Z,{children:[(0,q.jsx)(y.Z,{style:{width:80,textAlign:"right",padding:"10px"},children:"模块内容"}),(0,q.jsx)(y.Z,{flex:1,children:(0,q.jsx)(f.Z.List,{name:"module_content",rules:[{validator:function(e,n){var t;return null!=n&&null!==(t=n.map((function(e){return null==e?void 0:e.knowledge_point})))&&void 0!==t&&t.includes(n)?Promise.reject(new Error("知识点请勿重复")):Promise.resolve()}}],children:function(e,n){var t=n.add,i=n.remove;return(0,q.jsxs)(q.Fragment,{children:[e.map((function(e){var n=e.key,o=e.name,s=l()(e,G);return(0,q.jsxs)(g.Z,{gutter:20,className:"ml10",style:{background:"#F6F7F9",padding:"20px",marginBottom:"20px"},align:"middle",children:[(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"id"],hidden:!0})),(0,q.jsx)(y.Z,{flex:1,children:(0,q.jsxs)(g.Z,{gutter:20,style:{flexDirection:"column"},children:[(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"knowledge_point"],label:"知识点",rules:[{required:!0,message:"请输入知识点"}],children:(0,q.jsx)(k.Z,{placeholder:"请输入知识点"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"content"],label:"主要内容",children:(0,q.jsx)(k.Z.TextArea,{placeholder:"请输入主要内容"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"target"],label:"教学目标",children:(0,q.jsx)(k.Z.TextArea,{placeholder:"请输入教学目标"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"class_hour"],label:"参考学时",children:(0,q.jsx)(k.Z,{placeholder:"请输入参考学时"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"attachment_ids"],label:"课程教案",valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:e.fileList},children:(0,q.jsx)(v.Z,r()(r()({},Oe),{},{children:(0,q.jsx)(A.op,{style:{borderRadius:"2px"},icon:(0,q.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"上传教案"})}))}))]})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)("i",{className:"iconfont icon-shanjian current ",style:{color:"green"},onClick:function(){return i(o)}})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)("i",{className:"iconfont icon-tianjiatimu current ",style:{color:"red"},onClick:function(){return t({id:null,school:"",name:"",professional:""})}})})]},n)})),(0,q.jsx)(A.op,{style:{borderRadius:"2px",marginLeft:"10px"},onClick:function(){return t({id:null,school:"",name:"",professional:""})},children:"新增知识点"})]})}})})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"file",label:"上传文件",rules:[{required:!0,message:"请上传文件"}],valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,q.jsx)(v.Z,r()(r()({},ze),{},{children:(0,q.jsx)(A.op,{style:{borderRadius:"2px"},icon:(0,q.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"选择文件"})}))}),(0,q.jsxs)("div",{style:{marginLeft:"80px"},children:["注意",(0,q.jsx)("div",{children:"1、仅支持上传.xlsx 或 .xls类型的文件"}),(0,q.jsxs)("div",{children:["2、需按照指定模板上传数据。",(0,q.jsx)("a",{onClick:function(){return(0,W.FH)("",(0,W.NY)({url:"".concat(U.Z.API_SERVER,"/api/core_subjects/download_knowledge_point_template.json"),query:{}}))},children:"点击下载模板"})]})]})]})]})},{key:"core-school",href:"#core-school",title:"CN"==le?"负责教师/牵头单位":"Course director/Leading unit",UseEdit:(0,D.Ny)()&&(0,q.jsx)(g.Z,{}),content:(0,q.jsxs)(g.Z,{align:"middle",justify:"space-between",children:[(0,q.jsxs)("div",{className:P,children:[(0,q.jsxs)("div",{children:["CN"==le?null==oe?void 0:oe.name:null==oe?void 0:oe.name_en," ","CN"==le?"负责教师":"Course director"]}),(0,q.jsx)("div",{style:{marginTop:".32rem"},children:"CN"==le?null==oe?void 0:oe.adminer:null==oe?void 0:oe.adminer_en})]}),(0,q.jsxs)("div",{className:F,children:[(0,q.jsxs)("div",{children:["CN"==le?null==oe?void 0:oe.name:null==oe?void 0:oe.name_en," ","CN"==le?"牵头单位":"Leading unit"]}),(0,q.jsx)("div",{style:{marginTop:".32rem"},children:"CN"==le?null==oe?void 0:oe.leading_unit:null==oe?void 0:oe.leading_unit_en})]})]}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"language",label:"中文或英文",hidden:!0}),(0,q.jsx)(f.Z.Item,{name:"teacher_name",label:"负责教师",children:(0,q.jsx)(k.Z,{placeholder:"请输入负责教师姓名"})}),(0,q.jsx)(f.Z.Item,{name:"leading_unit",label:"牵头单位",children:(0,q.jsx)(k.Z,{placeholder:"请输入牵头单位"})})]})}],Ve=function(){s({type:"coreCurriculum/getCoreSubjectOverview",payload:{id:null==u?void 0:u.coreId,language:le}}),s({type:"coreCurriculum/getCooperateInfo",payload:{id:null==u?void 0:u.coreId,language:le}}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ze.language;s({type:"coreCurriculum/getKnowledgeList",payload:{coreId:null==u?void 0:u.coreId,language:e||le}})}()};return(0,h.useEffect)((function(){(null==u?void 0:u.coreId)&&Ve()}),[null==u?void 0:u.coreId]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(w.Z,{spinning:!1,children:(0,q.jsxs)(g.Z,{wrap:!1,justify:"center",style:{marginTop:".37rem"},children:[(0,q.jsx)(y.Z,{children:(0,q.jsxs)("div",{className:"".concat(I),children:[(null==oe?void 0:oe.detail_pic_id)&&(0,q.jsx)("img",{className:"".concat(S),src:U.Z.API_SERVER+"/api/attachments/"+(null==oe?void 0:oe.detail_pic_id)}),(0,q.jsx)(N.Z,{items:De})]})}),(0,q.jsx)(y.Z,{children:De.map((function(e){return(0,q.jsxs)("div",{style:{width:"12rem",marginBottom:"1rem"},children:[(0,q.jsxs)(g.Z,{id:e.key,align:"middle",justify:"space-between",style:{marginBottom:".3rem"},children:[(0,q.jsx)(y.Z,{children:(0,q.jsxs)("span",{style:{fontWeight:500,letterSpacing:"CN"==le?"0":".02rem",color:"#1B8565",fontSize:".18rem"},children:[(0,q.jsx)("i",{className:"iconfont icon-dingweitubiao",style:{marginRight:"0.1rem",fontSize:".18rem"}}),e.title]})}),(0,q.jsx)(y.Z,{children:e.UseEdit})]}),(0,q.jsx)("div",{className:L,children:e.content})]},e.key)}))})]})}),(0,q.jsx)(b.Z,{title:null==Ze?void 0:Ze.title,open:ue,destroyOnClose:!0,centered:!0,width:1200,okText:null==Ze?void 0:Ze.okText,forceRender:!0,onCancel:function(){me(!1),Y.resetFields(),Ce({}),te({design:"One"})},confirmLoading:!!c["coreCurriculum/putCoreSubjectOverview"]||!!c["coreCurriculum/postBatchImport"],onOk:function(){Y.submit()},children:(0,q.jsx)(f.Z,{form:Y,style:{maxHeight:700},colon:!1,size:"large",initialValues:{},onValuesChange:function(e,n){return te(r()(r()({},ne),n))},onFinish:function(){var e=d()(a()().mark((function e(n){var t,i,l,o,c,d,m,h,p,f,v;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!["core-orientation","core-target","core-design"].includes(null==Ze?void 0:Ze.formKey)){e.next=4;break}return e.next=3,s({type:"coreCurriculum/putCoreSubjectOverview",payload:r()(r()({},n),{},{id:null==u?void 0:u.coreId})});case 3:i=e.sent;case 4:if("core-school"!=(null==Ze?void 0:Ze.formKey)){e.next=8;break}return e.next=7,s({type:"coreCurriculum/putCooperateInfo",payload:r()(r()({},n),{},{coreId:null==u?void 0:u.coreId,cooperate_members:[]})});case 7:i=e.sent;case 8:if("core-knowledge"!=(null==Ze?void 0:Ze.formKey)){e.next=24;break}if("import"!=(null==n?void 0:n.design)){e.next=19;break}return(c=new FormData).append("file",null==n||null===(l=n.file)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.originFileObj),c.append("language",null==n?void 0:n.language),e.next=15,(0,H.ZP)("/api/core_subjects/".concat(null==u?void 0:u.coreId,"/core_subject_knowledge_systems/batch_import.json"),{method:"post",body:c},!0);case 15:i=e.sent,0==(null===(o=i)||void 0===o?void 0:o.status)&&(p=b.Z.confirm({title:"上传结果",icon:null,content:(0,q.jsxs)("div",{children:["成功上传",null===(d=i)||void 0===d||null===(d=d.data)||void 0===d||null===(d=d.result)||void 0===d?void 0:d.success,"条数据。",(null===(m=i)||void 0===m||null===(m=m.data)||void 0===m||null===(m=m.result)||void 0===m||null===(m=m.fail)||void 0===m?void 0:m.length)>0&&"有部分失败数据,请点击下方按钮下载失败数据文件。",(0,q.jsx)(g.Z,{align:"middle",justify:"center",children:(null===(h=i)||void 0===h||null===(h=h.data)||void 0===h||null===(h=h.result)||void 0===h||null===(h=h.fail)||void 0===h?void 0:h.length)>0&&(0,q.jsx)(A.op,{style:{borderRadius:"2px"},openLoading:!0,onClick:function(){(0,W.FH)("",(0,W.NY)({url:"".concat(U.Z.API_SERVER,"/api/core_subjects/").concat(null==u?void 0:u.coreId,"/core_subject_knowledge_systems/get_fail_data.xlsx"),query:{}}))},children:"下载失败数据"})})]}),okText:"确定",cancelText:"取消",onOk:function(){return p.destroy()},onCancel:function(){return p.destroy()}})),e.next=24;break;case 19:return v=Ze.isEdit?"coreCurriculum/putKnowledgePoint":"coreCurriculum/postKnowledgePoint",n.module_content=(null==n||null===(f=n.module_content)||void 0===f?void 0:f.map((function(e){var n;return r()(r()({},e),{},{attachment_ids:null==e||null===(n=e.attachment_ids)||void 0===n?void 0:n.map((function(e){var n;return null==e||null===(n=e.response)||void 0===n?void 0:n.id}))})})))||[],e.next=23,s({type:v,payload:r()(r()({},n),{},{coreId:null==u?void 0:u.coreId,module_id:null==n?void 0:n.subject_module_id})});case 23:i=e.sent;case 24:0==(null===(t=i)||void 0===t?void 0:t.status)&&(x.ZP.success("core-knowledge"==(null==Ze?void 0:Ze.formKey)?"import"==(null==n?void 0:n.design)?"导入成功":Ze.isEdit?"修改成功":"新增成功":"修改成功"),me(!1),Y.resetFields(),Ce({}),te({design:"One"}),Ve());case 25:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:null==De||null===(t=De.find((function(e){return e.key===(null==Ze?void 0:Ze.formKey)})))||void 0===t?void 0:t.FormDiv})}),(0,q.jsx)(b.Z,{title:"文件预览",open:Ee,destroyOnClose:!0,centered:!0,width:1200,footer:null,onCancel:function(){Re(!1),Ie({content:"",type:""})},children:(0,q.jsx)("div",{style:{height:700,overflow:"hidden",position:"relative"},children:(0,q.jsx)(M.Z,{data:null==Ne?void 0:Ne.content,type:null==Ne?void 0:Ne.type,disabledDownload:!(0,D.bg)(),style:{position:"absolute",zIndex:1,alignItems:"flex-start"},monacoEditor:{value:Se.current,language:"txt",onChange:function(){},options:{readOnly:!0,fontSize:14,minimap:{enabled:!1}}},onClose:function(){return Ie({content:"",type:""})}})})}),(0,q.jsx)(b.Z,{title:"设置",open:fe,destroyOnClose:!0,centered:!0,width:600,onCancel:function(){xe(!1),Y.resetFields(),Ce({}),te({design:"One"})},onOk:function(){Q.submit()},children:(0,q.jsxs)(f.Z,{form:Q,style:{maxHeight:700},colon:!1,size:"large",onFinish:function(){var e=d()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/core_subjects/".concat(null==u?void 0:u.coreId,"/update_study_time_or_knowledge.json"),{method:"post",body:n});case 2:0==(null==(t=e.sent)?void 0:t.status)&&(x.ZP.success("修改成功"),s({type:"coreCurriculum/getCoreSubjectDetail",payload:{id:null==u?void 0:u.coreId}})),xe(!1);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,q.jsx)(f.Z.Item,{name:"study_time",label:"课程参考总学时",rules:[{required:!0,message:"请输入课程参考总学时"}],children:(0,q.jsx)(k.Z,{type:"text"})}),(0,q.jsx)(f.Z.Item,{name:"knowledge_point_total",label:"课程知识点总数",rules:[{required:!0,message:"请输入课程知识点总数"}],children:(0,q.jsx)(k.Z,{type:"text"})})]})})]})}))}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[45334],{2006:function(e,n,t){var i=t(82242),l=t.n(i),o=(t(59301),t(19779)),r=t(3113),s=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,i=void 0===t?{}:t,a=e.styles,c=void 0===a?{}:a,d=e.customText,u=e.ButtonText,m=e.ButtonClick,h=e.Buttonclass,p=e.ButtonTwo,f=e.imgStyles,x=e.loading,v=void 0!==x&&x;return(0,s.jsxs)("section",{className:"tc animated fadeIn",style:l()(l()({},{color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"}),c),children:[(0,s.jsx)("img",{src:n||o,style:l()({width:288,height:200},f)}),(0,s.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,s.jsx)(r.ZP,l()(l()({className:h,onClick:m},i),{},{children:u})),p&&p]})}},6708:function(e,n,t){t.d(n,{Z:function(){return b}});var i=t(82242),l=t.n(i),o=t(7557),r=t.n(o),s=t(41498),a=t.n(s),c=t(79800),d=t.n(c),u=t(59301),m={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},h=t(3113),p=t(74516),f=t(42541),x=t(6848),v=t(97514),g=t(86268),j=t(2006),_=t(44394),y=t(37712),b=function(e){var n,t,i,o,s,c,b,Z=e.editOffice,C=void 0===Z?"view":Z,k=e.data,w=(e.theme,e.type),N=e.filename,I=e.monacoEditor,S=e.className,P=e.style,F=e.close,E=e.onClose,R=e.hasMask,z=e.disabledDownload,O=e.onImgDimensions,T=e.showNodata,B=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),L=d()(B,2),D=(L[0],L[1],(0,u.useState)("")),V=d()(D,2),K=(V[0],V[1]),A=(0,u.useState)(),U=d()(A,2),W=U[0],H=U[1],M="build"===window.ENV?"/react/build":"",q=location.host.startsWith("localhost")?_.Z.PROXY_SERVER:_.Z.API_SERVER;console.log("disabledDownload---",z);var G=(0,u.useRef)();null!==(n=k)&&void 0!==n&&n.startsWith("/api")&&"txt"!==w&&(k=_.Z.API_SERVER+k),N&&(I.filename=N),(0,u.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,u.useEffect)((function(){"office"===w&&J()}),[w,k]);var J=function(){var e=a()(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:",k),n=k,k.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:t});case 6:i=e.sent,H(i);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){k.startsWith("http")||k.startsWith("blob:")?$():(0,v.Sv)(N||"educoder",k,N)},$=function(){(0,v.Nd)(N||"educoder",decodeURIComponent(k))};return console.log(k,"data"),(0,y.jsxs)("div",{style:l()({},P||{}),className:"".concat(R&&m.bgBlack," ").concat(w?m.wrp:"hide"),children:[F&&(0,y.jsxs)("div",{className:m.close,ref:G,children:[!!O&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return G.current},children:(0,y.jsx)("span",{onClick:function(){E(),O()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!z&&(0,y.jsx)(x.Z,{title:"点击下载此文件",getPopupContainer:function(){return G.current},children:(0,y.jsx)("span",{onClick:$,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(x.Z,{title:"关闭",getPopupContainer:function(){return G.current},children:(0,y.jsx)("span",{className:"",onClick:E,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(m[S]," ").concat(S," ").concat(m.monaco," ").concat("txt"===w?"show":"hide"),children:"txt"===w&&(0,y.jsx)(f.ZP,l()({},I))}),"audio"===w&&(0,y.jsx)("audio",{src:(null===(t=k)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(i=k)&&void 0!==i&&i.startsWith("/api")?k:"data:image/png;base64,".concat(k),autoPlay:!0}),"video"===w&&(0,y.jsx)(y.Fragment,{children:(null===(o=k)||void 0===o?void 0:o.indexOf("http"))>-1||null!==(s=k)&&void 0!==s&&s.startsWith("/api")?(0,y.jsx)("video",{controls:!0,src:"".concat(k),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(k),autoPlay:!0})}),"office"===w&&W&&(0,y.jsx)("iframe",{src:"".concat(M,"/office.html?key=").concat(W.key,"&url=").concat(q+W.url,"&callbackUrl=").concat(q+W.callbackUrl,"&fileType=").concat(W.fileType,"&title=").concat(W.title,"&model=").concat(C,"&officeServer=").concat(_.Z.ONLYOFFICE,"&disabledDownload=").concat(!!z)}),"html"===w&&(0,y.jsx)("iframe",{src:k+"&disposition=inline"}),"pdf"===w&&(0,y.jsx)("iframe",{src:"".concat(M,"/js/pdfview/index.html?url=").concat(k,"&disabledDownload=").concat(!!z)}),"image"===w&&(0,y.jsx)("img",{src:(null===(c=k)||void 0===c?void 0:c.indexOf("http"))>-1||null!==(b=k)&&void 0!==b&&b.startsWith("/api")?k:"data:image/png;base64,".concat(k)}),("other"===w||"download"===w)&&(0,y.jsx)(y.Fragment,{children:T?(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:Y,children:"下载"})}):(0,y.jsxs)(h.ZP,{type:"primary",size:"middle",onClick:Y,children:[(0,y.jsx)(p.Z,{}),"点击下载"]})})]})}},3306:function(e,n,t){var i=t(82242),l=t.n(i),o=t(39647),r=t.n(o),s=t(93370),a=(t(59301),t(37712)),c=["value","scrollId","onChange"];n.Z=function(e){e.value;var n=e.scrollId,t=e.onChange,i=r()(e,c);return(0,a.jsx)("div",{id:n||"",children:(0,a.jsx)(s.Z,l()(l()({},i),{},{onChange:function(e,n){null!=n&&n.length?t(e,n):t(e)}}))})}},93370:function(e,n,t){t.d(n,{Z:function(){return v}});var i=t(82242),l=t.n(i),o=t(7557),r=t.n(o),s=t(41498),a=t.n(s),c=t(79800),d=t.n(c),u=t(59301),m=t(84686),h=t(91203),p=t(87167),f=(t(6234),{editor_css:"editor_css___cm3Z8"}),x=t(37712),v=(0,p.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,i=e.style,o=e.user,s=e.placeholder,c=2097152,p=(0,u.useRef)(null),v=(0,u.useState)(null),g=d()(v,2),j=g[0],_=g[1],y=(0,u.useState)(""),b=d()(y,2),Z=b[0],C=b[1];(0,u.useEffect)((function(){C(n)}),[n]),(0,u.useEffect)((function(){t(Z)}),[Z]);var k={placeholder:s||"请输入内容...",MENU_CONF:{}};k.MENU_CONF.uploadImage={customUpload:function(e,n){return a()(r()().mark((function t(){var i,l;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=new FormData).append("file",e),t.next=4,(0,h.ZP)("/api/attachments.json",{method:"post",body:i},!0);case 4:l=t.sent,n(null==l?void 0:l.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},k.MENU_CONF.uploadVideo={customUpload:function(e,n){return a()(r()().mark((function t(){var i,l,s,a,d,u,m,f,x,v,g,j,_,y;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.size,l=Math.ceil(i/c),t.prev=2,t.next=5,(0,h.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:l,user_id:null==o||null===(s=o.userInfo)||void 0===s?void 0:s.user_id}});case 5:if(0===(null==(d=t.sent)?void 0:d.status)){t.next=8;break}throw new Error;case 8:u=d.upload_id,p.current=new AbortController,m=[],0,f=r()().mark((function n(){var t,l,o,s;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=x*c,l=Math.min(t+c,i),o=e.slice(t,l),(s=new FormData).append("chunk",o),s.append("fileName",e.name),s.append("chunkIndex",(x+1).toString()),s.append("uploadId",u),m.push((function(){return(0,h.ZP)("/api/attachments/multipart_upload",{method:"POST",body:s,signal:p.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),x=0;case 14:if(!(x0)){t.next=29;break}return t.next=27,Promise.all(_);case 27:t.sent,v+=g;case 29:t.next=22;break;case 31:return t.next=33,(0,h.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:l,uploadId:u,user_id:null==o||null===(a=o.userInfo)||void 0===a?void 0:a.user_id}});case 33:y=t.sent,n(null==y?void 0:y.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}};return(0,u.useEffect)((function(){return function(){null!=j&&(j.destroy(),_(null))}}),[j]),(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{className:null==f?void 0:f.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,x.jsx)(m.o,{editor:j,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,x.jsx)(m.M,{defaultConfig:k,value:Z,onCreated:_,onChange:function(e){var n;!function(e){return""==e||new RegExp("^[ ]+$").test(e)}((n=e.getHtml(),n.replace(/<[^

]+>/g,"").replace(/<[

$]+>/g,"").replace(/ /gi,"").replace(/<[^
]+>/g,"")))?C(e.getHtml()):C("")},mode:"default",style:l()({height:"500px",overflowY:"hidden"},i)})]})})}))},59091:function(e,n,t){t.r(n),t.d(n,{default:function(){return J}});var i=t(39647),l=t.n(i),o=t(82242),r=t.n(o),s=t(7557),a=t.n(s),c=t(41498),d=t.n(c),u=t(79800),m=t.n(u),h=t(59301),p=t(87167),f=t(78241),x=t(8591),v=t(46651),g=t(95237),j=t(36381),_=t(6848),y=t(43604),b=t(43418),Z=t(37906),C=t(5112),k=t(98135),w=t(71418),N=t(79817),I="AnchorStyle___GFnIq",S="DetailImg___umbs6",P="ResTeacher___WcXnc",F="ResSchool___KSEaJ",E="KnowledgeList___sogb8",R="CollapseActive___ROjw1",z="CollapseHeader___CMx87",O="CollapseHeaderIndex___gdbKP",T="CollapseHeaderTitle___IzNZk",B="CollapseHeaderTag___d2QQu",L="box_style___GqWzp",D=t(14477),V=t(3306),K=t(2006),A=t(47192),U=t(44394),W=t(97514),H=t(91203),M=t(6708),q=t(37712),G=["key","name"],J=(0,p.connect)((function(e){var n=e.coreCurriculum,t=e.user;return{coreCurriculum:n,loading:e.loading,user:t}}))((function(e){var n,t,i,o=e.coreCurriculum,s=(e.user,e.dispatch),c=e.loading,u=(0,p.useParams)(),J=f.Z.useForm(),Y=m()(J,1)[0],$=f.Z.useForm(),X=m()($,1)[0],Q=(0,h.useState)({design:"One"}),ee=m()(Q,2),ne=ee[0],te=ee[1],ie=o.OverView,le=o.coreCE,oe=o.CoreDetail,re=o.KnowledgeList,se=re.subject_modules_en,ae=re.subject_modules_cn,ce=(0,h.useState)(!1),de=m()(ce,2),ue=de[0],me=de[1],he=(0,h.useState)(!1),pe=m()(he,2),fe=pe[0],xe=pe[1],ve=(0,h.useState)([]),ge=m()(ve,2),je=ge[0],_e=ge[1],ye=(0,h.useState)({formKey:"",title:"",language:le,isEdit:!1,okText:""}),be=m()(ye,2),Ze=be[0],Ce=be[1],ke=(0,h.useState)({content:"",type:""}),we=m()(ke,2),Ne=we[0],Ie=we[1],Se=(0,h.useRef)(),Pe=(0,h.useState)(!1),Fe=m()(Pe,2),Ee=Fe[0],Re=Fe[1],ze={maxCount:1,accept:".xlsx, .xls",beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(x.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),v.Z.LIST_IGNORE):Promise.reject()}},Oe={beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(x.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),v.Z.LIST_IGNORE):Promise.resolve()},action:"".concat(U.Z.API_SERVER,"/api/attachments.json"),onRemove:(i=d()(a()().mark((function e(n){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/attachments/".concat(n.response.id,".json"),{method:"delete"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},Te=function(){var e=d()(a()().mark((function e(n){var t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/attachments/".concat(n,"/detail.json"),{method:"get"});case 2:if(-1===(null==(t=e.sent)?void 0:t.status)){e.next=10;break}if("txt"!==t.file_type){e.next=9;break}return e.next=7,(0,H.ZP)(t.url,{method:"get",headers:{"Content-Type":"application/xml"}});case 7:i=e.sent,Se.current=i;case 9:Ie({type:t.file_type,content:t.url+"&nocredentials=true"});case 10:Re(!0);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Be=function(){var e=d()(a()().mark((function e(n,t,i){var l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/core_subjects/".concat(null==u?void 0:u.coreId,"/core_subject_knowledge_systems/change_content_postion.json"),{method:"post",body:{id:null==u?void 0:u.coreId,new_item_id:t,origin_item_id:n}});case 2:0==(null==(l=e.sent)?void 0:l.status)&&(x.ZP.success(i),Ve());case 4:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Le={color:"#1B8565",textAlign:"CN"==le?"justify":"right",textAlignLast:"CN"==le?"justify":"right",width:"CN"==le?".56rem":"1.55rem",fontSize:"0.14rem",fontWeight:500,display:"block"},De=[{key:"core-orientation",href:"#core-orientation",title:"CN"==le?"课程定位":"Introduction",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){Ce({formKey:"core-orientation",title:"编辑课程定位"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"编辑课程定位"]}),content:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:"CN"==le?null==ie?void 0:ie.positioning:null==ie?void 0:ie.positioning_en}}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"positioning",label:"中文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.positioning,style:{height:"300px"}})}),(0,q.jsx)(f.Z.Item,{name:"positioning_en",label:"英文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.positioning_en,style:{height:"300px"}})})]})},{key:"core-target",href:"#core-target",title:"CN"==le?"课程目标":"Goals",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){Ce({formKey:"core-target",title:"编辑课程目标"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"编辑课程目标"]}),content:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:"CN"==le?null==ie?void 0:ie.target:null==ie?void 0:ie.target_en}}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"target",label:"中文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.target,style:{height:"300px"}})}),(0,q.jsx)(f.Z.Item,{name:"target_en",label:"英文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.target_en,style:{height:"300px"}})})]})},{key:"core-design",href:"#core-design",title:"CN"==le?"课程设计":"Curriculum design ideas",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){Ce({formKey:"core-design",title:"编辑课程设计"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"编辑课程设计"]}),content:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:"CN"==le?null==ie?void 0:ie.design:null==ie?void 0:ie.design_en}}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"design",label:"中文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.design,style:{height:"300px"}})}),(0,q.jsx)(f.Z.Item,{name:"design_en",label:"英文",children:(0,q.jsx)(V.Z,{defaultvalue:null==ie?void 0:ie.design_en,style:{height:"300px"}})})]})},{key:"core-knowledge",href:"#core-knowledge",title:"CN"==le?"课程知识点":"Covered Topics",UseEdit:((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)(g.Z,{children:[(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem"},onClick:function(){X.setFieldValue("knowledge_point_total",null==oe?void 0:oe.knowledge_point_total),X.setFieldValue("study_time",null==oe?void 0:oe.study_time),xe(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"设置"]}),(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem",marginLeft:".2rem"},onClick:function(){Y.setFieldsValue({language:"CN"}),Ce({formKey:"core-knowledge",title:"新增中文知识点",language:"CN",okText:"确定新增"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"新增中文知识点"]}),(0,q.jsxs)("span",{className:"current",style:{color:"#1B8565",fontSize:".14rem",marginLeft:".2rem"},onClick:function(){Y.setFieldsValue({language:"EN"}),Ce({formKey:"core-knowledge",title:"新增英文知识点",language:"EN",okText:"确定新增"}),me(!0)},children:[(0,q.jsx)("i",{className:"iconfont icon-bianji-moren",style:{fontSize:".14rem",marginRight:".05rem"}}),"新增英文知识点"]})]}),content:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{style:{fontSize:14,color:"#1b8565",marginLeft:"28px"},children:[(0,q.jsxs)("span",{children:["课程参考总学时:",(null==oe?void 0:oe.study_time)||"--"]}),(0,q.jsxs)("span",{style:{marginLeft:"40px"},children:["课程知识点总数:",(null==oe?void 0:oe.knowledge_point_total)||"--"]})]}),(0,q.jsx)(j.Z,{bordered:!1,ghost:!0,className:E,onChange:function(e){_e(e)},children:null===(n="CN"==le?ae:se)||void 0===n?void 0:n.map((function(e,n){var t,i;return(0,q.jsxs)(j.Z.Panel,{showArrow:!1,header:(0,q.jsxs)("div",{className:z,children:[(0,q.jsx)("div",{className:O,children:String(n+1).padStart(2,"0")}),(0,q.jsx)("div",{className:T,children:"".concat("CN"==le?"模块":"Modules").concat(n+1,":").concat(null==e?void 0:e.module_name)}),(0,q.jsx)(_.Z,{title:"参考总学时",color:"#1B8565",children:(0,q.jsxs)("div",{className:B,children:[(0,q.jsx)("i",{className:"iconfont icon-xueshi",style:{fontSize:".14rem"}}),(null==e?void 0:e.total_class_hours)||0]})}),(0,q.jsx)(_.Z,{title:"知识点总数",color:"#1B8565",children:(0,q.jsxs)("div",{className:B,children:[(0,q.jsx)("i",{className:"iconfont icon-zhishidian",style:{fontSize:".14rem"}}),(null==e?void 0:e.total_knowledge_points)||0]})})]}),extra:(0,q.jsxs)(g.Z,{gutter:20,align:"middle",style:{color:"#1B8565"},children:[((0,D.Ny)()||(null==oe?void 0:oe.is_core_subject_member))&&(0,q.jsxs)(q.Fragment,{children:[!(null!=e&&e.first_position)&&(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"上移",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-xiangshangyi current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(){var t=d()(a()().mark((function t(i){var l;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i.stopPropagation(),i.preventDefault(),Be(null==e?void 0:e.subject_module_id,null===(l="CN"==le?ae:se)||void 0===l||null===(l=l[n-1])||void 0===l?void 0:l.subject_module_id,"上移成功");case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})})}),!(null!=e&&e.last_position)&&(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"下移",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-xiangxiayi current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(){var t=d()(a()().mark((function t(i){var l;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i.stopPropagation(),i.preventDefault(),Be(null==e?void 0:e.subject_module_id,null===(l="CN"==le?ae:se)||void 0===l||null===(l=l[n+1])||void 0===l?void 0:l.subject_module_id,"下移成功");case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"编辑",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-bianji-moren current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(n){var t;n.stopPropagation(),n.preventDefault(),Y.setFieldsValue(r()(r()({},e),{},{module_content:null==e||null===(t=e.module_content)||void 0===t?void 0:t.map((function(e){return r()(r()({},e),{},{attachment_ids:null==e?void 0:e.attachments.map((function(e){return r()(r()({},e),{},{uid:null==e?void 0:e.id,name:null==e?void 0:e.title,status:"done",response:{id:null==e?void 0:e.id}})}))})}))})),Ce(r()(r()({},Ze),{},{design:"One",formKey:"core-knowledge",title:"CN"==le?"编辑中文知识点":"编辑英文知识点",isEdit:!0})),me(!0)}})})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:"删除",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-shanchutimu current",style:{fontSize:".14rem",marginRight:".05rem"},onClick:function(n){n.stopPropagation(),n.preventDefault();var t,i=b.Z.confirm({title:"删除知识点",icon:null,content:"确定删除该知识点吗?",okText:"确定删除",cancelText:"取消",onOk:(t=d()(a()().mark((function n(){return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s({type:"coreCurriculum/delKnowledgePoint",payload:{coreId:null==u?void 0:u.coreId,module_id:null==e?void 0:e.subject_module_id}});case 2:0==n.sent.status&&(x.ZP.success("删除成功"),i.destroy(),Ve());case 4:case"end":return n.stop()}}),n)}))),function(){return t.apply(this,arguments)}),onCancel:function(){return i.destroy()}})}})})})]}),(0,q.jsx)(y.Z,{children:(0,q.jsx)(_.Z,{title:null!=je&&je.includes("".concat(null==e?void 0:e.subject_module_id))?"收起":"展开",color:"#1B8565",children:(0,q.jsx)("i",{className:"iconfont icon-zhankai7 ".concat(null!=je&&je.includes("".concat(null==e?void 0:e.subject_module_id))?R:""),style:{fontSize:".14rem",transition:"all .3s",display:"block",marginRight:".2rem"}})})})]}),children:[!(null!=e&&null!==(t=e.module_content)&&void 0!==t&&t.length)&&(0,q.jsx)(K.Z,{}),null==e||null===(i=e.module_content)||void 0===i?void 0:i.map((function(e,n){var t;return(0,q.jsx)(Z.Z,{column:1,colon:!1,items:[{label:"CN"==le?"知识点":"List of Topics",labelStyle:Le,key:"knowledge_point",children:null==e?void 0:e.knowledge_point},{label:"CN"==le?"主要内容":"Contents",labelStyle:Le,key:"content",children:null==e?void 0:e.content},{label:"CN"==le?"教学目标":"Teaching objectives",labelStyle:Le,key:"target",children:null==e?void 0:e.target},{label:"CN"==le?"参考学时":"Suggested credit hours",labelStyle:Le,key:"class_hour",children:null==e?void 0:e.class_hour},{label:"CN"==le?"课程教案":"Teaching plan",labelStyle:Le,key:"attachments",children:null==e||null===(t=e.attachments)||void 0===t?void 0:t.map((function(e,n){return(0,q.jsxs)("div",{style:{display:"flex",flexWrap:"nowrap",alignItems:"center",gap:"0.1rem"},children:[(0,q.jsx)("div",{style:{width:".08rem",height:".08rem",background:"#3061D0",borderRadius:"50%"}}),(0,q.jsx)("a",{onClick:function(){Te(null==e?void 0:e.id)},children:null==e?void 0:e.title})]},n)}))}]},n)}))]},null==e?void 0:e.subject_module_id)}))})]}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"language",label:"中文或英文",hidden:!0}),(null==Ze?void 0:Ze.isEdit)&&(0,q.jsx)(f.Z.Item,{name:"subject_module_id",label:"模块id",hidden:!0}),["新增中文知识点","新增英文知识点"].includes(null==Ze?void 0:Ze.title)&&(0,q.jsx)(f.Z.Item,{name:"design",label:"新增模式",initialValue:"One",children:(0,q.jsxs)(C.ZP.Group,{children:[(0,q.jsx)(C.ZP,{value:"One",children:"单个新增"}),(0,q.jsx)(C.ZP,{value:"import",children:"批量导入"})]})}),"One"==ne.design?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"module_name",label:"模块名称",rules:[{required:!0,message:"请输入模块名称"}],children:(0,q.jsx)(k.Z,{})}),["编辑中文知识点","编辑英文知识点","新增中文知识点","新增英文知识点"].includes(null==Ze?void 0:Ze.title)&&(0,q.jsx)(f.Z.Item,{name:"total_class_hours",label:"参考总学时",rules:[{required:!0,message:"请输入参考学时"},{pattern:/^[1-9]\d*$/,message:"请输入正整数"}],children:(0,q.jsx)(k.Z,{maxLength:10,showCount:!0})}),(0,q.jsxs)(g.Z,{children:[(0,q.jsx)(y.Z,{style:{width:80,textAlign:"right",padding:"10px"},children:"模块内容"}),(0,q.jsx)(y.Z,{flex:1,children:(0,q.jsx)(f.Z.List,{name:"module_content",rules:[{validator:function(e,n){var t;return null!=n&&null!==(t=n.map((function(e){return null==e?void 0:e.knowledge_point})))&&void 0!==t&&t.includes(n)?Promise.reject(new Error("知识点请勿重复")):Promise.resolve()}}],children:function(e,n){var t=n.add,i=n.remove;return(0,q.jsxs)(q.Fragment,{children:[e.map((function(e){var n=e.key,o=e.name,s=l()(e,G);return(0,q.jsxs)(g.Z,{gutter:20,className:"ml10",style:{background:"#F6F7F9",padding:"20px",marginBottom:"20px"},align:"middle",children:[(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"id"],hidden:!0})),(0,q.jsx)(y.Z,{flex:1,children:(0,q.jsxs)(g.Z,{gutter:20,style:{flexDirection:"column"},children:[(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"knowledge_point"],label:"知识点",rules:[{required:!0,message:"请输入知识点"}],children:(0,q.jsx)(k.Z,{placeholder:"请输入知识点"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"content"],label:"主要内容",children:(0,q.jsx)(k.Z.TextArea,{placeholder:"请输入主要内容"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"target"],label:"教学目标",children:(0,q.jsx)(k.Z.TextArea,{placeholder:"请输入教学目标"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"class_hour"],label:"参考学时",rules:[{pattern:/^[1-9]\d*$/,message:"请输入正整数"}],children:(0,q.jsx)(k.Z,{placeholder:"请输入参考学时"})})),(0,q.jsx)(f.Z.Item,r()(r()({},s),{},{name:[o,"attachment_ids"],label:"课程教案",valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:e.fileList},children:(0,q.jsx)(v.Z,r()(r()({},Oe),{},{children:(0,q.jsx)(A.op,{style:{borderRadius:"2px"},icon:(0,q.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"上传教案"})}))}))]})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)("i",{className:"iconfont icon-shanjian current ",style:{color:"green"},onClick:function(){return i(o)}})}),(0,q.jsx)(y.Z,{children:(0,q.jsx)("i",{className:"iconfont icon-tianjiatimu current ",style:{color:"red"},onClick:function(){return t({id:null,school:"",name:"",professional:""})}})})]},n)})),(0,q.jsx)(A.op,{style:{borderRadius:"2px",marginLeft:"10px"},onClick:function(){return t({id:null,school:"",name:"",professional:""})},children:"新增知识点"})]})}})})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"file",label:"上传文件",rules:[{required:!0,message:"请上传文件"}],valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,q.jsx)(v.Z,r()(r()({},ze),{},{children:(0,q.jsx)(A.op,{style:{borderRadius:"2px"},icon:(0,q.jsx)("i",{className:"iconfont icon-shangchuan3"}),children:"选择文件"})}))}),(0,q.jsxs)("div",{style:{marginLeft:"80px"},children:["注意",(0,q.jsx)("div",{children:"1、仅支持上传.xlsx 或 .xls类型的文件"}),(0,q.jsxs)("div",{children:["2、需按照指定模板上传数据。",(0,q.jsx)("a",{onClick:function(){return(0,W.FH)("",(0,W.NY)({url:"".concat(U.Z.API_SERVER,"/api/core_subjects/download_knowledge_point_template.json"),query:{}}))},children:"点击下载模板"})]})]})]})]})},{key:"core-school",href:"#core-school",title:"CN"==le?"负责教师/牵头单位":"Course director/Leading unit",UseEdit:(0,D.Ny)()&&(0,q.jsx)(g.Z,{}),content:(0,q.jsxs)(g.Z,{align:"middle",justify:"space-between",children:[(0,q.jsxs)("div",{className:P,children:[(0,q.jsxs)("div",{children:["CN"==le?null==oe?void 0:oe.name:null==oe?void 0:oe.name_en," ","CN"==le?"负责教师":"Course director"]}),(0,q.jsx)("div",{style:{marginTop:".32rem"},children:"CN"==le?null==oe?void 0:oe.adminer:null==oe?void 0:oe.adminer_en})]}),(0,q.jsxs)("div",{className:F,children:[(0,q.jsxs)("div",{children:["CN"==le?null==oe?void 0:oe.name:null==oe?void 0:oe.name_en," ","CN"==le?"牵头单位":"Leading unit"]}),(0,q.jsx)("div",{style:{marginTop:".32rem"},children:"CN"==le?null==oe?void 0:oe.leading_unit:null==oe?void 0:oe.leading_unit_en})]})]}),FormDiv:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f.Z.Item,{name:"language",label:"中文或英文",hidden:!0}),(0,q.jsx)(f.Z.Item,{name:"teacher_name",label:"负责教师",children:(0,q.jsx)(k.Z,{placeholder:"请输入负责教师姓名"})}),(0,q.jsx)(f.Z.Item,{name:"leading_unit",label:"牵头单位",children:(0,q.jsx)(k.Z,{placeholder:"请输入牵头单位"})})]})}],Ve=function(){s({type:"coreCurriculum/getCoreSubjectOverview",payload:{id:null==u?void 0:u.coreId,language:le}}),s({type:"coreCurriculum/getCooperateInfo",payload:{id:null==u?void 0:u.coreId,language:le}}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ze.language;s({type:"coreCurriculum/getKnowledgeList",payload:{coreId:null==u?void 0:u.coreId,language:e||le}})}()};return(0,h.useEffect)((function(){(null==u?void 0:u.coreId)&&Ve()}),[null==u?void 0:u.coreId]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(w.Z,{spinning:!1,children:(0,q.jsxs)(g.Z,{wrap:!1,justify:"center",style:{marginTop:".37rem"},children:[(0,q.jsx)(y.Z,{children:(0,q.jsxs)("div",{className:"".concat(I),children:[(null==oe?void 0:oe.detail_pic_id)&&(0,q.jsx)("img",{className:"".concat(S),src:U.Z.API_SERVER+"/api/attachments/"+(null==oe?void 0:oe.detail_pic_id)}),(0,q.jsx)(N.Z,{items:De})]})}),(0,q.jsx)(y.Z,{children:De.map((function(e){return(0,q.jsxs)("div",{style:{width:"12rem",marginBottom:"1rem"},children:[(0,q.jsxs)(g.Z,{id:e.key,align:"middle",justify:"space-between",style:{marginBottom:".3rem"},children:[(0,q.jsx)(y.Z,{children:(0,q.jsxs)("span",{style:{fontWeight:500,letterSpacing:"CN"==le?"0":".02rem",color:"#1B8565",fontSize:".18rem"},children:[(0,q.jsx)("i",{className:"iconfont icon-dingweitubiao",style:{marginRight:"0.1rem",fontSize:".18rem"}}),e.title]})}),(0,q.jsx)(y.Z,{children:e.UseEdit})]}),(0,q.jsx)("div",{className:L,children:e.content})]},e.key)}))})]})}),(0,q.jsx)(b.Z,{title:null==Ze?void 0:Ze.title,open:ue,destroyOnClose:!0,centered:!0,width:1200,okText:null==Ze?void 0:Ze.okText,forceRender:!0,onCancel:function(){me(!1),Y.resetFields(),Ce({}),te({design:"One"})},confirmLoading:!!c["coreCurriculum/putCoreSubjectOverview"]||!!c["coreCurriculum/postBatchImport"],onOk:function(){Y.submit()},children:(0,q.jsx)(f.Z,{form:Y,style:{maxHeight:700},colon:!1,size:"large",initialValues:{},onValuesChange:function(e,n){return te(r()(r()({},ne),n))},onFinish:function(){var e=d()(a()().mark((function e(n){var t,i,l,o,c,d,m,h,p,f,v;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!["core-orientation","core-target","core-design"].includes(null==Ze?void 0:Ze.formKey)){e.next=4;break}return e.next=3,s({type:"coreCurriculum/putCoreSubjectOverview",payload:r()(r()({},n),{},{id:null==u?void 0:u.coreId})});case 3:i=e.sent;case 4:if("core-school"!=(null==Ze?void 0:Ze.formKey)){e.next=8;break}return e.next=7,s({type:"coreCurriculum/putCooperateInfo",payload:r()(r()({},n),{},{coreId:null==u?void 0:u.coreId,cooperate_members:[]})});case 7:i=e.sent;case 8:if("core-knowledge"!=(null==Ze?void 0:Ze.formKey)){e.next=24;break}if("import"!=(null==n?void 0:n.design)){e.next=19;break}return(c=new FormData).append("file",null==n||null===(l=n.file)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.originFileObj),c.append("language",null==n?void 0:n.language),e.next=15,(0,H.ZP)("/api/core_subjects/".concat(null==u?void 0:u.coreId,"/core_subject_knowledge_systems/batch_import.json"),{method:"post",body:c},!0);case 15:i=e.sent,0==(null===(o=i)||void 0===o?void 0:o.status)&&(p=b.Z.confirm({title:"上传结果",icon:null,content:(0,q.jsxs)("div",{children:["成功上传",null===(d=i)||void 0===d||null===(d=d.data)||void 0===d||null===(d=d.result)||void 0===d?void 0:d.success,"条数据。",(null===(m=i)||void 0===m||null===(m=m.data)||void 0===m||null===(m=m.result)||void 0===m||null===(m=m.fail)||void 0===m?void 0:m.length)>0&&"有部分失败数据,请点击下方按钮下载失败数据文件。",(0,q.jsx)(g.Z,{align:"middle",justify:"center",children:(null===(h=i)||void 0===h||null===(h=h.data)||void 0===h||null===(h=h.result)||void 0===h||null===(h=h.fail)||void 0===h?void 0:h.length)>0&&(0,q.jsx)(A.op,{style:{borderRadius:"2px"},openLoading:!0,onClick:function(){(0,W.FH)("",(0,W.NY)({url:"".concat(U.Z.API_SERVER,"/api/core_subjects/").concat(null==u?void 0:u.coreId,"/core_subject_knowledge_systems/get_fail_data.xlsx"),query:{}}))},children:"下载失败数据"})})]}),okText:"确定",cancelText:"取消",onOk:function(){return p.destroy()},onCancel:function(){return p.destroy()}})),e.next=24;break;case 19:return v=Ze.isEdit?"coreCurriculum/putKnowledgePoint":"coreCurriculum/postKnowledgePoint",n.module_content=(null==n||null===(f=n.module_content)||void 0===f?void 0:f.map((function(e){var n;return r()(r()({},e),{},{attachment_ids:null==e||null===(n=e.attachment_ids)||void 0===n?void 0:n.map((function(e){var n;return null==e||null===(n=e.response)||void 0===n?void 0:n.id}))})})))||[],e.next=23,s({type:v,payload:r()(r()({},n),{},{coreId:null==u?void 0:u.coreId,module_id:null==n?void 0:n.subject_module_id})});case 23:i=e.sent;case 24:0==(null===(t=i)||void 0===t?void 0:t.status)&&(x.ZP.success("core-knowledge"==(null==Ze?void 0:Ze.formKey)?"import"==(null==n?void 0:n.design)?"导入成功":Ze.isEdit?"修改成功":"新增成功":"修改成功"),me(!1),Y.resetFields(),Ce({}),te({design:"One"}),Ve());case 25:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:null==De||null===(t=De.find((function(e){return e.key===(null==Ze?void 0:Ze.formKey)})))||void 0===t?void 0:t.FormDiv})}),(0,q.jsx)(b.Z,{title:"文件预览",open:Ee,destroyOnClose:!0,centered:!0,width:1200,footer:null,onCancel:function(){Re(!1),Ie({content:"",type:""})},children:(0,q.jsx)("div",{style:{height:700,overflow:"hidden",position:"relative"},children:(0,q.jsx)(M.Z,{data:null==Ne?void 0:Ne.content,type:null==Ne?void 0:Ne.type,disabledDownload:!(0,D.bg)(),style:{position:"absolute",zIndex:1,alignItems:"flex-start"},monacoEditor:{value:Se.current,language:"txt",onChange:function(){},options:{readOnly:!0,fontSize:14,minimap:{enabled:!1}}},onClose:function(){return Ie({content:"",type:""})}})})}),(0,q.jsx)(b.Z,{title:"设置",open:fe,destroyOnClose:!0,centered:!0,width:600,onCancel:function(){xe(!1),Y.resetFields(),Ce({}),te({design:"One"})},onOk:function(){X.submit()},children:(0,q.jsxs)(f.Z,{form:X,style:{maxHeight:700},colon:!1,size:"large",onFinish:function(){var e=d()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/core_subjects/".concat(null==u?void 0:u.coreId,"/update_study_time_or_knowledge.json"),{method:"post",body:n});case 2:0==(null==(t=e.sent)?void 0:t.status)&&(x.ZP.success("修改成功"),s({type:"coreCurriculum/getCoreSubjectDetail",payload:{id:null==u?void 0:u.coreId}})),xe(!1);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,q.jsx)(f.Z.Item,{name:"study_time",label:"课程参考总学时",rules:[{required:!0,message:"请输入课程参考总学时"},{pattern:/^[1-9]\d*$/,message:"请输入正整数"}],children:(0,q.jsx)(k.Z,{type:"text"})}),(0,q.jsx)(f.Z.Item,{name:"knowledge_point_total",label:"课程知识点总数",rules:[{required:!0,message:"请输入课程知识点总数"},{pattern:/^[1-9]\d*$/,message:"请输入正整数"}],children:(0,q.jsx)(k.Z,{type:"text"})})]})})]})}))}}]); \ No newline at end of file