"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[71450],{622:function(e,s,n){n.r(s),n.d(s,{default:function(){return v}});var r=n(7557),t=n.n(r),o=n(82242),c=n.n(o),a=n(41498),i=n.n(a),u=n(79800),l=n.n(u),d=n(59301),m=n(49389),h=n(33853),p=n(78241),x=n(66104),f=n(3113),_=n(59081),w=n(76794),g="bg___rSw_d",k="formWrap___TnbqC",j="mdWrap___lxZQe",y="backgroundFa___LV7Gu",I="button___xLTIU",b=n(37712),v=(0,m.connect)((function(e){var s=e.shixunHomeworks,n=e.newCourse,r=e.loading;return{shixunHomeworks:s,newCourse:n,globalSetting:e.globalSetting,loading:r.effects}}))((function(e){e.shixunHomeworks,e.newCourse,e.globalSetting,e.loading,e.dispatch,e.match;var s=(0,m.useParams)(),n=p.Z.useForm(),r=l()(n,1)[0],o=(0,d.useState)({}),a=l()(o,2),u=(a[0],a[1]),v=(0,d.useState)({}),Z=l()(v,2),N=Z[0],C=Z[1];(0,d.useEffect)((function(){F()}),[]);var F=function(){var e=i()(t()().mark((function e(){var n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.wS)({homeworkId:s.homeworkId});case 2:n=e.sent,C(c()({},n)),n.description&&r.setFieldsValue({description:n.description});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=i()(t()().mark((function e(n){return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.pb)({homeworkId:s.homeworkId,description:r.getFieldValue("description")});case 2:0===e.sent.status&&m.history.push("/classrooms/".concat(s.coursesId,"/shixun_homework/").concat(s.categoryId,"/detail"));case 4:case"end":return e.stop()}}),e)})));return function(s){return e.apply(this,arguments)}}();return(0,b.jsxs)("section",{className:g,children:[N.course_name&&(0,b.jsx)("section",{className:"animated fadeIn",children:(0,b.jsx)("aside",{className:"mt10",children:N.category&&(0,b.jsxs)(x.Z,{separator:">",children:[(0,b.jsx)(x.Z.Item,{children:(0,b.jsx)(m.Link,{to:"/classrooms/".concat(N.course_id,"/shixun_homework"),children:N.course_name})}),(0,b.jsx)(x.Z.Item,{children:(0,b.jsx)(m.Link,{to:"/classrooms/".concat(N.course_id,"/shixun_homework"),children:N.category.category_name})}),(0,b.jsx)(x.Z.Item,{children:"作业详情"})]})})}),(0,b.jsxs)("aside",{className:"font24 bold mt20 mb20",children:[(0,b.jsx)(h.Z,{className:"current mr10 font16",onClick:function(){return m.history.push("/classrooms/".concat(s.coursesId,"/shixun_homework/").concat(s.categoryId,"/detail"))}}),null!=N&&N.description?"修改总结":"提交总结"]}),(0,b.jsxs)(p.Z,{form:r,className:k,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){u(c()({},r.getFieldsValue()))},onFinish:S,children:[(0,b.jsx)("div",{className:j,children:(0,b.jsx)(p.Z.Item,{name:"description",label:"内容:",rules:[{required:!0,message:"请输入总结内容"},{max:5e3,message:"最大限制5000个字符"}],children:(0,b.jsx)(_.Z,{id:"commit-summary-id",placeholder:"请在此输入总结内容,最多5000个字符",watch:!0,defaultValue:N.description})})}),(0,b.jsx)("div",{className:y,children:(0,b.jsx)("div",{className:"pt40 mb30",children:(0,b.jsxs)(p.Z.Item,{children:[(0,b.jsx)(f.ZP,{size:"middle",type:"primary",className:"".concat(I," mr20"),htmlType:"submit",children:"提交"}),(0,b.jsx)(f.ZP,{size:"middle",type:"primary",ghost:!0,className:I,onClick:function(){return m.history.push("/classrooms/".concat(s.coursesId,"/shixun_homework/").concat(s.categoryId,"/detail"))},children:"取消"})]})})})]})]})}))}}]);