|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[88517],{13261:function(e,n,t){var s=t(82242),a=t.n(s),i=(t(59301),t(19779)),c=t(3113),r=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,s=void 0===t?{}:t,l=e.styles,o=void 0===l?{}:l,d=e.customText,u=e.ButtonText,m=e.ButtonClick,h=e.Buttonclass,p=e.ButtonTwo,x=e.imgStyles,f=e.loading,j=void 0!==f&&f;return(0,r.jsxs)("section",{className:"tc animated fadeIn",style:a()(a()({},{color:"#999",margin:"100px auto",visibility:j?"hidden":"visible"}),o),children:[(0,r.jsx)("img",{src:n||i,style:a()({width:288,height:200},x)}),(0,r.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,r.jsx)(c.ZP,a()(a()({className:h,onClick:m},s),{},{children:u})),p&&p]})}},95595:function(e,n,t){t.r(n),t.d(n,{default:function(){return H}});var s=t(7557),a=t.n(s),i=t(37205),c=t.n(i),r=t(82242),l=t.n(r),o=t(41498),d=t.n(o),u=t(79800),m=t.n(u),h=t(59301),p=t(65363),x=t(78241),f=t(8591),j=t(66104),_=t(73782),v=t(59028),Z=t(95237),g=t(43604),y=t(94001),b=t(24905),k=t(3113),N=t(33987),w=t(89744),I=t(15309),C="bg___iB8eB",F="formWrap___pNpQ9",P="fieldWrap___ACUG9",S="mdWrap___xFqQa",B="backgroundFa___MuFzN",L="button___tzh3S",V=t(37712),H=(0,p.connect)((function(e){var n=e.shixunHomeworks,t=e.newCourse,s=e.loading;return{shixunHomeworks:n,newCourse:t,globalSetting:e.globalSetting,loading:s.effects}}))((function(e){var n,t=e.shixunHomeworks,s=(e.newCourse,e.globalSetting,e.loading,e.dispatch),i=(0,p.useParams)(),r=x.Z.useForm(),o=m()(r,1)[0],u=(0,h.useState)({}),H=m()(u,2),T=H[0],q=H[1],E=(0,h.useState)(!1),W=m()(E,2),z=W[0],D=W[1],M=(0,h.useState)([]),A=m()(M,2),Q=A[0],R=A[1],G=(0,h.useState)([]),U=m()(G,2),J=U[0],K=U[1],O=t.commonHomeWorkEditDefaultData,X={name:"file",multiple:!0,action:I.Z.API_SERVER+"/api/attachments.json",defaultFileList:Q,onChange:function(e){var n=e.file.status;"done"===n?f.ZP.success("".concat(e.file.name," 文件上传成功")):"error"===n&&f.ZP.error("".concat(e.file.name," 文件上传失败"))}};(0,h.useEffect)((function(){$()}),[i.topicId]);var Y=function(e){return null==e?void 0:e.map((function(e){return{uid:e.id,response:{id:e.id},name:e.title,status:"done",url:e.url}}))},$=function(){var e=d()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({type:"shixunHomeworks/editCommonHomeWorkDefaultBankData",payload:{id:i.topicId}});case 2:(n=e.sent)&&(o.setFieldsValue({name:n.name}),o.setFieldsValue({description:n.description}),o.setFieldsValue(l()({},n)),q(l()({},n)),R(c()(Y(n.attachments))),K(c()(Y(n.reference_attachments))),D(!0));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=d()(a()().mark((function e(n){var t,s,c;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=l()({},n)).attachment_ids&&(t.attachment_ids=null==t||null===(s=t.attachment_ids.fileList)||void 0===s?void 0:s.map((function(e){return e.response.id}))),t.reference_attachment_ids&&(t.reference_attachment_ids=null==t||null===(c=t.reference_attachment_ids.fileList)||void 0===c?void 0:c.map((function(e){return e.response.id}))),e.next=5,(0,w.yT)(l()(l()(l()({id:i.topicId},i),t),{},{type:3}));case 5:e.sent&&p.history.push("/users/".concat(i.username,"/topics/").concat(i.topicId,"/").concat(i.topictype,"/group/detail"));case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,V.jsxs)("section",{className:C,children:[(0,V.jsx)("section",{className:"animated fadeIn",children:(0,V.jsx)("aside",{className:"mt10",children:(0,V.jsxs)(j.Z,{separator:">",children:[(0,V.jsx)(j.Z.Item,{children:(0,V.jsx)(p.Link,{to:"/users/".concat(i.username,"/").concat("personal"===i.topictype?"topics":"topicbank","/").concat(i.topictype),children:"personal"===i.topictype?"我的课堂资源":"公共题库"})}),(0,V.jsx)(j.Z.Item,{children:(0,V.jsx)(p.Link,{to:"/users/".concat(i.username,"/topics/").concat(i.topicId,"/").concat(i.topictype,"/group/detail"),children:"详情"})}),(0,V.jsx)(j.Z.Item,{children:"编辑"})]})})}),(0,V.jsx)("aside",{className:"font24 bold mt20 mb20",children:"编辑普通作业"}),(0,V.jsxs)(x.Z,{form:o,className:F,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){q(l()({},o.getFieldsValue()))},onFinish:ee,children:[(0,V.jsx)("div",{className:P,children:(0,V.jsx)(x.Z.Item,{name:"name",label:"标题:",rules:[{required:!0,message:"请输入标题"}],children:(0,V.jsx)(_.Z,{maxLength:60,suffix:"".concat((null===(n=T.name)||void 0===n?void 0:n.length)||0,"/60"),placeholder:"例如:从Python程序设计-入门精通"})})}),(0,V.jsxs)("div",{className:S,children:[(0,V.jsx)(x.Z.Item,{name:"description",label:"简介:",rules:[{required:!0,message:"请输入作业的简介"},{max:5e3,message:"作业简介最大限制5000个字符"}],children:(0,V.jsx)(N.Z,{watch:!0,defaultValue:O.description})}),(0,V.jsx)("div",{children:(0,V.jsx)(x.Z.Item,{name:"attachment_ids",children:z&&(0,V.jsxs)(v.Z,l()(l()({defaultFileList:Q},X),{},{children:[(0,V.jsx)("span",{className:"c-blue",children:"上传附件"})," (单个文件150MB以内)"]}))})}),(0,V.jsxs)(Z.Z,{gutter:[20,20],children:[(0,V.jsx)(g.Z,{flex:"230px",children:(0,V.jsx)(x.Z.Item,{name:"min_num",label:"分组设置",rules:[{required:!0,message:"请填写每组最小人数"}],children:(0,V.jsx)(y.Z,{style:{width:200},min:1,placeholder:"请填写每组最小人数"})})}),(0,V.jsx)(g.Z,{flex:"230px",children:(0,V.jsx)(x.Z.Item,{name:"max_num",label:(0,V.jsx)("div",{children:" "}),rules:[{required:!0,message:"请填写每组最大人数"}],children:(0,V.jsx)(y.Z,{style:{width:200},max:10,placeholder:"请填写每组最大人数"})})}),(0,V.jsx)(g.Z,{children:(0,V.jsx)("div",{className:"mt30",children:"(学生提交作品时需要关联同组成员,组内成员作品共享)"})})]}),(0,V.jsx)(Z.Z,{children:(0,V.jsxs)(g.Z,{children:[(0,V.jsx)(x.Z.Item,{name:"base_on_project",valuePropName:"checked",children:(0,V.jsx)(b.Z,{value:1,defaultChecked:!0,children:"基于项目实施"})}),(0,V.jsx)("span",{className:"c-light-black",children:"(选中,则必须在本平台创建项目,项目管理员可以提交作品;不选中,无需在平台创建项目,任意小组成员均可以提交作品)"})]})})]}),(0,V.jsxs)("div",{className:S,children:[(0,V.jsx)(x.Z.Item,{name:"reference_answer",label:"参考答案:",children:(0,V.jsx)(N.Z,{defaultValue:O.reference_answer,watch:!0})}),(0,V.jsx)("div",{children:(0,V.jsx)(x.Z.Item,{name:"reference_attachment_ids",children:z&&(0,V.jsxs)(v.Z,l()(l()({},X),{},{defaultFileList:J,children:[(0,V.jsx)("span",{className:"c-blue",children:"上传附件"})," (单个文件150MB以内)"]}))})})]}),(0,V.jsx)("div",{className:B,children:(0,V.jsx)("div",{className:"pt40 mb30",children:(0,V.jsxs)(x.Z.Item,{children:[(0,V.jsx)(k.ZP,{size:"middle",type:"primary",className:"".concat(L," mr20"),htmlType:"submit",children:"提交"}),(0,V.jsx)(k.ZP,{size:"middle",type:"primary",ghost:!0,className:L,onClick:function(){return p.history.push("/users/".concat(i.username,"/topics/").concat(i.topicId,"/").concat(i.topictype,"/group/detail"))},children:"取消"})]})})})]})]})}))}}]); |