dev_hss
杨树明 6 years ago
parent 086974adc9
commit 148e02365c

@ -107,6 +107,10 @@ class InfosTopics extends Component{
isSpin:false isSpin:false
}) })
}); });
}else{
this.setState({
isSpin:false
})
} }
} }

@ -18,7 +18,7 @@ class NewGtaskForms extends Component{
initValue = (data) => { initValue = (data) => {
if (data.isEdit) {
const contentFileList = data.attachments.map(item => { const contentFileList = data.attachments.map(item => {
return { return {
id: item.id, id: item.id,
@ -47,9 +47,7 @@ class NewGtaskForms extends Component{
}); });
}) })
} else { // new
}
} }
@ -109,19 +107,19 @@ class NewGtaskForms extends Component{
} }
handleSubmit = () => { handleSubmit = () => {
debugger
let {contentFileList,min_num,max_num,base_on_project}=this.state; let {contentFileList,min_num,max_num,base_on_project}=this.state;
let {data}=this.props; let {data}=this.props;
let task_type=data.task_type let task_type=data.task_type
let topicId=this.props.topicId let topicId=this.props.topicId
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFields((err, values) => {
const mdContnet = this.contentMdRef.current.getValue().trim(); const mdContnet = this.contentMdRef.current.getValue().trim();
values.description = mdContnet; values.description = mdContnet;
if (!err) { if (!err) {
if (this.state.isEdit) {
let url="/task_banks/"+topicId+".json"; let url="/task_banks/"+topicId+".json";
axios.put(url, { axios.put(url, {
gtask_bank: { gtask_bank: {
@ -143,10 +141,6 @@ class NewGtaskForms extends Component{
console.log(error) console.log(error)
}) })
} else {
}
} else { } else {
$("html").animate({ scrollTop: $('html').scrollTop() - 100 }) $("html").animate({ scrollTop: $('html').scrollTop() - 100 })
} }
@ -222,7 +216,7 @@ class NewGtaskForms extends Component{
` `
} }
</style> </style>
<Form className="courseForm"> <Form className="courseForm" onClick={this.handleSubmit} >
<div className={"ant-row ant-form-item AboutInputForm newAboutInputForm "}> <div className={"ant-row ant-form-item AboutInputForm newAboutInputForm "}>
<div className="ant-col ant-form-item-label margin0"> <div className="ant-col ant-form-item-label margin0">
<label htmlFor="coursesNew_course" className="ant-form-item-required ">类型</label> <span className={"tasktypes"}>{this.props.data&&this.props.data.task_type===1?"":this.props.data&&this.props.data.task_type===2?"":""}</span> <label htmlFor="coursesNew_course" className="ant-form-item-required ">类型</label> <span className={"tasktypes"}>{this.props.data&&this.props.data.task_type===1?"":this.props.data&&this.props.data.task_type===2?"":""}</span>
@ -342,7 +336,7 @@ class NewGtaskForms extends Component{
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
{/* htmlType="submit" */} {/* htmlType="submit" */}
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={() => this.props.onCancel()}>取消</ a> <a className="defalutCancelbtn fl" onClick={() => this.props.onCancel()}>取消</ a>
</div> </div>
</Form.Item> </Form.Item>

Loading…
Cancel
Save