|  |  |  | @ -70,23 +70,10 @@ class NewWorkForm extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  |           contentFileList, | 
			
		
	
		
			
				
					|  |  |  |  |           answerFileList, | 
			
		
	
		
			
				
					|  |  |  |  |         }, () => { | 
			
		
	
		
			
				
					|  |  |  |  |           // setTimeout(() => {
 | 
			
		
	
		
			
				
					|  |  |  |  |           //   this._scrollToTop()
 | 
			
		
	
		
			
				
					|  |  |  |  |             // 阻止setValue的滚动
 | 
			
		
	
		
			
				
					|  |  |  |  |             // $(window).scroll( function() { 
 | 
			
		
	
		
			
				
					|  |  |  |  |             //   $("html").scrollTop(0)
 | 
			
		
	
		
			
				
					|  |  |  |  |             //   $(window).unbind("scroll");
 | 
			
		
	
		
			
				
					|  |  |  |  |             // });
 | 
			
		
	
		
			
				
					|  |  |  |  |             /** | 
			
		
	
		
			
				
					|  |  |  |  |               setValue会调用到 codemirror的 o.scrollIntoView(i),  会导致滚动条跳动 | 
			
		
	
		
			
				
					|  |  |  |  |              */ | 
			
		
	
		
			
				
					|  |  |  |  |             // $('.editormd').parent().css('position', 'fixed').css('left', '-1000px')
 | 
			
		
	
		
			
				
					|  |  |  |  |             // this.contentMdRef.current.setValue(data.description || '')
 | 
			
		
	
		
			
				
					|  |  |  |  |             // this.answerMdRef.current.setValue(data.reference_answer || '')
 | 
			
		
	
		
			
				
					|  |  |  |  |             // setTimeout(() => {
 | 
			
		
	
		
			
				
					|  |  |  |  |             //     $('.editormd').parent().css('position', '').css('left', 'auto')
 | 
			
		
	
		
			
				
					|  |  |  |  |             // }, 100);
 | 
			
		
	
		
			
				
					|  |  |  |  |           // }, 500)
 | 
			
		
	
		
			
				
					|  |  |  |  |           setTimeout(() => { | 
			
		
	
		
			
				
					|  |  |  |  |             this.contentMdRef.current.setValue(data.description || '') | 
			
		
	
		
			
				
					|  |  |  |  |             this.answerMdRef.current.setValue(data.reference_answer || '') | 
			
		
	
		
			
				
					|  |  |  |  |           }, 2000) | 
			
		
	
		
			
				
					|  |  |  |  |            | 
			
		
	
		
			
				
					|  |  |  |  |           this.props.form.setFieldsValue({ | 
			
		
	
		
			
				
					|  |  |  |  |             title: data.name, | 
			
		
	
	
		
			
				
					|  |  |  | @ -98,13 +85,12 @@ class NewWorkForm extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  |       } else { // new
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |  |     // this._scrollToTop()
 | 
			
		
	
		
			
				
					|  |  |  |  |     this._scrollToTop() | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  |   _scrollToTop = () => { | 
			
		
	
		
			
				
					|  |  |  |  |     // setTimeout(() => {
 | 
			
		
	
		
			
				
					|  |  |  |  |       $("html").scrollTop(0) | 
			
		
	
		
			
				
					|  |  |  |  |       // $("html").animate({ scrollTop: 0 })
 | 
			
		
	
		
			
				
					|  |  |  |  |     // }, 1000)
 | 
			
		
	
		
			
				
					|  |  |  |  |     setTimeout(() => { | 
			
		
	
		
			
				
					|  |  |  |  |       $("html").animate({ scrollTop: 0 }) | 
			
		
	
		
			
				
					|  |  |  |  |     }, 1500) | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // 输入title
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -306,8 +292,6 @@ class NewWorkForm extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  |     this.setState({ base_on_project: !this.state.base_on_project }) | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  |   componentDidMount() { | 
			
		
	
		
			
				
					|  |  |  |  |     this.isEdit = this.props.match.url.indexOf('/edit') | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     window.$('.groupSetting .ant-form-item-label > label').addClass('ant-form-item-required') | 
			
		
	
		
			
				
					|  |  |  |  |     this._scrollToTop() | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  |  | @ -319,13 +303,15 @@ class NewWorkForm extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  |     let{ | 
			
		
	
		
			
				
					|  |  |  |  |       title_value, contentFileList, answerFileList, max_num, min_num, base_on_project, | 
			
		
	
		
			
				
					|  |  |  |  |       init_max_num, init_min_num,  | 
			
		
	
		
			
				
					|  |  |  |  |       title_num, course_name, category, has_commit, has_project | 
			
		
	
		
			
				
					|  |  |  |  |       title_num, course_name, category, has_commit, has_project, | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       isEdit | 
			
		
	
		
			
				
					|  |  |  |  |     }=this.state | 
			
		
	
		
			
				
					|  |  |  |  |     const { current_user } = this.props | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     const courseId = this.state.course_id || this.props.match.params.coursesId ;     | 
			
		
	
		
			
				
					|  |  |  |  |      | 
			
		
	
		
			
				
					|  |  |  |  |     if ((this.isEdit) && !this.state.description) { | 
			
		
	
		
			
				
					|  |  |  |  |     if ((isEdit) && !this.state.workLoaded) { | 
			
		
	
		
			
				
					|  |  |  |  |       return '' | 
			
		
	
		
			
				
					|  |  |  |  |     }  | 
			
		
	
		
			
				
					|  |  |  |  |     const uploadProps = { | 
			
		
	
	
		
			
				
					|  |  |  | @ -453,8 +439,7 @@ class NewWorkForm extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  |                   }], | 
			
		
	
		
			
				
					|  |  |  |  |                 })( | 
			
		
	
		
			
				
					|  |  |  |  |                   <TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}  | 
			
		
	
		
			
				
					|  |  |  |  |                     initValue={this.state.description} noSetValue={true} | 
			
		
	
		
			
				
					|  |  |  |  |                     className="courseMessageMD" ></TPMMDEditor> | 
			
		
	
		
			
				
					|  |  |  |  |                     className="courseMessageMD" initValue={this.state.description}></TPMMDEditor> | 
			
		
	
		
			
				
					|  |  |  |  |                 )} | 
			
		
	
		
			
				
					|  |  |  |  |               </Form.Item> } | 
			
		
	
		
			
				
					|  |  |  |  |               <Upload {...uploadProps} className="upload_1 newWorkUpload"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -522,8 +507,7 @@ class NewWorkForm extends Component{ | 
			
		
	
		
			
				
					|  |  |  |  |                     }], | 
			
		
	
		
			
				
					|  |  |  |  |                   })( | 
			
		
	
		
			
				
					|  |  |  |  |                     <TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}  | 
			
		
	
		
			
				
					|  |  |  |  |                         initValue={this.state.reference_answer || ''} noSetValue={true} | 
			
		
	
		
			
				
					|  |  |  |  |                         className="courseMessageMD" refreshTimeout={1500} ></TPMMDEditor> | 
			
		
	
		
			
				
					|  |  |  |  |                         className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor> | 
			
		
	
		
			
				
					|  |  |  |  |                   )} | 
			
		
	
		
			
				
					|  |  |  |  |                 </Form.Item> | 
			
		
	
		
			
				
					|  |  |  |  |                 <Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload"> | 
			
		
	
	
		
			
				
					|  |  |  | 
 |