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

1 line
6.3 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[96300],{31253:function(e,n,o){o.r(n),o.d(n,{default:function(){return F}});var r=o(27223),t=o.n(r),c=o(59301),i=o(22211),s=o(44e3),a=o(10574),u=o.n(a),l=o(39343),d=o.n(l),p=o(26801),m=o.n(p),f=o(11006),v=o.n(f),y=o(78241),h=o(95237),x=o(43604),C=o(43418),j=o(8591),N="Bg___y3IeD",g="TitleStyle___n0xLC",k=o(1255),b=o(58696),w=o(37712),_=(0,i.connect)((function(e){var n=e.user,o=e.loading;return{user:n,coreCurriculum:e.coreCurriculum,loading:o}}))((function(e){var n,r=e.coreCurriculum,t=e.loading,s=e.user,a=e.dispatch,l=r.CoreDetail,p=y.Z.useForm(),f=v()(p,1)[0],_=(0,i.useParams)(),S=(0,c.useState)(!1),Z=v()(S,2),E=Z[0],I=Z[1],M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null==_?void 0:_.coreId;a({type:"coreCurriculum/getCoreSubjectDetail",payload:{id:e}})};return(0,c.useEffect)((function(){(null==_?void 0:_.coreId)&&M()}),[null==_?void 0:_.coreId]),(0,c.useEffect)((function(){console.log("CoreDetail",l),f.setFieldsValue(m()({},l))}),[E]),(0,w.jsxs)("div",{className:"".concat(N),style:{backgroundImage:"url(".concat(o(20098),")")},children:[(0,w.jsxs)(h.Z,{style:{width:1200,height:"100%",margin:"0 auto",position:"relative",color:"#fff"},align:"middle",justify:"center",children:[(0,w.jsx)(x.Z,{className:g,children:null==l?void 0:l.name}),((0,b.Ny)()||(null==s||null===(n=s.userInfo)||void 0===n?void 0:n.is_core_subject_member))&&(0,w.jsxs)(h.Z,{style:{position:"absolute",top:"10px",right:"0px"},children:[(0,w.jsxs)("span",{className:"current primary-hover",onClick:d()(u()().mark((function e(){return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:I(!0);case 3:case"end":return e.stop()}}),e)}))),children:[(0,w.jsx)("i",{className:"iconfont icon-bianji-moren mr5"}),"编辑"]}),(0,w.jsxs)("span",{className:"current delete-hover ml20",onClick:function(){var e,n=C.Z.confirm({icon:null,title:"提示",content:"请确认是否删除《".concat(null==l?void 0:l.name,"》核心课程?"),okText:"确定",cancelText:"取消",onOk:(e=d()(u()().mark((function e(){var o;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({type:"coreCurriculum/delCoreSubjects",payload:{id:null==_?void 0:_.coreId}});case 2:0==(null==(o=e.sent)?void 0:o.status)&&(j.ZP.success("删除成功"),n.destroy(),i.history.push("/core"));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),onCancel:function(){n.destroy()}})},children:[(0,w.jsx)("i",{className:"iconfont icon-shanchutimu mr5"}),"删除"]})]})]}),(0,w.jsx)(k.Z,{title:"编辑核心课程",form:f,open:E,dispatch:!0,onCancel:function(){f.resetFields(),I(!1)},confirmLoading:!!t["coreCurriculum/putCoreSubjects"],onOk:function(){return f.submit()},handleFinish:function(){var e=d()(u()().mark((function e(n){var o;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({type:"coreCurriculum/putCoreSubjects",payload:m()(m()({},n),{},{id:null==_?void 0:_.coreId})});case 2:0==(null==(o=e.sent)?void 0:o.status)&&(j.ZP.success("更新成功"),I(!1),M());case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()})]})})),S="TopMenusDiv___rkFru",Z="SrollStage___jjMvw",E="StageItem___P6AAb",I="StageItemActive___juQir",M=o(23878),R=(0,i.connect)((function(e){return{coreCurriculum:e.coreCurriculum}}))((function(e){var n,o=e.coreCurriculum,r=e.dispatch,t=o.coreCE,s=(0,c.useState)("overview"),a=v()(s,2),u=a[0],l=a[1],d=(0,i.useParams)(),p=(0,i.useLocation)();(0,c.useEffect)((function(){var e;l(null==m||null===(e=m.find((function(e){return p.pathname.indexOf("/core/".concat(null==d?void 0:d.coreId,"/").concat(e.type))>-1})))||void 0===e?void 0:e.type)}),[p.pathname]);var m=[{name:"课程概览",type:"overview",topUseEidt:(0,w.jsx)(M.tp,{className:"ml20",dataSource:[{id:"CN",name:"中文"},{id:"EN",name:"English"}],value:t,onChange:function(e){r({type:"coreCurriculum/save",payload:{coreCE:e}})}})},{name:"知识图谱",type:"knowledge",topUseEidt:(0,b.Ny)()&&(0,w.jsxs)(h.Z,{className:"ml20",align:"middle",children:[(0,w.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){r({type:"coreCurriculum/save",payload:{isShowModalName:["新建模块"]}})},children:"新建模块"}),(0,w.jsx)(M.op,{style:{borderRadius:"4px"},className:"ml20",onClick:function(){r({type:"coreCurriculum/save",payload:{isShowModalName:["新增知识点"]}})},children:"新增知识点"}),(0,w.jsx)(M.op,{style:{borderRadius:"4px"},className:"ml20",onClick:function(){r({type:"coreCurriculum/save",payload:{isShowModalName:["批量导入"]}})},children:"批量导入"})]})},{name:"课程教案",type:"plan",topUseEidt:(0,b.Ny)()&&(0,w.jsxs)(h.Z,{children:[(0,w.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){r({type:"coreCurriculum/save",payload:{isShowModalName:["新建文件夹"]}})},children:"新建文件夹"}),(0,w.jsx)(M.op,{className:"ml20",style:{borderRadius:"4px"},onClick:function(){r({type:"coreCurriculum/save",payload:{isShowModalName:["上传教案"]}})},children:"上传教案"})]})},{name:"虚拟教研室",type:"virtroom",topUseEidt:(0,b.Ny)()&&(0,w.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){r({type:"coreCurriculum/save",payload:{isShowModalName:["编辑虚拟教研室"]}})},children:"编辑虚拟教研室"})},{name:"交流问答",type:"answers",topUseEidt:(0,b.Ny)()&&(0,w.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){r({type:"coreCurriculum/save",payload:{isShowModalName:["发表评论"]}})},children:"发表评论"})}];return(0,w.jsxs)(h.Z,{className:S,align:"middle",justify:"space-between",children:[(0,w.jsx)(h.Z,{className:Z,children:null==m?void 0:m.map((function(e,n){return(0,w.jsx)(i.Link,{className:"".concat(u===(null==e?void 0:e.type)&&I," ").concat(E),to:"/core/".concat(null==d?void 0:d.coreId,"/").concat(e.type),children:null==e?void 0:e.name},n)}))}),(0,w.jsx)(h.Z,{align:"middle",children:null==m||null===(n=m.find((function(e){return e.type===u})))||void 0===n?void 0:n.topUseEidt})]})})),F=function(e){return t()(e),(0,w.jsxs)("div",{style:{background:"#fff"},children:[(0,w.jsx)(_,{}),(0,w.jsx)(R,{}),(0,w.jsx)(s.Z.Content,{children:(0,w.jsx)(i.Outlet,{})})]})}},44e3:function(e,n,o){var r=o(84966),t=o(37534);const c=r.ZP;c.Header=r.h4,c.Footer=r.$_,c.Content=r.VY,c.Sider=t.Z,n.Z=c},20098:function(e,n,o){e.exports=o.p+"static/b.70f32195.png"}}]);