"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[74795],{7580:function(e,t,s){s.r(t),s.d(t,{default:function(){return N}});var n=s(7557),a=s.n(n),r=s(82242),c=s.n(r),i=s(41498),l=s.n(i),o=s(79800),d=s.n(o),u=s(59301),_=s(59081),x=s(49389),h=s(78241),m=s(8591),f=s(66104),p=s(95237),j=s(43604),g=s(57809),b=s(10249),I=s(28103),Z=s(3113),v={flex_box_center:"flex_box_center___xV7b6",flex_space_between:"flex_space_between___VKhsb",flex_box_vertical_center:"flex_box_vertical_center___ZeNry",flex_box_center_end:"flex_box_center_end___j462S",flex_box_column:"flex_box_column___zDUss",bg:"bg___I9Ce6",title:"title___N0IDa",titleLeft:"titleLeft___v14y3",titleRight:"titleRight___QkPDR",btns:"btns___QGvIi"},k=s(51590),y=s(90269),w=s(37712),N=(0,x.connect)((function(e){var t=e.graduation,s=e.loading,n=e.user;return{graduation:t,globalSetting:e.globalSetting,user:n,loading:s.effects}}))((function(e){var t,s=e.graduation,n=(e.globalSetting,e.loading,e.user),r=e.dispatch,i=(0,x.useParams)(),o=((0,x.useLocation)(),n.userInfo),N=h.Z.useForm(),L=d()(N,1)[0],D=(s.addTopicData,function(){var e=l()(a()().mark((function e(){var t,s,n,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=L.getFieldsValue(),null!=(s=c()({},t))&&s.attachment_ids&&(s.attachment_ids=null===(n=s.attachment_ids)||void 0===n?void 0:n.map((function(e){return e.id||e.response.id}))),e.next=5,(0,k.Sv)(c()({coursesId:i.coursesId,attachment_ids:[]},s));case 5:(r=e.sent).status?m.ZP.error(r.message):x.history.push("/classrooms/".concat(i.coursesId,"/graduation_tasks/").concat(i.categoryId));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());return(0,u.useEffect)((function(){r({type:"graduation/addTopicDefaultData",payload:c()({},i)})}),[i.coursesId]),(0,w.jsxs)("section",{className:"edu-container",children:[(0,w.jsxs)("section",{className:"animated fadeIn",children:[(0,w.jsx)("aside",{className:"mt10",children:o&&(0,w.jsxs)(f.Z,{separator:">",children:[(0,w.jsx)(f.Z.Item,{children:(0,w.jsx)(x.Link,{to:"".concat(o.first_category_url),children:null==o||null===(t=o.course)||void 0===t?void 0:t.course_name})}),(0,w.jsx)(f.Z.Item,{children:(0,w.jsx)(x.Link,{to:"/classrooms/".concat(i.coursesId,"/graduation_tasks/").concat(i.categoryId),children:"毕设任务"})}),(0,w.jsx)(f.Z.Item,{children:"新建"})]})}),(0,w.jsx)("aside",{className:[v.title,"mt20"].join(" "),children:(0,w.jsxs)(p.Z,{style:{width:"100%"},children:[(0,w.jsx)(j.Z,{flex:"1",children:(0,w.jsx)("strong",{className:"font20 ml5",children:"新建毕设任务"})}),(0,w.jsx)(j.Z,{children:(0,w.jsx)(x.Link,{className:"font16 c-light-black",to:"/classrooms/".concat(i.coursesId,"/exercise"),children:"返回"})})]})})]}),(0,w.jsx)("section",{className:[v.bg,"pt30","pl30","pr30","pb30","mt20"].join(" "),children:(0,w.jsxs)(h.Z,{layout:"vertical",form:L,scrollToFirstError:!0,onFinish:function(){var e=l()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:D();case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:[(0,w.jsx)(h.Z.Item,{name:"task_type",label:"类型：",rules:[{required:!0,message:"请选择任务类型"}],children:(0,w.jsxs)(g.default,{size:"middle",placeholder:"请选择任务类型",style:{width:200},children:[(0,w.jsx)(g.default.Option,{value:1,children:"普通"}),(0,w.jsx)(g.default.Option,{value:2,children:"分组"})]})}),(0,w.jsx)(h.Z.Item,{name:"name",label:"选题名称：",rules:[{required:!0,message:"请输入任务标题"}],children:(0,w.jsx)(b.Z,{maxLength:60,size:"middle",suffix:"0/60",placeholder:"任务标题，最大限制60个字符"})}),(0,w.jsx)(I.Z,{}),(0,w.jsx)(h.Z.Item,{label:"内容",name:"description",rules:[{required:!0,message:"请输入内容"}],children:(0,w.jsx)(_.Z,{watch:!0,placeholder:"请任务内容说明，最大限制5000个字符"})}),(0,w.jsx)(p.Z,{children:(0,w.jsx)(j.Z,{children:(0,w.jsx)(h.Z.Item,{name:"attachment_ids",children:(0,w.jsx)(y.Z,{})})})})]})}),(0,w.jsxs)("aside",{className:v.btns,children:[(0,w.jsx)(Z.ZP,{type:"primary",onClick:function(){L.submit()},children:"保存"}),(0,w.jsx)(x.Link,{to:"/classrooms/".concat(i.coursesId,"/graduation_tasks/").concat(i.categoryId),children:"取消"})]})]})}))}}]);