"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[57045],{64799:function(e,n,s){s.r(n),s.d(n,{default:function(){return N}});var t=s(7557),r=s.n(t),a=s(37205),o=s.n(a),c=s(82242),i=s.n(c),u=s(41498),m=s.n(u),l=s(79800),d=s.n(l),h=s(59301),p=s(49389),f=s(78241),x=s(43418),_=s(66104),w=s(3113),k=s(59081),v=s(76794),g="bg___TiMPN",j="formWrap___t6WyS",y="mdWrap____nxvH",b="backgroundFa___gDA1e",Z="button___mpK6Z",S=s(90269),I=s(37712),N=(0,p.connect)((function(e){var n=e.shixunHomeworks,s=e.newCourse,t=e.loading;return{shixunHomeworks:n,newCourse:s,globalSetting:e.globalSetting,loading:t.effects}}))((function(e){var n=e.shixunHomeworks,s=(e.globalSetting,e.loading),t=e.dispatch,a=(0,p.useParams)(),c=f.Z.useForm(),u=d()(c,1)[0],l=(0,h.useState)({}),N=d()(l,2),C=N[0],H=N[1],D=(0,h.useState)(!0),F=d()(D,2),P=(F[0],F[1]),W=(0,h.useState)(!1),V=d()(W,2),L=(V[0],V[1]),T=(0,h.useState)(),z=d()(T,2),A=(z[0],z[1],(0,h.useRef)(),n.studentWorkAddDefaultData),E=(0,h.useState)([]),M=d()(E,2),q=M[0],B=M[1],K=(0,h.useState)({page:1,limit:20,search:""}),O=d()(K,2),R=O[0],G=(O[1],function(){var e=m()(r()().mark((function e(){var n,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.next=3,t({type:"shixunHomeworks/getSearchMemberList",payload:i()(i()({},a),R)});case 3:s=e.sent,L(!1),s.members&&B([].concat(o()(q),o()(s.members))),(null===(n=s.members)||void 0===n?void 0:n.length)<20&&P(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());(0,h.useEffect)((function(){new Promise(m()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({type:"shixunHomeworks/addStudentWorkDefaultData",payload:i()(i()({},a),{},{type:3})});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))),G()}),[]);var J=function(){var e=m()(r()().mark((function e(n){var s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v.Be)(i()(i()(i()({},a),n),{},{type:3}));case 2:0===(s=e.sent).status&&p.history.push("/classrooms/".concat(a.coursesId,"/common_homework/").concat(a.commonHomeworkId,"/review/").concat(s.work_id));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Q=function(){var e=m()(r()().mark((function e(n){var s,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(s=i()({},C)).attachment_ids&&(s.attachment_ids=null==s||null===(t=s.attachment_ids)||void 0===t?void 0:t.map((function(e){return e.response.id}))),s.attachment_ids&&""!=s.attachment_ids?J(s):x.Z.confirm({title:(0,I.jsxs)("div",{children:["还未上传附件",(0,I.jsx)("br",{}),"是否确认提交作品？"]}),onOk:function(){J(s)}});case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,I.jsxs)("section",{className:g,children:[A.course_name&&(0,I.jsx)("section",{className:"animated fadeIn",children:(0,I.jsx)("aside",{className:"mt10",children:A.category&&(0,I.jsxs)(_.Z,{separator:">",children:[(0,I.jsx)(_.Z.Item,{children:(0,I.jsx)(p.Link,{to:"/classrooms/".concat(A.course_id,"/common_homework"),children:A.course_name})}),(0,I.jsx)(_.Z.Item,{children:(0,I.jsx)(p.Link,{to:"/classrooms/".concat(A.course_id,"/common_homework"),children:A.category.category_name})}),(0,I.jsxs)(_.Z.Item,{children:[null==A?void 0:A.user_name," 提交作品"]})]})})}),(0,I.jsx)("aside",{className:"font24 bold mt20 mb20",children:A.homework_name}),(0,I.jsxs)(f.Z,{form:u,className:j,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){H(i()({},u.getFieldsValue())),console.log("formValue:",C)},onFinish:Q,children:[(0,I.jsxs)("div",{className:y,children:[(0,I.jsx)(f.Z.Item,{name:"description",label:"内容:",rules:[{required:!0,message:"请输入作业的简介"},{max:65535,message:"作业简介最大限制65535个字符"}],children:(0,I.jsx)(k.Z,{placeholder:"请在此输入作业内容或作业附件的简要描述，最大限制为65535个字符",watch:!0,defaultValue:C.intro})}),(0,I.jsx)("div",{children:(0,I.jsx)(f.Z.Item,{name:"attachment_ids",children:(0,I.jsx)(S.Z,{})})})]}),(0,I.jsx)("div",{className:b,children:(0,I.jsx)("div",{className:"pt40 mb30",children:(0,I.jsxs)(f.Z.Item,{children:[(0,I.jsx)(w.ZP,{size:"middle",type:"primary",className:"".concat(Z," mr20"),htmlType:"submit",loading:s["newCourse/editCourse"]||s["newCourse/submitCourse"],children:"提交"}),(0,I.jsx)(w.ZP,{size:"middle",type:"primary",ghost:!0,className:Z,onClick:function(){return p.history.push("/classrooms/".concat(a.coursesId,"/common_homework/").concat(a.commonHomeworkId,"/detail"))},children:"取消"})]})})})]})]})}))}}]);