|  |  | @ -33,7 +33,8 @@ class EcCourseSupportSetting extends Component { | 
			
		
	
		
		
			
				
					
					|  |  |  |   constructor(props) { |  |  |  |   constructor(props) { | 
			
		
	
		
		
			
				
					
					|  |  |  |     super(props) |  |  |  |     super(props) | 
			
		
	
		
		
			
				
					
					|  |  |  |     this.state = { |  |  |  |     this.state = { | 
			
		
	
		
		
			
				
					
					|  |  |  |         editableMode: false |  |  |  |         editableMode: false, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         requirements: [] | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |   updateCourseTargets = (course_targets) => { |  |  |  |   updateCourseTargets = (course_targets) => { | 
			
		
	
	
		
		
			
				
					|  |  | @ -80,6 +81,32 @@ class EcCourseSupportSetting extends Component { | 
			
		
	
		
		
			
				
					
					|  |  |  |     }) |  |  |  |     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |     return map; |  |  |  |     return map; | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   fetchRequirements = () => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     const url = `/ec_years/${this.props.year.id}/graduation_subitems.json`   | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     axios.get(url, { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         .then((response) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (response.data && response.data.graduation_subitems) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 const requirements = response.data.graduation_subitems.map((item, index) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     return { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         index: `${item.graduation_requirement_position}-${item.position}`, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         subitem_contents: item.content, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         subitem_id: item.id, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 this.setState({ requirements }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 this.props.showModal('提示', '接口异常或无数据') | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 // 服务端返回的数据有误
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         .catch(function (error) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             console.log(error); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |   fetchCourseTargets = () => { |  |  |  |   fetchCourseTargets = () => { | 
			
		
	
		
		
			
				
					
					|  |  |  |      const ec_course_id = this.props.match.params.ec_course_id; |  |  |  |      const ec_course_id = this.props.match.params.ec_course_id; | 
			
		
	
		
		
			
				
					
					|  |  |  |     const course_id = 706 |  |  |  |     const course_id = 706 | 
			
		
	
	
		
		
			
				
					|  |  | @ -160,6 +187,9 @@ class EcCourseSupportSetting extends Component { | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |    |  |  |  |    | 
			
		
	
		
		
			
				
					
					|  |  |  |   setEditableMode = (mode) => { |  |  |  |   setEditableMode = (mode) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if (mode) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         this.fetchRequirements() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     this.setState({ editableMode: mode }) |  |  |  |     this.setState({ editableMode: mode }) | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |    |  |  |  |    | 
			
		
	
	
		
		
			
				
					|  |  | @ -227,6 +257,7 @@ class EcCourseSupportSetting extends Component { | 
			
		
	
		
		
			
				
					
					|  |  |  |             </div> */} |  |  |  |             </div> */} | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           {/* && is_manager  */} |  |  |  |           {/* && is_manager  */} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           <div> | 
			
		
	
		
		
			
				
					
					|  |  |  |           { course_targets&&course_targets.length>=0 ? (editableMode ?  |  |  |  |           { course_targets&&course_targets.length>=0 ? (editableMode ?  | 
			
		
	
		
		
			
				
					
					|  |  |  |               <EditableCourseSupportSetting |  |  |  |               <EditableCourseSupportSetting | 
			
		
	
		
		
			
				
					
					|  |  |  |                   setEditableMode={this.setEditableMode} |  |  |  |                   setEditableMode={this.setEditableMode} | 
			
		
	
	
		
		
			
				
					|  |  | @ -240,6 +271,7 @@ class EcCourseSupportSetting extends Component { | 
			
		
	
		
		
			
				
					
					|  |  |  |                   {...this.state} |  |  |  |                   {...this.state} | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ></ShowTableCourseSupportSetting> ) : '' |  |  |  |                 ></ShowTableCourseSupportSetting> ) : '' | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           </div> | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           {/* <EditableCourseSupportSetting |  |  |  |           {/* <EditableCourseSupportSetting | 
			
		
	
		
		
			
				
					
					|  |  |  |             setEditableMode={this.setEditableMode} |  |  |  |             setEditableMode={this.setEditableMode} | 
			
		
	
	
		
		
			
				
					|  |  | 
 |