dev_ec
杨树林 5 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)=>{
console.log("onAclick");
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>
</span>
<span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr20 "}
onClick={this.newrightcalculatebutton}>计算</span>
onClick={()=>this.newrightcalculatebuttonysl(this.child)}>计算</span>
</span>
:titine===4?
<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>
{/*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>
</div>
</div>

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

Loading…
Cancel
Save