|  |  |  | @ -6,10 +6,12 @@ import { WordsBtn,getUrl} from 'educoder'; | 
			
		
	
		
			
				
					|  |  |  |  | import axios from 'axios'; | 
			
		
	
		
			
				
					|  |  |  |  | import Modals from '../../../modals/Modals'; | 
			
		
	
		
			
				
					|  |  |  |  | import '../../css/Courses.css'; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | const {Option} = Select; | 
			
		
	
		
			
				
					|  |  |  |  | const CheckboxGroup = Checkbox.Group; | 
			
		
	
		
			
				
					|  |  |  |  | const confirm = Modal.confirm; | 
			
		
	
		
			
				
					|  |  |  |  | let GraduationTasksnewtype = true; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | class GraduationTasksnew extends Component { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	constructor(props) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -165,8 +167,7 @@ class GraduationTasksnew extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	deleteAttachment = (file) => { | 
			
		
	
		
			
				
					|  |  |  |  | 		const url = `/attachments/${file.response ? file.response.id : file.uid}.json` | 
			
		
	
		
			
				
					|  |  |  |  |     axios.delete(url, { | 
			
		
	
		
			
				
					|  |  |  |  |     }) | 
			
		
	
		
			
				
					|  |  |  |  | 		axios.delete(url, {}) | 
			
		
	
		
			
				
					|  |  |  |  | 			.then((response) => { | 
			
		
	
		
			
				
					|  |  |  |  | 				if (response.data) { | 
			
		
	
		
			
				
					|  |  |  |  | 					const {status} = response.data; | 
			
		
	
	
		
			
				
					|  |  |  | @ -188,12 +189,13 @@ class GraduationTasksnew extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  | 				console.log(error); | 
			
		
	
		
			
				
					|  |  |  |  | 			}); | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	//滚动
 | 
			
		
	
		
			
				
					|  |  |  |  | 	ifHasAnchorJustScorll() { | 
			
		
	
		
			
				
					|  |  |  |  | 		// let anchor = this.getURLStuff("anchor");
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 		let anchor = this.state.anchor; | 
			
		
	
		
			
				
					|  |  |  |  |     console.log("anchor ", anchor); | 
			
		
	
		
			
				
					|  |  |  |  | 		// console.log("anchor ", anchor);
 | 
			
		
	
		
			
				
					|  |  |  |  | 		// 对应id的话, 滚动到相应位置
 | 
			
		
	
		
			
				
					|  |  |  |  | 		if (!!anchor) { | 
			
		
	
		
			
				
					|  |  |  |  | 			let anchorElement = document.getElementById(anchor); | 
			
		
	
	
		
			
				
					|  |  |  | @ -206,10 +208,13 @@ class GraduationTasksnew extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  | 			document.body.scrollTop = document.documentElement.scrollTop = 0; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	render() { | 
			
		
	
		
			
				
					|  |  |  |  | 		const {getFieldDecorator} = this.props.form; | 
			
		
	
		
			
				
					|  |  |  |  |   let {coursename,coursesearch,title_num,title_value,pageType,fileList,contents,type, | 
			
		
	
		
			
				
					|  |  |  |  |     Modalstype,Modalstopval,ModalCancel,ModalSave} =this.state; | 
			
		
	
		
			
				
					|  |  |  |  | 		let { | 
			
		
	
		
			
				
					|  |  |  |  | 			coursename, coursesearch, title_num, title_value, pageType, fileList, contents, type, | 
			
		
	
		
			
				
					|  |  |  |  | 			Modalstype, Modalstopval, ModalCancel, ModalSave | 
			
		
	
		
			
				
					|  |  |  |  | 		} = this.state; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 		let {coursedata} = this.props; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -252,26 +257,49 @@ render(){ | 
			
		
	
		
			
				
					|  |  |  |  | 						<div className={"educontent mb20"}> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 							<p className="clearfix mt10"> | 
			
		
	
		
			
				
					|  |  |  |  |         <WordsBtn style="grey" className="fl">  <Link to={"/courses/"+courseId+"/students"} className="color-grey-6">{this.props.current_user&&this.props.current_user.course_name}</Link></WordsBtn> | 
			
		
	
		
			
				
					|  |  |  |  | 								<WordsBtn style="grey" className="fl"> <Link to={"/courses/" + courseId + "/students"} | 
			
		
	
		
			
				
					|  |  |  |  | 																														 className="color-grey-6">{this.props.current_user && this.props.current_user.course_name}</Link></WordsBtn> | 
			
		
	
		
			
				
					|  |  |  |  | 								<span className="color-grey-9 fl ml3 mr3">></span> | 
			
		
	
		
			
				
					|  |  |  |  |         <WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">毕设任务</Link></WordsBtn> | 
			
		
	
		
			
				
					|  |  |  |  | 								<WordsBtn style="grey" className="fl"> <Link | 
			
		
	
		
			
				
					|  |  |  |  | 									to={"/courses/" + courseId + "/graduation_tasks/" + category_id} className="color-grey-6">毕设任务</Link></WordsBtn> | 
			
		
	
		
			
				
					|  |  |  |  | 								<span className="color-grey-9 fl ml3 mr3">></span> | 
			
		
	
		
			
				
					|  |  |  |  | 								<span>{"新建"}</span> | 
			
		
	
		
			
				
					|  |  |  |  | 							</p> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       <div style={{ width:'100%',height:'75px'}} > | 
			
		
	
		
			
				
					|  |  |  |  |         <p className=" fl color-black mt25 summaryname">新建毕设任务</p> | 
			
		
	
		
			
				
					|  |  |  |  | 							<div style={{width: '100%', height: '60px'}}> | 
			
		
	
		
			
				
					|  |  |  |  | 								<p className=" fl color-black mt20 summaryname">新建毕设任务</p> | 
			
		
	
		
			
				
					|  |  |  |  | 								<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a> | 
			
		
	
		
			
				
					|  |  |  |  | 							</div> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       <Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} onSubmit={GraduationTasksnewtype===true?this.handleSubmit:""} > | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 							<Form labelCol={{span: 5}} wrapperCol={{span: 12}} | 
			
		
	
		
			
				
					|  |  |  |  | 										onSubmit={GraduationTasksnewtype === true ? this.handleSubmit : ""}> | 
			
		
	
		
			
				
					|  |  |  |  | 								<style> | 
			
		
	
		
			
				
					|  |  |  |  | 									{ | 
			
		
	
		
			
				
					|  |  |  |  | 										`.ant-form-item-label{
 | 
			
		
	
		
			
				
					|  |  |  |  |                 text-align: right; | 
			
		
	
		
			
				
					|  |  |  |  |     vertical-align: middle; | 
			
		
	
		
			
				
					|  |  |  |  |     padding: 0px 0px 20px 0px; | 
			
		
	
		
			
				
					|  |  |  |  |     display: inline-block; | 
			
		
	
		
			
				
					|  |  |  |  |     overflow: hidden; | 
			
		
	
		
			
				
					|  |  |  |  |     white-space: nowrap; | 
			
		
	
		
			
				
					|  |  |  |  |     line-height: 20px; */ | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             .ant-form-item-control{ | 
			
		
	
		
			
				
					|  |  |  |  |                 line-height: 39.9999px; | 
			
		
	
		
			
				
					|  |  |  |  |     position: relative; | 
			
		
	
		
			
				
					|  |  |  |  |     zoom: 1; | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             ` | 
			
		
	
		
			
				
					|  |  |  |  | 									} | 
			
		
	
		
			
				
					|  |  |  |  | 								</style> | 
			
		
	
		
			
				
					|  |  |  |  | 								{/*内容*/} | 
			
		
	
		
			
				
					|  |  |  |  |         <div className="stud-class-set bor-bottom-greyE pd20 edu-back-white"> | 
			
		
	
		
			
				
					|  |  |  |  | 								<div className="stud-class-set bor-bottom-greyE pt20 pl20 pr20 edu-back-white"> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 									<Form.Item label="类型" > | 
			
		
	
		
			
				
					|  |  |  |  | 										{getFieldDecorator('tasktype', { | 
			
		
	
		
			
				
					|  |  |  |  | 											rules: [{required: true, message: "请选择任务类型"}], | 
			
		
	
		
			
				
					|  |  |  |  |           })(<Select className={"greyInput"} | 
			
		
	
		
			
				
					|  |  |  |  | 										})(<Select className={"greyInput mb20"} | 
			
		
	
		
			
				
					|  |  |  |  | 															 style={{width: '20%'}} | 
			
		
	
		
			
				
					|  |  |  |  | 															 placeholder="请选择任务类型"> | 
			
		
	
		
			
				
					|  |  |  |  | 											<Option value="1">普通</Option> | 
			
		
	
	
		
			
				
					|  |  |  | @ -284,13 +312,15 @@ render(){ | 
			
		
	
		
			
				
					|  |  |  |  | 									<Form.Item label="任务标题" > | 
			
		
	
		
			
				
					|  |  |  |  | 										{getFieldDecorator('name', { | 
			
		
	
		
			
				
					|  |  |  |  | 											rules: [{required: true, message: "不能为空"}], | 
			
		
	
		
			
				
					|  |  |  |  |             })(<Input placeholder="请输入任务名称,最大限制60个字符" value={title_value} onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength="60" addonAfter={String(title_num)}/>)} | 
			
		
	
		
			
				
					|  |  |  |  | 										})(<Input placeholder="请输入任务名称,最大限制60个字符" value={title_value} onInput={this.changeTitle} | 
			
		
	
		
			
				
					|  |  |  |  | 															className="searchView searchViewAfter mb20" style={{"width": "100%"}} maxLength="60" | 
			
		
	
		
			
				
					|  |  |  |  | 															addonAfter={String(title_num)}/>)} | 
			
		
	
		
			
				
					|  |  |  |  | 									</Form.Item> | 
			
		
	
		
			
				
					|  |  |  |  | 									<input type="hidden" id='nametypes'/> | 
			
		
	
		
			
				
					|  |  |  |  | 								</div> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         <div className="stud-class-set pd20 coursenavbox edu-back-white"> | 
			
		
	
		
			
				
					|  |  |  |  | 								<div className="stud-class-set pt20 pl20 pr20  coursenavbox edu-back-white"> | 
			
		
	
		
			
				
					|  |  |  |  | 									<style>{` | 
			
		
	
		
			
				
					|  |  |  |  |                 .uploadBtn.ant-btn { | 
			
		
	
		
			
				
					|  |  |  |  |                   border: none; | 
			
		
	
	
		
			
				
					|  |  |  | @ -351,5 +381,6 @@ render(){ | 
			
		
	
		
			
				
					|  |  |  |  | 		) | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | const GraduationTasksnewApp = Form.create({name: 'coursesNew'})(GraduationTasksnew); | 
			
		
	
		
			
				
					|  |  |  |  | export default GraduationTasksnewApp; |