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.4 KiB

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