diff --git a/p__CoreCurriculum__Lists__Overview__index.async.js b/p__CoreCurriculum__Lists__Overview__index.async.js index 2c8cb84955..5086c3f908 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,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 n=k,k.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=5,(0,g.gJ)({attachment_id:t});case 5:i=e.sent,H(i);case 7: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(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 +"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,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 n=k,k.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=5,(0,g.gJ)({attachment_id:t});case 5:i=e.sent,H(i);case 7: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(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 diff --git a/p__Textbook__Detail__index.async.js b/p__Textbook__Detail__index.async.js index 9d893be5ec..86dce55138 100644 --- a/p__Textbook__Detail__index.async.js +++ b/p__Textbook__Detail__index.async.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[25713],{93370:function(e,n,t){t.d(n,{Z:function(){return v}});var a=t(82242),s=t.n(a),r=t(7557),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(84686),p=t(91203),f=t(87167),_=(t(6234),{editor_css:"editor_css___cm3Z8"}),h=t(37712),v=(0,f.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,a=e.style,r=e.user,l=e.placeholder,c=2097152,f=(0,d.useRef)(null),v=(0,d.useState)(null),x=u()(v,2),b=x[0],g=x[1],j=(0,d.useState)(""),C=u()(j,2),w=C[0],Z=C[1];(0,d.useEffect)((function(){Z(n)}),[n]),(0,d.useEffect)((function(){t(w)}),[w]);var S={placeholder:l||"请输入内容...",MENU_CONF:{}};S.MENU_CONF.uploadImage={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(a=new FormData).append("file",e),t.next=4,(0,p.ZP)("/api/attachments.json",{method:"post",body:a},!0);case 4:s=t.sent,n(null==s?void 0:s.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},S.MENU_CONF.uploadVideo={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s,l,i,u,d,m,_,h,v,x,b,g,j;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.size,s=Math.ceil(a/c),t.prev=2,t.next=5,(0,p.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:s,user_id:null==r||null===(l=r.userInfo)||void 0===l?void 0:l.user_id}});case 5:if(0===(null==(u=t.sent)?void 0:u.status)){t.next=8;break}throw new Error;case 8:d=u.upload_id,f.current=new AbortController,m=[],0,_=o()().mark((function n(){var t,s,r,l;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=h*c,s=Math.min(t+c,a),r=e.slice(t,s),(l=new FormData).append("chunk",r),l.append("fileName",e.name),l.append("chunkIndex",(h+1).toString()),l.append("uploadId",d),m.push((function(){return(0,p.ZP)("/api/attachments/multipart_upload",{method:"POST",body:l,signal:f.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),h=0;case 14:if(!(h0)){t.next=29;break}return t.next=27,Promise.all(g);case 27:t.sent,v+=x;case 29:t.next=22;break;case 31:return t.next=33,(0,p.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:s,uploadId:d,user_id:null==r||null===(i=r.userInfo)||void 0===i?void 0:i.user_id}});case 33:j=t.sent,n(null==j?void 0:j.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,d.useEffect)((function(){return function(){null!=b&&(b.destroy(),g(null))}}),[b]),(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)("div",{className:null==_?void 0:_.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,h.jsx)(m.o,{editor:b,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,h.jsx)(m.M,{defaultConfig:S,value:w,onCreated:g,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,"")))?Z(e.getHtml()):Z("")},mode:"default",style:s()({height:"500px",overflowY:"hidden"},a)})]})})}))},4090:function(e,n,t){t.d(n,{Z:function(){return I}});var a=t(7557),s=t.n(a),r=t(41498),o=t.n(r),l=t(82242),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(78241),p=t(8591),f=t(43418),_=t(98135),h=t(88522),v=t(84291),x=t(46651),b=t(87167),g=t(91203),j=t(99232),C=t.n(j),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},Z=t(46165),S=t(44394),N=t(97650),y=t(47192),k=t(37712),I=(0,b.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,a=e.onOk,r=e.onCancel,l=e.title,c=void 0===l?"":l,b=e.coreCurriculum,j=(e.dispatch,b.CoreSubjects,m.Z.useForm()),I=u()(j,1)[0],O=(0,d.useState)(!1),P=u()(O,2),E=P[0],M=P[1],F=(0,d.useState)([]),V=u()(F,2),R=V[0],T=V[1],D=(0,d.useState)(!1),B=u()(D,2),U=B[0],L=B[1],Y=(0,d.useState)([]),W=u()(Y,2),H=W[0],$=W[1],q=(0,d.useState)([]),z=u()(q,2),A=z[0],Q=z[1];(0,d.useEffect)((function(){if(t&&G(),null!=t&&t.id){var e,n;I.setFieldsValue(i()(i()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:C()(null==t?void 0:t.publication_time)}));var a=[i()(i()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];T(a)}}),[t]);var X,G=function(){var e=o()(s()().mark((function e(){var n,t,a,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_default_type:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&Q(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(a=e.sent)?void 0:a.status)&&$(null==a||null===(r=a.data)||void 0===r?void 0:r.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=o()(s()().mark((function e(n){var t,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M(!0),r=i()(i()({},n),{},{attachment_id:(null==R||null===(t=R[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),a(r);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(f.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){r()},confirmLoading:E,okButtonProps:{disabled:U},width:686,afterClose:function(){M(!1),T([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:Z.Z.CustomCss,children:(0,k.jsxs)(m.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:J,className:w.form,children:[(0,k.jsx)(m.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(_.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(m.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==A?void 0:A.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==H?void 0:H.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(m.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(m.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(v.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(m.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(_.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(m.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=R&&null!==(n=R[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==R||null===(X=R[0])||void 0===X||null===(X=X.response)||void 0===X?void 0:X.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(N.Z,{onClick:function(){T([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(x.Z,{fileList:R,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&L(!0),"done"===n.file.status&&L(!1),T(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){T([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(p.ZP.info("文件大小必须小于2MB"),Promise.reject()):(T([]),!0):(p.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(y.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},80946:function(e,n,t){t.r(n),t.d(n,{default:function(){return M}});var a=t(7557),s=t.n(a),r=t(82242),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(43418),p=t(8591),f=t(91203),_="wrap___ieM1S",h="editor___EZPNQ",v="btns___shpJD",x="list___LE_2Q",b="left___rPWHk",g="right___LDk76",j="title___XNk6p",C=t(34654),w=t(4090),Z=t(44394),S=t(47192),N=t(93370),y=t(46165),k=t(87167),I=t(14477),O=t(99232),P=t.n(O),E=t(37712),M=(0,k.connect)((function(e){var n=e.virtualSpaces;return{globalSetting:e.globalSetting,virtualSpaces:n,user:e.user}}))((function(e){e.globalSetting,e.dispatch;var n=e.user,t=e.virtualSpaces,a=(0,k.useParams)().id,r=(0,d.useState)("description"),l=u()(r,2),c=l[0],O=l[1],M=(0,d.useState)({}),F=u()(M,2),V=F[0],R=F[1],T=(0,d.useState)(!0),D=u()(T,2),B=(D[0],D[1]),U=(0,d.useState)(!1),L=u()(U,2),Y=L[0],W=L[1],H=(0,d.useState)(""),$=u()(H,2),q=$[0],z=$[1],A=(0,d.useState)(""),Q=u()(A,2),X=Q[0],G=Q[1],J=(0,d.useRef)(""),K=(0,d.useState)(!1),ee=u()(K,2),ne=ee[0],te=ee[1],ae=(0,d.useState)(!1),se=u()(ae,2),re=se[0],oe=se[1],le=(t.virtualSpacesDetails,V.name),ie=V.attachment,ce=V.author,ue=V.publisher,de=V.number,me=V.publication_time,pe=V.material_type;(0,d.useEffect)((function(){_e()}),[a]),(0,d.useEffect)((function(){he()}),[c]);var fe=function(e){var t;return(0,I.ES)()||(null==n||null===(t=n.userInfo)||void 0===t?void 0:t.user_id)===e},_e=function(){var e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"get"});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&R(o()({},null==n?void 0:n.data)),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=i()(s()().mark((function e(){var n,t,r,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,"/show_desc.json"),{method:"get",params:{column:c}});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&(z((null==n||null===(t=n.data)||void 0===t?void 0:t[c])||""),G((null==n||null===(r=n.data)||void 0===r?void 0:r[c])||""),J.current=(null==n||null===(o=n.data)||void 0===o?void 0:o[c])||""),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=i()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"put",body:o()({material_type:String(pe)},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(_e(),p.ZP.success("编辑成功"),W(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),xe=function(){var e=i()(s()().mark((function e(){var n,t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return oe(!0),(n={})[c]=q,e.next=5,(0,f.ZP)("/api/core_materials/".concat(a,"/update_desc.json"),{method:"put",body:n});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(he(),p.ZP.success("编辑成功"),te(!1)),oe(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)("div",{className:_,children:[(0,E.jsx)(S.qE,{title:"教材详情",onClick:function(){return k.history.push("/textbook")},children:fe(V.user_id)&&(0,E.jsxs)("div",{className:v,children:[(0,E.jsx)("div",{onClick:function(){W(o()({},V))},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})}),(0,E.jsx)("div",{onClick:function(){var e;m.Z.confirm({title:"提示",okText:"确定删除",okButtonProps:{danger:!0},icon:!1,className:y.Z.CustomTipsModalCss,cancelText:"取消",content:(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{children:["确认删除《",le,"》吗?"]}),(0,E.jsx)("div",{className:"mt10",children:"删除后,将无法恢复,请谨慎操作"})]}),onOk:(e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"delete"});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&(p.ZP.success("操作成功"),k.history.push("/textbook"));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:(0,E.jsxs)("span",{className:"delete-hover",children:[" ",(0,E.jsx)("i",{className:"iconfont icon-piliangshanchubeifen font14 mr5"}),"删除"]})})]})}),(0,E.jsxs)("div",{className:x,children:[(0,E.jsx)("div",{className:b,children:(0,E.jsx)("img",{src:Z.Z.API_SERVER+(null==ie?void 0:ie.url)})}),(0,E.jsxs)("div",{className:g,children:[(0,E.jsx)("div",{className:j,children:le}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["作者:",ce]}),(0,E.jsxs)("span",{children:["出版社:",ue]})]}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["ISBN:",de]}),(0,E.jsxs)("span",{children:["出版时间:",me?P()(me).format("YYYY-MM-DD"):"--"]})]})]})]}),(0,E.jsx)(S.YG,{value:c,onChange:function(e){O(e)},tabBarExtraContent:fe(V.user_id)&&(0,E.jsx)("div",{className:v,children:(0,E.jsx)("div",{onClick:function(){te(!0)},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})})}),dataSource:[{id:"description",name:"简介"},{id:"directory",name:"目录"},{id:"foreword",name:"前言"}]}),(0,E.jsx)("div",{className:"mt20",children:ne?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(N.Z,{defaultvalue:X,onChange:function(e){z(e)}}),(0,E.jsx)(S.QD,{confirmTitle:"保存",confirmLoading:re,confirmClick:xe,cancelClick:function(){te(!1),z(J.current)},cancelTitle:"取消",className:"mb25 mt25"})]}):(0,E.jsx)(C.Z,{className:h,value:q})}),(0,E.jsx)(w.Z,{visible:Y,title:"教材",onCancel:function(){return W(!1)},onOk:ve})]})}))},46165:function(e,n){n.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"}},56762:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(59301);function s(){const[,e]=a.useReducer((e=>e+1),0);return e}},57809:function(e,n,t){var a=t(92310),s=t.n(a),r=t(77861),o=t(55405),l=t(59301),i=t(53487),c=t(62892),u=t(19080),d=t(36355),m=t(1684),p=t(93891),f=t(19716),_=t(32441),h=t(33234),v=t(14154),x=t(58582),b=t(84443),g=t(66339),j=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(a=Object.getOwnPropertySymbols(e);s{var t,{prefixCls:a,bordered:i=!0,className:w,rootClassName:Z,getPopupContainer:S,popupClassName:N,dropdownClassName:y,listHeight:k=256,placement:I,listItemHeight:O=24,size:P,disabled:E,notFoundContent:M,status:F,builtinPlacements:V,dropdownMatchSelectWidth:R,popupMatchSelectWidth:T,direction:D,style:B,allowClear:U}=e,L=j(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Y,getPrefixCls:W,renderEmpty:H,direction:$,virtual:q,popupMatchSelectWidth:z,popupOverflow:A,select:Q}=l.useContext(d.E_),X=W("select",a),G=W(),J=null!=D?D:$,{compactSize:K,compactItemClassnames:ee}=(0,h.ri)(X,J),[ne,te]=(0,v.Z)(X),ae=l.useMemo((()=>{const{mode:e}=L;if("combobox"!==e)return e===C?"combobox":e}),[L.mode]),se="multiple"===ae||"tags"===ae,re=(0,b.Z)(L.suffixIcon,L.showArrow),oe=null!==(t=null!=T?T:R)&&void 0!==t?t:z,{status:le,hasFeedback:ie,isFormItemInput:ce,feedbackIcon:ue}=l.useContext(_.aM),de=(0,u.F)(le,F);let me;me=void 0!==M?M:"combobox"===ae?null:(null==H?void 0:H("Select"))||l.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:fe,removeIcon:_e,clearIcon:he}=(0,g.Z)(Object.assign(Object.assign({},L),{multiple:se,hasFeedback:ie,feedbackIcon:ue,showSuffixIcon:re,prefixCls:X,showArrow:L.showArrow,componentName:"Select"})),ve=!0===U?{clearIcon:he}:U,xe=(0,o.Z)(L,["suffixIcon","itemIcon"]),be=s()(N||y,{[`${X}-dropdown-${J}`]:"rtl"===J},Z,te),ge=(0,f.Z)((e=>{var n;return null!==(n=null!=P?P:K)&&void 0!==n?n:e})),je=l.useContext(m.Z),Ce=null!=E?E:je,we=s()({[`${X}-lg`]:"large"===ge,[`${X}-sm`]:"small"===ge,[`${X}-rtl`]:"rtl"===J,[`${X}-borderless`]:!i,[`${X}-in-form-item`]:ce},(0,u.Z)(X,de,ie),ee,null==Q?void 0:Q.className,w,Z,te),Ze=l.useMemo((()=>void 0!==I?I:"rtl"===J?"bottomRight":"bottomLeft"),[I,J]),Se=(0,x.Z)(V,A);return ne(l.createElement(r.ZP,Object.assign({ref:n,virtual:q,showSearch:null==Q?void 0:Q.showSearch},xe,{style:Object.assign(Object.assign({},null==Q?void 0:Q.style),B),dropdownMatchSelectWidth:oe,builtinPlacements:Se,transitionName:(0,c.m)(G,"slide-up",L.transitionName),listHeight:k,listItemHeight:O,mode:ae,prefixCls:X,placement:Ze,direction:J,suffixIcon:pe,menuItemSelectedIcon:fe,removeIcon:_e,allowClear:ve,notFoundContent:me,className:we,getPopupContainer:S||Y,dropdownClassName:be,disabled:Ce})))};const Z=l.forwardRef(w),S=(0,i.Z)(Z);Z.SECRET_COMBOBOX_MODE_DO_NOT_USE=C,Z.Option=r.Wx,Z.OptGroup=r.Xo,Z._InternalPanelDoNotUseOrYouWillBeFired=S,n.default=Z}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[25713],{93370:function(e,n,t){t.d(n,{Z:function(){return v}});var a=t(82242),s=t.n(a),r=t(7557),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(84686),p=t(91203),f=t(87167),_=(t(6234),{editor_css:"editor_css___cm3Z8"}),h=t(37712),v=(0,f.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,a=e.style,r=e.user,l=e.placeholder,c=2097152,f=(0,d.useRef)(null),v=(0,d.useState)(null),x=u()(v,2),b=x[0],g=x[1],j=(0,d.useState)(""),C=u()(j,2),w=C[0],Z=C[1];(0,d.useEffect)((function(){Z(n)}),[n]),(0,d.useEffect)((function(){t(w)}),[w]);var S={placeholder:l||"请输入内容...",MENU_CONF:{}};S.MENU_CONF.uploadImage={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(a=new FormData).append("file",e),t.next=4,(0,p.ZP)("/api/attachments.json",{method:"post",body:a},!0);case 4:s=t.sent,n(null==s?void 0:s.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},S.MENU_CONF.uploadVideo={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s,l,i,u,d,m,_,h,v,x,b,g,j;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.size,s=Math.ceil(a/c),t.prev=2,t.next=5,(0,p.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:s,user_id:null==r||null===(l=r.userInfo)||void 0===l?void 0:l.user_id}});case 5:if(0===(null==(u=t.sent)?void 0:u.status)){t.next=8;break}throw new Error;case 8:d=u.upload_id,f.current=new AbortController,m=[],0,_=o()().mark((function n(){var t,s,r,l;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=h*c,s=Math.min(t+c,a),r=e.slice(t,s),(l=new FormData).append("chunk",r),l.append("fileName",e.name),l.append("chunkIndex",(h+1).toString()),l.append("uploadId",d),m.push((function(){return(0,p.ZP)("/api/attachments/multipart_upload",{method:"POST",body:l,signal:f.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),h=0;case 14:if(!(h0)){t.next=29;break}return t.next=27,Promise.all(g);case 27:t.sent,v+=x;case 29:t.next=22;break;case 31:return t.next=33,(0,p.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:s,uploadId:d,user_id:null==r||null===(i=r.userInfo)||void 0===i?void 0:i.user_id}});case 33:j=t.sent,n(null==j?void 0:j.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,d.useEffect)((function(){return function(){null!=b&&(b.destroy(),g(null))}}),[b]),(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)("div",{className:null==_?void 0:_.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,h.jsx)(m.o,{editor:b,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,h.jsx)(m.M,{defaultConfig:S,value:w,onCreated:g,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,"")))?Z(e.getHtml()):Z("")},mode:"default",style:s()({height:"500px",overflowY:"hidden"},a)})]})})}))},4090:function(e,n,t){t.d(n,{Z:function(){return I}});var a=t(7557),s=t.n(a),r=t(41498),o=t.n(r),l=t(82242),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(78241),p=t(8591),f=t(43418),_=t(98135),h=t(88522),v=t(84291),x=t(46651),b=t(87167),g=t(91203),j=t(99232),C=t.n(j),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},Z=t(46165),S=t(44394),N=t(97650),y=t(47192),k=t(37712),I=(0,b.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,a=e.onOk,r=e.onCancel,l=e.title,c=void 0===l?"":l,b=e.coreCurriculum,j=(e.dispatch,b.CoreSubjects,m.Z.useForm()),I=u()(j,1)[0],O=(0,d.useState)(!1),P=u()(O,2),E=P[0],M=P[1],F=(0,d.useState)([]),V=u()(F,2),R=V[0],T=V[1],D=(0,d.useState)(!1),B=u()(D,2),U=B[0],L=B[1],Y=(0,d.useState)([]),W=u()(Y,2),H=W[0],$=W[1],q=(0,d.useState)([]),z=u()(q,2),A=z[0],Q=z[1];(0,d.useEffect)((function(){if(t&&G(),null!=t&&t.id){var e,n;I.setFieldsValue(i()(i()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:null!=t&&t.publication_time?C()(null==t?void 0:t.publication_time):""}));var a=[i()(i()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];T(a)}}),[t]);var X,G=function(){var e=o()(s()().mark((function e(){var n,t,a,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_default_type:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&Q(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(a=e.sent)?void 0:a.status)&&$(null==a||null===(r=a.data)||void 0===r?void 0:r.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=o()(s()().mark((function e(n){var t,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M(!0),r=i()(i()({},n),{},{attachment_id:(null==R||null===(t=R[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),a(r);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(f.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){r()},confirmLoading:E,okButtonProps:{disabled:U},width:686,afterClose:function(){M(!1),T([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:Z.Z.CustomCss,children:(0,k.jsxs)(m.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:J,className:w.form,children:[(0,k.jsx)(m.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(_.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(m.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==A?void 0:A.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==H?void 0:H.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(m.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(m.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(v.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(m.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(_.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(m.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=R&&null!==(n=R[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==R||null===(X=R[0])||void 0===X||null===(X=X.response)||void 0===X?void 0:X.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(N.Z,{onClick:function(){T([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(x.Z,{fileList:R,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&L(!0),"done"===n.file.status&&L(!1),T(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){T([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(p.ZP.info("文件大小必须小于2MB"),Promise.reject()):(T([]),!0):(p.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(y.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},80946:function(e,n,t){t.r(n),t.d(n,{default:function(){return M}});var a=t(7557),s=t.n(a),r=t(82242),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(43418),p=t(8591),f=t(91203),_="wrap___ieM1S",h="editor___EZPNQ",v="btns___shpJD",x="list___LE_2Q",b="left___rPWHk",g="right___LDk76",j="title___XNk6p",C=t(34654),w=t(4090),Z=t(44394),S=t(47192),N=t(93370),y=t(46165),k=t(87167),I=t(14477),O=t(99232),P=t.n(O),E=t(37712),M=(0,k.connect)((function(e){var n=e.virtualSpaces;return{globalSetting:e.globalSetting,virtualSpaces:n,user:e.user}}))((function(e){e.globalSetting,e.dispatch;var n=e.user,t=e.virtualSpaces,a=(0,k.useParams)().id,r=(0,d.useState)("description"),l=u()(r,2),c=l[0],O=l[1],M=(0,d.useState)({}),F=u()(M,2),V=F[0],R=F[1],T=(0,d.useState)(!0),D=u()(T,2),B=(D[0],D[1]),U=(0,d.useState)(!1),L=u()(U,2),Y=L[0],W=L[1],H=(0,d.useState)(""),$=u()(H,2),q=$[0],z=$[1],A=(0,d.useState)(""),Q=u()(A,2),X=Q[0],G=Q[1],J=(0,d.useRef)(""),K=(0,d.useState)(!1),ee=u()(K,2),ne=ee[0],te=ee[1],ae=(0,d.useState)(!1),se=u()(ae,2),re=se[0],oe=se[1],le=(t.virtualSpacesDetails,V.name),ie=V.attachment,ce=V.author,ue=V.publisher,de=V.number,me=V.publication_time,pe=V.material_type;(0,d.useEffect)((function(){_e()}),[a]),(0,d.useEffect)((function(){he()}),[c]);var fe=function(e){var t;return(0,I.ES)()||(null==n||null===(t=n.userInfo)||void 0===t?void 0:t.user_id)===e},_e=function(){var e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"get"});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&R(o()({},null==n?void 0:n.data)),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=i()(s()().mark((function e(){var n,t,r,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,"/show_desc.json"),{method:"get",params:{column:c}});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&(z((null==n||null===(t=n.data)||void 0===t?void 0:t[c])||""),G((null==n||null===(r=n.data)||void 0===r?void 0:r[c])||""),J.current=(null==n||null===(o=n.data)||void 0===o?void 0:o[c])||""),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=i()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"put",body:o()({material_type:String(pe)},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(_e(),p.ZP.success("编辑成功"),W(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),xe=function(){var e=i()(s()().mark((function e(){var n,t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return oe(!0),(n={})[c]=q,e.next=5,(0,f.ZP)("/api/core_materials/".concat(a,"/update_desc.json"),{method:"put",body:n});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(he(),p.ZP.success("编辑成功"),te(!1)),oe(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)("div",{className:_,children:[(0,E.jsx)(S.qE,{title:"教材详情",onClick:function(){return k.history.push("/textbook")},children:fe(V.user_id)&&(0,E.jsxs)("div",{className:v,children:[(0,E.jsx)("div",{onClick:function(){W(o()({},V))},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})}),(0,E.jsx)("div",{onClick:function(){var e;m.Z.confirm({title:"提示",okText:"确定删除",okButtonProps:{danger:!0},icon:!1,className:y.Z.CustomTipsModalCss,cancelText:"取消",content:(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{children:["确认删除《",le,"》吗?"]}),(0,E.jsx)("div",{className:"mt10",children:"删除后,将无法恢复,请谨慎操作"})]}),onOk:(e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"delete"});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&(p.ZP.success("操作成功"),k.history.push("/textbook"));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:(0,E.jsxs)("span",{className:"delete-hover",children:[" ",(0,E.jsx)("i",{className:"iconfont icon-piliangshanchubeifen font14 mr5"}),"删除"]})})]})}),(0,E.jsxs)("div",{className:x,children:[(0,E.jsx)("div",{className:b,children:(0,E.jsx)("img",{src:Z.Z.API_SERVER+(null==ie?void 0:ie.url)})}),(0,E.jsxs)("div",{className:g,children:[(0,E.jsx)("div",{className:j,children:le}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["作者:",ce]}),(0,E.jsxs)("span",{children:["出版社:",ue]})]}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["ISBN:",de]}),(0,E.jsxs)("span",{children:["出版时间:",me?P()(me).format("YYYY-MM-DD"):"--"]})]})]})]}),(0,E.jsx)(S.YG,{value:c,onChange:function(e){O(e)},tabBarExtraContent:fe(V.user_id)&&(0,E.jsx)("div",{className:v,children:(0,E.jsx)("div",{onClick:function(){te(!0)},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})})}),dataSource:[{id:"description",name:"简介"},{id:"directory",name:"目录"},{id:"foreword",name:"前言"}]}),(0,E.jsx)("div",{className:"mt20",children:ne?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(N.Z,{defaultvalue:X,onChange:function(e){z(e)}}),(0,E.jsx)(S.QD,{confirmTitle:"保存",confirmLoading:re,confirmClick:xe,cancelClick:function(){te(!1),z(J.current)},cancelTitle:"取消",className:"mb25 mt25"})]}):(0,E.jsx)(C.Z,{className:h,value:q})}),(0,E.jsx)(w.Z,{visible:Y,title:"教材",onCancel:function(){return W(!1)},onOk:ve})]})}))},46165:function(e,n){n.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"}},56762:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(59301);function s(){const[,e]=a.useReducer((e=>e+1),0);return e}},57809:function(e,n,t){var a=t(92310),s=t.n(a),r=t(77861),o=t(55405),l=t(59301),i=t(53487),c=t(62892),u=t(19080),d=t(36355),m=t(1684),p=t(93891),f=t(19716),_=t(32441),h=t(33234),v=t(14154),x=t(58582),b=t(84443),g=t(66339),j=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(a=Object.getOwnPropertySymbols(e);s{var t,{prefixCls:a,bordered:i=!0,className:w,rootClassName:Z,getPopupContainer:S,popupClassName:N,dropdownClassName:y,listHeight:k=256,placement:I,listItemHeight:O=24,size:P,disabled:E,notFoundContent:M,status:F,builtinPlacements:V,dropdownMatchSelectWidth:R,popupMatchSelectWidth:T,direction:D,style:B,allowClear:U}=e,L=j(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Y,getPrefixCls:W,renderEmpty:H,direction:$,virtual:q,popupMatchSelectWidth:z,popupOverflow:A,select:Q}=l.useContext(d.E_),X=W("select",a),G=W(),J=null!=D?D:$,{compactSize:K,compactItemClassnames:ee}=(0,h.ri)(X,J),[ne,te]=(0,v.Z)(X),ae=l.useMemo((()=>{const{mode:e}=L;if("combobox"!==e)return e===C?"combobox":e}),[L.mode]),se="multiple"===ae||"tags"===ae,re=(0,b.Z)(L.suffixIcon,L.showArrow),oe=null!==(t=null!=T?T:R)&&void 0!==t?t:z,{status:le,hasFeedback:ie,isFormItemInput:ce,feedbackIcon:ue}=l.useContext(_.aM),de=(0,u.F)(le,F);let me;me=void 0!==M?M:"combobox"===ae?null:(null==H?void 0:H("Select"))||l.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:fe,removeIcon:_e,clearIcon:he}=(0,g.Z)(Object.assign(Object.assign({},L),{multiple:se,hasFeedback:ie,feedbackIcon:ue,showSuffixIcon:re,prefixCls:X,showArrow:L.showArrow,componentName:"Select"})),ve=!0===U?{clearIcon:he}:U,xe=(0,o.Z)(L,["suffixIcon","itemIcon"]),be=s()(N||y,{[`${X}-dropdown-${J}`]:"rtl"===J},Z,te),ge=(0,f.Z)((e=>{var n;return null!==(n=null!=P?P:K)&&void 0!==n?n:e})),je=l.useContext(m.Z),Ce=null!=E?E:je,we=s()({[`${X}-lg`]:"large"===ge,[`${X}-sm`]:"small"===ge,[`${X}-rtl`]:"rtl"===J,[`${X}-borderless`]:!i,[`${X}-in-form-item`]:ce},(0,u.Z)(X,de,ie),ee,null==Q?void 0:Q.className,w,Z,te),Ze=l.useMemo((()=>void 0!==I?I:"rtl"===J?"bottomRight":"bottomLeft"),[I,J]),Se=(0,x.Z)(V,A);return ne(l.createElement(r.ZP,Object.assign({ref:n,virtual:q,showSearch:null==Q?void 0:Q.showSearch},xe,{style:Object.assign(Object.assign({},null==Q?void 0:Q.style),B),dropdownMatchSelectWidth:oe,builtinPlacements:Se,transitionName:(0,c.m)(G,"slide-up",L.transitionName),listHeight:k,listItemHeight:O,mode:ae,prefixCls:X,placement:Ze,direction:J,suffixIcon:pe,menuItemSelectedIcon:fe,removeIcon:_e,allowClear:ve,notFoundContent:me,className:we,getPopupContainer:S||Y,dropdownClassName:be,disabled:Ce})))};const Z=l.forwardRef(w),S=(0,i.Z)(Z);Z.SECRET_COMBOBOX_MODE_DO_NOT_USE=C,Z.Option=r.Wx,Z.OptGroup=r.Xo,Z._InternalPanelDoNotUseOrYouWillBeFired=S,n.default=Z}}]); \ No newline at end of file diff --git a/p__Textbook__Index__index.async.js b/p__Textbook__Index__index.async.js index f089f5364c..e6242e7b24 100644 --- a/p__Textbook__Index__index.async.js +++ b/p__Textbook__Index__index.async.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4350],{4090:function(e,n,t){t.d(n,{Z:function(){return I}});var a=t(7557),i=t.n(a),l=t(41498),s=t.n(l),r=t(82242),o=t.n(r),c=t(79800),u=t.n(c),d=t(59301),_=t(78241),m=t(8591),p=t(43418),x=t(98135),h=t(88522),f=t(84291),v=t(46651),j=t(87167),g=t(91203),b=t(99232),Z=t.n(b),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},y=t(46165),S=t(44394),C=t(97650),N=t(47192),k=t(37712),I=(0,j.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,a=e.onOk,l=e.onCancel,r=e.title,c=void 0===r?"":r,j=e.coreCurriculum,b=(e.dispatch,j.CoreSubjects,_.Z.useForm()),I=u()(b,1)[0],P=(0,d.useState)(!1),V=u()(P,2),M=V[0],Y=V[1],E=(0,d.useState)([]),F=u()(E,2),L=F[0],O=F[1],B=(0,d.useState)(!1),D=u()(B,2),R=D[0],q=D[1],U=(0,d.useState)([]),z=u()(U,2),W=z[0],A=z[1],T=(0,d.useState)([]),J=u()(T,2),Q=J[0],G=J[1];(0,d.useEffect)((function(){if(t&&X(),null!=t&&t.id){var e,n;I.setFieldsValue(o()(o()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:Z()(null==t?void 0:t.publication_time)}));var a=[o()(o()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];O(a)}}),[t]);var H,X=function(){var e=s()(i()().mark((function e(){var n,t,a,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_default_type:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&G(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(a=e.sent)?void 0:a.status)&&A(null==a||null===(l=a.data)||void 0===l?void 0:l.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=s()(i()().mark((function e(n){var t,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Y(!0),l=o()(o()({},n),{},{attachment_id:(null==L||null===(t=L[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),a(l);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(p.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){l()},confirmLoading:M,okButtonProps:{disabled:R},width:686,afterClose:function(){Y(!1),O([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:y.Z.CustomCss,children:(0,k.jsxs)(_.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:K,className:w.form,children:[(0,k.jsx)(_.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(x.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(_.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==Q?void 0:Q.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==W?void 0:W.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(_.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(_.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(f.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(_.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(x.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(_.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=L&&null!==(n=L[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==L||null===(H=L[0])||void 0===H||null===(H=H.response)||void 0===H?void 0:H.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(C.Z,{onClick:function(){O([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(v.Z,{fileList:L,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&q(!0),"done"===n.file.status&&q(!1),O(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){O([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(m.ZP.info("文件大小必须小于2MB"),Promise.reject()):(O([]),!0):(m.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(N.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},31472:function(e,n,t){t.r(n),t.d(n,{default:function(){return z}});var a=t(37205),i=t.n(a),l=t(82242),s=t.n(l),r=t(7557),o=t.n(r),c=t(41498),u=t.n(c),d=t(79800),_=t.n(d),m=t(59301),p=t(87167),x=t(95237),h=t(43604),f=t(3113),v=t(98135),j=t(56511),g=t(6848),b=t(53864),Z="Bg___AHmvi",w="DivDownPlay___IUWWX",y="type___yDlx4",S="type_item_active___b785N",C="type_item___Bqpts",N="list___hrLrx",k="left___laOeV",I="right___oUOE7",P="title___inYm8",V="des___AgPJF",M="search___USD4q",Y="searchIcon___uL435",E=t(2006),F=t(44394),L=t(14477),O=t(91203),B=t(34654),D=t(4090),R=t(99232),q=t.n(R),U=t(37712),z=(0,p.connect)((function(e){var n=e.user,t=e.globalSetting,a=e.coreCurriculum;return{user:n,globalSetting:t,virtualSpaces:e.virtualSpaces,coreCurriculum:a}}))((function(e){var n,t,a,l=e.coreCurriculum,r=(e.dispatch,e.virtualSpaces,e.globalSetting),c=(l.CoreSubjects,(0,m.useState)({page:1,limit:10})),d=_()(c,2),R=d[0],z=d[1],W=(0,m.useState)(0),A=_()(W,2),T=A[0],J=A[1],Q=(0,m.useState)(!0),G=_()(Q,2),H=G[0],X=G[1],K=(0,m.useState)(""),$=_()(K,2),ee=$[0],ne=$[1],te=(0,m.useState)(!1),ae=_()(te,2),ie=ae[0],le=ae[1],se=(0,m.useState)([]),re=_()(se,2),oe=re[0],ce=re[1],ue=(0,m.useState)([]),de=_()(ue,2),_e=de[0],me=de[1],pe=(0,m.useState)("全部"),xe=_()(pe,2),he=xe[0],fe=xe[1],ve=(0,m.useState)([]),je=_()(ve,2),ge=je[0],be=je[1],Ze=(0,m.useState)("全部"),we=_()(Ze,2),ye=we[0],Se=we[1];(0,m.useEffect)((function(){Ce()}),[]),(0,m.useEffect)((function(){Ne(!0)}),[he,ye]);var Ce=function(){var e=u()(o()().mark((function e(){var n,t,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return X(!0),e.next=3,(0,O.ZP)("/api/core_materials/material_type_name_list.json",{method:"get"});case 3:return 0==(null==(n=e.sent)?void 0:n.status)&&be(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=7,(0,O.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get"});case 7:0==(null==(a=e.sent)?void 0:a.status)&&me(null==a||null===(i=a.data)||void 0===i?void 0:i.list),X(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=u()(o()().mark((function e(){var n,t,a,i,l=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>0&&void 0!==l[0]&&l[0],X(!0),n&&(R.page=1,z(s()({},R))),e.next=5,(0,O.ZP)("/api/core_materials/list.json",{method:"get",params:s()({material_type_name:ye,keyword:ee,core_subject_name:he},R)});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(ce((null==t||null===(a=t.data)||void 0===a?void 0:a.list)||[]),J(null==t||null===(i=t.data)||void 0===i?void 0:i.count)),X(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=u()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,O.ZP)("/api/core_materials.json",{method:"post",body:s()({},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(Ne(),Ce(),le(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)("section",{children:[(0,U.jsx)("div",{className:"".concat(Z),style:{width:"100%",height:168,backgroundImage:"url(".concat(F.Z.IMG_SERVER,"/").concat(null==r||null===(n=r.setting)||void 0===n?void 0:n.textbook_banner_url,")")},children:(0,U.jsxs)(x.Z,{style:{width:1200,height:"100%",margin:"0 auto"},align:"middle",justify:"space-between",wrap:!1,children:[(0,U.jsxs)(h.Z,{children:[(0,U.jsx)("div",{style:{color:"#fff",fontSize:"30px",letterSpacing:"5px",fontWeight:600},children:"核心教材"}),(0,L.Ny)()&&(0,U.jsx)(f.ZP,{className:"mt25 ".concat(w),icon:(0,U.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249"}),onClick:function(){le(!0)},children:"新建核心教材"})]}),(0,U.jsx)(v.Z.Search,{placeholder:"请输入关键字进行搜索",size:"large",className:M,value:ee,onChange:function(e){ne(e.target.value)},onSearch:function(e){ne(e)},suffix:(0,U.jsx)("i",{className:"iconfont icon-sousuo9 font14 ".concat(Y),onClick:function(){ne(ee),z(s()(s()({},R),{},{page:1})),Ne(!0)}})})]})}),(0,U.jsxs)("div",{style:{width:1200,margin:"0 auto",background:"#fff",paddingBottom:"10px"},children:[(0,U.jsxs)("div",{style:{paddingTop:"20px"},children:[(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"课程"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(t=["全部"].concat(i()(_e)))||void 0===t?void 0:t.map((function(e,n){return(0,U.jsx)("div",{className:he==e?S:C,style:{marginBottom:"10px"},onClick:function(){fe(e)},children:e},n)}))})]}),(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"类型"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(a=["全部"].concat(i()(ge)))||void 0===a?void 0:a.map((function(e,n){return(0,U.jsx)("div",{className:ye==e?S:C,onClick:function(){Se(e)},children:e},n)}))})]})]}),(0,U.jsxs)(j.Z,{className:"mt20",loading:H,children:[!oe.length&&(0,U.jsx)(E.Z,{}),oe.map((function(e){var n=e.name,t=e.id,a=e.attachment,i=e.author,l=e.publisher,s=e.number,r=e.publication_time,o=e.description;return(0,U.jsxs)("div",{className:N,onClick:function(){return p.history.push("/textbook/detail/".concat(t))},children:[(0,U.jsx)("div",{className:k,children:(0,U.jsx)("img",{src:F.Z.API_SERVER+(null==a?void 0:a.url)})}),(0,U.jsxs)("div",{className:I,children:[(0,U.jsx)(g.Z,{title:n,children:(0,U.jsx)("div",{className:P,children:n})}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"作者:".concat(i),children:(0,U.jsxs)("span",{children:["作者:",i]})}),(0,U.jsx)(g.Z,{title:"出版社:".concat(l),children:(0,U.jsxs)("span",{children:["出版社:",l]})})]}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"ISBN:".concat(s),children:(0,U.jsxs)("span",{children:["ISBN:",s]})}),(0,U.jsx)(g.Z,{title:"出版时间:".concat(q()(r).format("YYYY-MM-DD")),children:(0,U.jsxs)("span",{children:["出版时间:",r?q()(r).format("YYYY-MM-DD"):"--"]})})]}),(0,U.jsx)("div",{className:V,children:(0,U.jsx)(B.Z,{showTextOnly:!0,showLines:3,value:o||""})})]})]},t)}))]}),(0,U.jsxs)(x.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:1200,margin:"20px auto",padding:"0 20px"},children:[(0,U.jsxs)(h.Z,{children:["共 ",(0,U.jsx)("span",{style:{color:"#165DFF"},children:T||0})," 条数据"]}),(0,U.jsx)(h.Z,{children:(0,U.jsx)(b.Z,{showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,current:R.page,pageSize:R.limit,onChange:function(e,n){R.page=e,z(s()({},R)),Ne()},total:T||0})})]}),(0,U.jsx)(D.Z,{visible:ie,title:"教材",onCancel:function(){return le(!1)},onOk:ke})]})]})}))},46165:function(e,n){n.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"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4350],{4090:function(e,n,t){t.d(n,{Z:function(){return I}});var i=t(7557),a=t.n(i),l=t(41498),s=t.n(l),r=t(82242),o=t.n(r),c=t(79800),u=t.n(c),d=t(59301),_=t(78241),m=t(8591),p=t(43418),x=t(98135),h=t(88522),f=t(84291),v=t(46651),j=t(87167),g=t(91203),b=t(99232),Z=t.n(b),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},y=t(46165),S=t(44394),C=t(97650),N=t(47192),k=t(37712),I=(0,j.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,i=e.onOk,l=e.onCancel,r=e.title,c=void 0===r?"":r,j=e.coreCurriculum,b=(e.dispatch,j.CoreSubjects,_.Z.useForm()),I=u()(b,1)[0],P=(0,d.useState)(!1),V=u()(P,2),M=V[0],Y=V[1],E=(0,d.useState)([]),F=u()(E,2),L=F[0],O=F[1],B=(0,d.useState)(!1),D=u()(B,2),R=D[0],q=D[1],U=(0,d.useState)([]),z=u()(U,2),W=z[0],A=z[1],T=(0,d.useState)([]),J=u()(T,2),Q=J[0],G=J[1];(0,d.useEffect)((function(){if(t&&X(),null!=t&&t.id){var e,n;I.setFieldsValue(o()(o()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:null!=t&&t.publication_time?Z()(null==t?void 0:t.publication_time):""}));var i=[o()(o()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];O(i)}}),[t]);var H,X=function(){var e=s()(a()().mark((function e(){var n,t,i,l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_default_type:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&G(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(i=e.sent)?void 0:i.status)&&A(null==i||null===(l=i.data)||void 0===l?void 0:l.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=s()(a()().mark((function e(n){var t,l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Y(!0),l=o()(o()({},n),{},{attachment_id:(null==L||null===(t=L[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),i(l);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(p.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){l()},confirmLoading:M,okButtonProps:{disabled:R},width:686,afterClose:function(){Y(!1),O([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:y.Z.CustomCss,children:(0,k.jsxs)(_.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:K,className:w.form,children:[(0,k.jsx)(_.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(x.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(_.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==Q?void 0:Q.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==W?void 0:W.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&I.setFieldValue("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(_.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(_.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(f.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(_.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(x.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(_.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=L&&null!==(n=L[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==L||null===(H=L[0])||void 0===H||null===(H=H.response)||void 0===H?void 0:H.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(C.Z,{onClick:function(){O([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(v.Z,{fileList:L,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&q(!0),"done"===n.file.status&&q(!1),O(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){O([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(m.ZP.info("文件大小必须小于2MB"),Promise.reject()):(O([]),!0):(m.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(N.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},31472:function(e,n,t){t.r(n),t.d(n,{default:function(){return z}});var i=t(37205),a=t.n(i),l=t(82242),s=t.n(l),r=t(7557),o=t.n(r),c=t(41498),u=t.n(c),d=t(79800),_=t.n(d),m=t(59301),p=t(87167),x=t(95237),h=t(43604),f=t(3113),v=t(98135),j=t(56511),g=t(6848),b=t(53864),Z="Bg___AHmvi",w="DivDownPlay___IUWWX",y="type___yDlx4",S="type_item_active___b785N",C="type_item___Bqpts",N="list___hrLrx",k="left___laOeV",I="right___oUOE7",P="title___inYm8",V="des___AgPJF",M="search___USD4q",Y="searchIcon___uL435",E=t(2006),F=t(44394),L=t(14477),O=t(91203),B=t(34654),D=t(4090),R=t(99232),q=t.n(R),U=t(37712),z=(0,p.connect)((function(e){var n=e.user,t=e.globalSetting,i=e.coreCurriculum;return{user:n,globalSetting:t,virtualSpaces:e.virtualSpaces,coreCurriculum:i}}))((function(e){var n,t,i,l=e.coreCurriculum,r=(e.dispatch,e.virtualSpaces,e.globalSetting),c=(l.CoreSubjects,(0,m.useState)({page:1,limit:10})),d=_()(c,2),R=d[0],z=d[1],W=(0,m.useState)(0),A=_()(W,2),T=A[0],J=A[1],Q=(0,m.useState)(!0),G=_()(Q,2),H=G[0],X=G[1],K=(0,m.useState)(""),$=_()(K,2),ee=$[0],ne=$[1],te=(0,m.useState)(!1),ie=_()(te,2),ae=ie[0],le=ie[1],se=(0,m.useState)([]),re=_()(se,2),oe=re[0],ce=re[1],ue=(0,m.useState)([]),de=_()(ue,2),_e=de[0],me=de[1],pe=(0,m.useState)("全部"),xe=_()(pe,2),he=xe[0],fe=xe[1],ve=(0,m.useState)([]),je=_()(ve,2),ge=je[0],be=je[1],Ze=(0,m.useState)("全部"),we=_()(Ze,2),ye=we[0],Se=we[1];(0,m.useEffect)((function(){Ce()}),[]),(0,m.useEffect)((function(){Ne(!0)}),[he,ye]);var Ce=function(){var e=u()(o()().mark((function e(){var n,t,i,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return X(!0),e.next=3,(0,O.ZP)("/api/core_materials/material_type_name_list.json",{method:"get"});case 3:return 0==(null==(n=e.sent)?void 0:n.status)&&be(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=7,(0,O.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get"});case 7:0==(null==(i=e.sent)?void 0:i.status)&&me(null==i||null===(a=i.data)||void 0===a?void 0:a.list),X(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=u()(o()().mark((function e(){var n,t,i,a,l=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>0&&void 0!==l[0]&&l[0],X(!0),n&&(R.page=1,z(s()({},R))),e.next=5,(0,O.ZP)("/api/core_materials/list.json",{method:"get",params:s()({material_type_name:ye,keyword:ee,core_subject_name:he},R)});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(ce((null==t||null===(i=t.data)||void 0===i?void 0:i.list)||[]),J(null==t||null===(a=t.data)||void 0===a?void 0:a.count)),X(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=u()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,O.ZP)("/api/core_materials.json",{method:"post",body:s()({},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(Ne(),Ce(),le(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)("section",{children:[(0,U.jsx)("div",{className:"".concat(Z),style:{width:"100%",height:168,backgroundImage:"url(".concat(F.Z.IMG_SERVER,"/").concat(null==r||null===(n=r.setting)||void 0===n?void 0:n.textbook_banner_url,")")},children:(0,U.jsxs)(x.Z,{style:{width:1200,height:"100%",margin:"0 auto"},align:"middle",justify:"space-between",wrap:!1,children:[(0,U.jsxs)(h.Z,{children:[(0,U.jsx)("div",{style:{color:"#fff",fontSize:"30px",letterSpacing:"5px",fontWeight:600},children:"核心教材"}),(0,L.Ny)()&&(0,U.jsx)(f.ZP,{className:"mt25 ".concat(w),icon:(0,U.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249"}),onClick:function(){le(!0)},children:"新建核心教材"})]}),(0,U.jsx)(v.Z.Search,{placeholder:"请输入关键字进行搜索",size:"large",className:M,value:ee,onChange:function(e){ne(e.target.value)},onSearch:function(e){ne(e)},suffix:(0,U.jsx)("i",{className:"iconfont icon-sousuo9 font14 ".concat(Y),onClick:function(){ne(ee),z(s()(s()({},R),{},{page:1})),Ne(!0)}})})]})}),(0,U.jsxs)("div",{style:{width:1200,margin:"0 auto",background:"#fff",paddingBottom:"10px"},children:[(0,U.jsxs)("div",{style:{paddingTop:"20px"},children:[(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"课程"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(t=["全部"].concat(a()(_e)))||void 0===t?void 0:t.map((function(e,n){return(0,U.jsx)("div",{className:he==e?S:C,style:{marginBottom:"10px"},onClick:function(){fe(e)},children:e},n)}))})]}),(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"类型"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(i=["全部"].concat(a()(ge)))||void 0===i?void 0:i.map((function(e,n){return(0,U.jsx)("div",{className:ye==e?S:C,onClick:function(){Se(e)},children:e},n)}))})]})]}),(0,U.jsxs)(j.Z,{className:"mt20",loading:H,children:[!oe.length&&(0,U.jsx)(E.Z,{}),oe.map((function(e){var n=e.name,t=e.id,i=e.attachment,a=e.author,l=e.publisher,s=e.number,r=e.publication_time,o=e.description;return(0,U.jsxs)("div",{className:N,onClick:function(){return p.history.push("/textbook/detail/".concat(t))},children:[(0,U.jsx)("div",{className:k,children:(0,U.jsx)("img",{src:F.Z.API_SERVER+(null==i?void 0:i.url)})}),(0,U.jsxs)("div",{className:I,children:[(0,U.jsx)(g.Z,{title:n,children:(0,U.jsx)("div",{className:P,children:n})}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"作者:".concat(a),children:(0,U.jsxs)("span",{children:["作者:",a]})}),(0,U.jsx)(g.Z,{title:"出版社:".concat(l),children:(0,U.jsxs)("span",{children:["出版社:",l]})})]}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"ISBN:".concat(s),children:(0,U.jsxs)("span",{children:["ISBN:",s]})}),(0,U.jsx)(g.Z,{title:"出版时间:".concat(q()(r).format("YYYY-MM-DD")),children:(0,U.jsxs)("span",{children:["出版时间:",r?q()(r).format("YYYY-MM-DD"):"--"]})})]}),(0,U.jsx)("div",{className:V,children:(0,U.jsx)(B.Z,{showTextOnly:!0,showLines:3,value:o||""})})]})]},t)}))]}),(0,U.jsxs)(x.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:1200,margin:"20px auto",padding:"0 20px"},children:[(0,U.jsxs)(h.Z,{children:["共 ",(0,U.jsx)("span",{style:{color:"#165DFF"},children:T||0})," 条数据"]}),(0,U.jsx)(h.Z,{children:(0,U.jsx)(b.Z,{showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,current:R.page,pageSize:R.limit,onChange:function(e,n){R.page=e,z(s()({},R)),Ne()},total:T||0})})]}),(0,U.jsx)(D.Z,{visible:ae,title:"教材",onCancel:function(){return le(!1)},onOk:ke})]})]})}))},46165:function(e,n){n.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"}}}]); \ No newline at end of file