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

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[96300],{20235:function(e,n,o){o.r(n),o.d(n,{default:function(){return F}});var r=o(70236),t=o.n(r),c=o(59301),i=o(3634),u=o(44e3),s=o(7557),l=o.n(s),a=o(41498),d=o.n(a),p=o(82242),m=o.n(p),f=o(79800),v=o.n(f),h=o(78241),y=o(95237),x=o(43604),C=o(43418),j=o(8591),_="Bg___y3IeD",b="TitleStyle___n0xLC",N=o(67894),g=o(19654),k=o(37712),w=(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,u=e.user,s=e.dispatch,a=r.CoreDetail,p=h.Z.useForm(),f=v()(p,1)[0],w=(0,i.useParams)(),S=(0,c.useState)(!1),Z=v()(S,2),I=Z[0],E=Z[1],M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null==w?void 0:w.coreId;s({type:"coreCurriculum/getCoreSubjectDetail",payload:{id:e}})};return(0,c.useEffect)((function(){(null==w?void 0:w.coreId)&&M()}),[null==w?void 0:w.coreId]),(0,c.useEffect)((function(){console.log("CoreDetail",a),f.setFieldsValue(m()({},a))}),[I]),(0,k.jsxs)("div",{className:"".concat(_),style:{backgroundImage:"url(".concat(o(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==a?void 0:a.name}),((0,g.Ny)()||(null==u||null===(n=u.userInfo)||void 0===n?void 0:n.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()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:E(!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==a?void 0:a.name,"》核心课程?"),okText:"确定",cancelText:"取消",onOk:(e=d()(l()().mark((function e(){var o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({type:"coreCurriculum/delCoreSubjects",payload:{id:null==w?void 0:w.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,k.jsx)("i",{className:"iconfont icon-shanchutimu mr5"}),"删除"]})]})]}),(0,k.jsx)(N.Z,{title:"编辑核心课程",form:f,open:I,dispatch:!0,onCancel:function(){f.resetFields(),E(!1)},confirmLoading:!!t["coreCurriculum/putCoreSubjects"],onOk:function(){return f.submit()},handleFinish:function(){var e=d()(l()().mark((function e(n){var o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({type:"coreCurriculum/putCoreSubjects",payload:m()(m()({},n),{},{id:null==w?void 0:w.coreId})});case 2:0==(null==(o=e.sent)?void 0:o.status)&&(j.ZP.success("更新成功"),E(!1),M());case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()})]})})),S="TopMenusDiv___rkFru",Z="SrollStage___jjMvw",I="StageItem___P6AAb",E="StageItemActive___juQir",M=o(8254),R=(0,i.connect)((function(e){return{coreCurriculum:e.coreCurriculum,user:e.user}}))((function(e){var n,o,r,t,u=e.coreCurriculum,s=e.user,l=e.dispatch,a=u.coreCE,d=(0,c.useState)("overview"),p=v()(d,2),m=p[0],f=p[1],h=(0,i.useParams)(),x=(0,i.useLocation)();(0,c.useEffect)((function(){var e;f(null==C||null===(e=C.find((function(e){return x.pathname.indexOf("/core/".concat(null==h?void 0:h.coreId,"/").concat(e.type))>-1})))||void 0===e?void 0:e.type)}),[x.pathname]);var C=[{name:"课程概览",type:"overview",topUseEidt:(0,k.jsx)(M.tp,{className:"ml20",dataSource:[{id:"CN",name:"中文"},{id:"EN",name:"English"}],value:a,onChange:function(e){l({type:"coreCurriculum/save",payload:{coreCE:e}})}})},{name:"知识图谱",type:"knowledge",topUseEidt:((0,g.Ny)()||(null==s||null===(n=s.userInfo)||void 0===n?void 0:n.is_core_subject_member))&&(0,k.jsxs)(y.Z,{className:"ml20",align:"middle",children:[(0,k.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){l({type:"coreCurriculum/save",payload:{isShowModalName:["新建模块"]}})},children:"新建模块"}),(0,k.jsx)(M.op,{style:{borderRadius:"4px"},className:"ml20",onClick:function(){l({type:"coreCurriculum/save",payload:{isShowModalName:["新增知识点"]}})},children:"新增知识点"}),(0,k.jsx)(M.op,{style:{borderRadius:"4px"},className:"ml20",onClick:function(){l({type:"coreCurriculum/save",payload:{isShowModalName:["批量导入"]}})},children:"批量导入"})]})},{name:"课程教案",type:"plan",topUseEidt:((0,g.Ny)()||(null==s||null===(o=s.userInfo)||void 0===o?void 0:o.is_core_subject_member))&&(0,k.jsxs)(y.Z,{children:[(0,k.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){l({type:"coreCurriculum/save",payload:{isShowModalName:["新建文件夹"]}})},children:"新建文件夹"}),(0,k.jsx)(M.op,{className:"ml20",style:{borderRadius:"4px"},onClick:function(){l({type:"coreCurriculum/save",payload:{isShowModalName:["上传教案"]}})},children:"上传教案"})]})},{name:"虚拟教研室",type:"virtroom",topUseEidt:((0,g.Ny)()||(null==s||null===(r=s.userInfo)||void 0===r?void 0:r.is_core_subject_member))&&(0,k.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){l({type:"coreCurriculum/save",payload:{isShowModalName:["编辑虚拟教研室"]}})},children:"编辑虚拟教研室"})},{name:"交流问答",type:"answers",topUseEidt:(0,g.bg)()&&(0,k.jsx)(M.op,{style:{borderRadius:"4px"},onClick:function(){l({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==C?void 0:C.map((function(e,n){return(0,k.jsx)(i.Link,{className:"".concat(m===(null==e?void 0:e.type)&&E," ").concat(I),to:"/core/".concat(null==h?void 0:h.coreId,"/").concat(e.type),children:null==e?void 0:e.name},n)}))}),(0,k.jsx)(y.Z,{align:"middle",children:null==C||null===(t=C.find((function(e){return e.type===m})))||void 0===t?void 0:t.topUseEidt})]})})),F=function(e){return t()(e),(0,k.jsxs)("div",{style:{background:"#fff"},children:[(0,k.jsx)(w,{}),(0,k.jsx)(R,{}),(0,k.jsx)(u.Z.Content,{children:(0,k.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"}}]);