You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/public/react/dist/static/js/76.5bc1fe95.chunk.js

1 line
123 KiB

5 years ago
(this.webpackJsonph5=this.webpackJsonph5||[]).push([[76,6,7,15],{2232:function(e,t,r){"use strict";r.r(t),r(560);var n=r(561),o=(r(131),r(39)),i=(r(170),r(18)),a=(r(103),r(47)),s=(r(500),r(501)),l=r(8),u=r(7),c=r(10),f=r(9),p=r(11),d=(r(50),r(29)),h=(r(260),r(92)),m=(r(472),r(471)),y=r(0),v=r.n(y),g=r(74),b=r(174),O=r(28),w=r(6),E=r.n(w),j=r(93),F=(r(264),m.a.Option),_=(h.a.Group,d.a.confirm,function(e){function t(e){var r;return Object(l.a)(this,t),(r=Object(c.a)(this,Object(f.a)(t).call(this,e))).scrollToAnchors=function(e){r.setState({anchor:e})},r.Commoninterface=function(e){var t=r.props.match.params.coursesId,n=r.props.match.params.category_id,o=[],i=!0,a=!1,s=void 0;try{for(var l,u=e[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;o.push(c.response.id)}}catch(e){a=!0,s=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}r.props.form.validateFields((function(e,i){if(void 0!==i.tasktype)if(void 0!==i.name)if(void 0!==i.description){if(5e3<i.description.length)r.ifHasAnchorJustScorll("descriptiontypes");else if(!e){var a="/courses/"+r.props.match.params.coursesId+"/graduation_tasks.json";E.a.post(a,{task_type:parseInt(i.tasktype),name:i.name,description:i.description,attachment_ids:o}).then((function(e){void 0!==e&&r.props.history.replace("/courses/".concat(t,"/graduation_tasks/").concat(n,"/detail/").concat(e.data.task_id,"/questions"))})).catch((function(e){}))}}else r.ifHasAnchorJustScorll("descriptiontypes");else r.ifHasAnchorJustScorll("nametypes");else r.ifHasAnchorJustScorll("tasktypes")}))},r.goback=function(){r.props.history.replace("/courses/".concat(r.props.match.params.coursesId,"/graduation_tasks/").concat(r.props.match.params.category_id))},r.changeTitle=function(e){r.setState({title_num:e.target.value.length,title_value:e.target.value})},r.handleChange=function(e){if("done"==e.file.status||"uploading"==e.file.status||"removed"===e.file.status){var t=e.fileList;r.setState({fileList:Object(O.C)(t)})}},r.cancelAttachment=function(){r.setState({Modalstype:!1,Modalstopval:"",ModalSave:"",ModalCancel:""})},r.onAttachmentRemove=function(e){if(!e.percent||100==e.percent)return r.props.confirm({content:"\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u4e2a\u9644\u4ef6\u5417?",okText:"\u786e\u5b9a",cancelText:"\u53d6\u6d88",onOk:function(){r.deleteAttachment(e)},onCancel:function(){}}),!1},r.deleteAttachment=function(e){var t="/attachments/".concat(e.response?e.response.id:e.uid,".json");E.a.delete(t,{}).then((function(t){t.data&&0==t.data.status&&(r.setState((function(t){var r=t.fileList.indexOf(e),n=t.fileList.slice();return n.splice(r,1),{fileList:n}})),r.cancelAttachment())})).catch((function(e){}))},r.handleSubmit=function(e){var t=r.state.fileList;r.Commoninterface(t)},r.hidestartshixunsreplace=function(){var e=r.state.fileList;r.Commoninterface(e)},r.hidestartshixunsreplacetwo=function(){r.setState({shixunsreplace:!1})},r.checkContent=function(e,t,r){""==t?r("\u8bf7\u8f93\u5165\u5185\u5bb9"):5e3<t.length?r("\u6700\u5927\u9650\u5236\u4e3a5000\u4e2a\u5b57\u7b26"):r()},r.state={coursename:"",coursesearch:"",title_num:0,title_value:"",fileList:[],contents:[{val:"",id:1}],type:!0,shixunsreplace:!1},r}return Object(p.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){}},{key:"ifHasAnchorJustScorll",value:function(){var e=this.state.anchor;if(e){var t=document.getElementById(e);t&&window.scrollTo(0,t.offsetTop-window.innerHeight/2)}else document.body.scrollTop=document.documentElement.scrollTop=0}},{key:"render",value:function(){var e=this,t=this.props.form.getFieldDecorator,r=this.state,l=(r.coursename,r.coursesearch,r.title_num),u=r.title_value,c=(r.pageType,r.fileList),f=(r.contents,r.type,r.Modalstype),p=r.Modalstopval,h=r.ModalCancel,y=r.ModalSave,w=r.shixunsreplace,E=(this.props.coursedata,this.props.match.params.coursesId),_=(this.props.match.params.position,this.props.match.params.category_id),k={width:600,fileList:c,multiple:!0,action:"".concat(Object(O.Q)()),onChange:this.handleChange,onRemove:this.onAttachmentRemove,beforeUpload:function(t){var r=t.size/1024/1024<150;re