(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{"0yVv":function(O,i,e){"use strict";e.r(i);var F=e("VBJJ"),M=e.n(F),Y=e("X/R0"),K=e("M6G9"),y=e("55MS"),j=e("z3+T"),Q=e("MPZO"),f=e("bnk9"),w=e("9cas"),u=e("twZV"),k=e("EYz/"),S=e("gwXo"),q=e("DHCt"),B=e("CRgH"),ee=e("A/ao"),z=e("HGue"),_e=e("XZgM"),N=e("TFeq"),te=e("RXQH"),h=e("VgM2"),ae=e("XSsT"),m=e("iBFk"),re=e("EkPb"),a=e("7X0+"),v=e("GZha"),H=e("buSX"),g=e("ZZRV"),_=e.n(g),I=e("q5+0"),L=e("DndG"),c=e("9kvl"),V=e("Hkc5"),P=e.n(V),X=function(t){var s,x=t.classroomList,A=t.globalSetting,p=t.problemset,oe=t.loading,G=t.user,b=t.dispatch,se=Object(H.a)(t,["classroomList","globalSetting","problemset","loading","user","dispatch"]),l=Object(I.m)(),le=Object(I.l)(),E=G.userInfo,Z=a.a.useForm(),J=Object(v.a)(Z,1),D=J[0];return Object(g.useEffect)(function(){b({type:"problemset/getEditDisciplines",payload:{source:"question"}})},[]),_.a.createElement("section",{className:"edu-container"},_.a.createElement("section",{className:"animated fadeIn"},_.a.createElement("aside",{className:"mt10"},E&&_.a.createElement(m.a,{separator:">"},_.a.createElement(m.a.Item,null,_.a.createElement(L.Link,{to:"/classrooms/".concat(l.coursesId,"/exercise")},E==null||((s=E.course)===null||s===void 0)?void 0:s.course_name)),_.a.createElement(m.a.Item,null,_.a.createElement(L.Link,{to:"/classrooms/".concat(l.coursesId,"/exercise")},"\u8BD5\u5377\u5217\u8868")),_.a.createElement(m.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),_.a.createElement("aside",{className:[P.a.title,"mt20"].join(" ")},_.a.createElement(N.a,{style:{width:"100%"}},_.a.createElement(h.a,{flex:"1"},_.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u8BD5\u5377")),_.a.createElement(h.a,null)))),_.a.createElement("section",{className:[P.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},_.a.createElement(a.a,{layout:"vertical",form:D,className:P.a.formWrap},_.a.createElement(a.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"courseid",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},_.a.createElement(z.a,{placeholder:"\u8BF7\u9009\u62E9...",options:p.courseOptions})),_.a.createElement(a.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},_.a.createElement(B.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),_.a.createElement(a.a.Item,{name:"time",label:"\u8003\u8BD5\u65F6\u957F",style:{width:"300px"}},_.a.createElement("div",{style:{display:"flex"}},_.a.createElement(S.a,{min:1,max:9999,maxLength:60,placeholder:"\u8BF7\u586B\u5199\u8003\u8BD5\u65F6\u957F"}),_.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px"}},"\u5206\u949F"))),_.a.createElement(a.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},_.a.createElement(u.a.Group,null,_.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),_.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),_.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE"))),_.a.createElement(a.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},_.a.createElement(B.a.TextArea,{rows:6,maxLength:300,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236300\u4E2A\u5B57\u7B26"})))),_.a.createElement("div",{className:["mt20","pb20","pt20"].join(" ")},_.a.createElement(f.a,{style:{marginRight:"5px"},onClick:function(){c.c.push("/classrooms/".concat(l.coursesId,"/exercise"))}},"\u53D6\u6D88"),_.a.createElement(f.a,{onClick:Object(j.a)(M.a.mark(function C(){var n,T,R,$,W,d,U;return M.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,D.validateFields();case 2:return n=D.getFieldValue(),T=n.courseid,R=Object(v.a)(T,2),$=R[0],W=R[1],n.sub_discipline_id=W,n.is_md=!0,o.next=9,b({type:"exercise/addExercise",payload:Object(y.a)(Object(y.a)({},n),l)});case 9:d=o.sent,d.status===0?c.c.push("/classrooms/".concat(l.coursesId,"/exercise/").concat((U=d.data)===null||U===void 0?void 0:U.exercise_id,"/edit")):K.b.error(d.message);case 11:case"end":return o.stop()}},C)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A")))};i.default=Object(c.a)(function(r){var t=r.classroomList,s=r.loading,x=r.user,A=r.problemset,p=r.globalSetting;return{classroomList:t,globalSetting:p,problemset:A,user:x,loading:s.effects}})(X)},Hkc5:function(O,i,e){O.exports={flex_box_center:"flex_box_center___3KwMu",flex_space_between:"flex_space_between___1akH8",flex_box_vertical_center:"flex_box_vertical_center___7Jz-q",flex_box_center_end:"flex_box_center_end___3NYWv",flex_box_column:"flex_box_column___2ztEc",bg:"bg___1FDUF",title:"title___SV-0k",titleLeft:"titleLeft___2739d",titleRight:"titleRight___3sqsq",formWrap:"formWrap___1_b9c"}}}]);
