dev_ec
杨树林 6 years ago
parent 720e8c9403
commit 5dc87e6b5a

@ -95,7 +95,16 @@ class Curriculum extends Component {
// }) // })
} }
bindRef = ref => {
console.log(ref);
console.log("调用了子对象1");
this.child = ref
};
newrightcalculatebuttonysl=(child)=>{
console.log("调用了子对象2");
console.log(child);
child.newrightcalculatebutton();
}
onAclick=(i)=>{ onAclick=(i)=>{
console.log("onAclick"); console.log("onAclick");
console.log(i); console.log(i);
@ -215,7 +224,7 @@ class Curriculum extends Component {
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a> <a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a>
</span> </span>
<span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr20 "} <span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr20 "}
onClick={this.newrightcalculatebutton}>计算</span> onClick={()=>this.newrightcalculatebuttonysl(this.child)}>计算</span>
</span> </span>
:titine===4? :titine===4?
<span className="fr ml20 SystemParameters" style={{color: '#989898'}}>各环节平均得分*占比之和/各环节总分*占比之和</span> <span className="fr ml20 SystemParameters" style={{color: '#989898'}}>各环节平均得分*占比之和/各环节总分*占比之和</span>
@ -247,7 +256,7 @@ class Curriculum extends Component {
render={ (props) => (<EcCourseEvaluationsbottom {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route> render={ (props) => (<EcCourseEvaluationsbottom {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*5课程达成评价结果*/} {/*5课程达成评价结果*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/subpage/courses/:type/5' <Route extra path='/ecs/major_schools/:majorId/years/:yearId/subpage/courses/:type/5'
render={ (props) => (<EcCompletionCalculation {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route> render={ (props) => (<EcCompletionCalculation {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)} triggerRef={this.bindRef}/>) }></Route>
</Switch> </Switch>
</div> </div>
</div> </div>

@ -57,6 +57,8 @@ class EcCompletionCalculation extends Component {
componentDidMount(){ componentDidMount(){
console.log("componentDidMount"); console.log("componentDidMount");
// console.log(this.props); // console.log(this.props);
// let ec_course_id =this.props.match.params.ec_course_id; // let ec_course_id =this.props.match.params.ec_course_id;
// this.UpdateClassData(true); // this.UpdateClassData(true);
@ -98,6 +100,11 @@ class EcCompletionCalculation extends Component {
console.log(error); console.log(error);
}); });
this.props.Ontitine("competition_calculation_info"); this.props.Ontitine("competition_calculation_info");
try {
this.props.triggerRef(this);
}catch (e) {
}
} }
targetsget_navigation_data=(ec_year_id,ec_course_id)=>{ targetsget_navigation_data=(ec_year_id,ec_course_id)=>{
@ -301,6 +308,7 @@ class EcCompletionCalculation extends Component {
} }
newrightcalculatebutton=()=>{ newrightcalculatebutton=()=>{
console.log("调用了计算");
this.setState({ this.setState({
Spintype:true Spintype:true
}) })
@ -310,16 +318,19 @@ class EcCompletionCalculation extends Component {
const Orl =`/ec_courses/${ec_course_id}/evaluation.json`; const Orl =`/ec_courses/${ec_course_id}/evaluation.json`;
axios.get(Orl) axios.get(Orl)
.then((response) => { .then((response) => {
if(response.data.status===1){ if(response){
this.setState({ if(response.data.status===1){
calculatetype:true, this.setState({
completiontype:true, calculatetype:true,
completionlist:'计算成功', completiontype:true,
calculatesetype:true, completionlist:'计算成功',
Spintype:false calculatesetype:true,
}) Spintype:false
this.UpdateClassData(true); })
this.UpdateClassData(true);
}
} }
}) })
.catch(function (error) { .catch(function (error) {
console.log(error) console.log(error)

Loading…
Cancel
Save