|
|
@ -131,8 +131,11 @@ class Exercisesetting extends Component{
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 已有设置数据的查询
|
|
|
|
// 已有设置数据的查询
|
|
|
|
getSettingInfo=()=>{
|
|
|
|
getSettingInfo=(type)=>{
|
|
|
|
this.props.Commonheadofthetestpapers()
|
|
|
|
if(type!=1){
|
|
|
|
|
|
|
|
this.props.Commonheadofthetestpapers()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let Id=this.props.match.params.Id;
|
|
|
|
let Id=this.props.match.params.Id;
|
|
|
|
let url=`/exercises/${Id}/exercise_setting.json`;
|
|
|
|
let url=`/exercises/${Id}/exercise_setting.json`;
|
|
|
|
axios.get(url).then((result)=>{
|
|
|
|
axios.get(url).then((result)=>{
|
|
|
@ -241,10 +244,10 @@ class Exercisesetting extends Component{
|
|
|
|
let{unified_setting}=this.state
|
|
|
|
let{unified_setting}=this.state
|
|
|
|
if(unified_setting==true){
|
|
|
|
if(unified_setting==true){
|
|
|
|
console.log("统一设置");
|
|
|
|
console.log("统一设置");
|
|
|
|
this.UnifiedSetting();
|
|
|
|
this.UnifiedSetting( );
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
console.log("非统一设置");
|
|
|
|
console.log("非统一设置");
|
|
|
|
this.NotUnifiedSetting();
|
|
|
|
this.NotUnifiedSetting( );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -347,7 +350,7 @@ class Exercisesetting extends Component{
|
|
|
|
console.log(result)
|
|
|
|
console.log(result)
|
|
|
|
if(result.status==200){
|
|
|
|
if(result.status==200){
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.getSettingInfo();
|
|
|
|
this.getSettingInfo(1);
|
|
|
|
this.cancelEdit();
|
|
|
|
this.cancelEdit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -367,7 +370,7 @@ class Exercisesetting extends Component{
|
|
|
|
if(result.status==200){
|
|
|
|
if(result.status==200){
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
this.cancelEdit();
|
|
|
|
this.cancelEdit();
|
|
|
|
this.getSettingInfo();
|
|
|
|
this.getSettingInfo(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -559,7 +562,7 @@ class Exercisesetting extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//取消编辑
|
|
|
|
//取消编辑
|
|
|
|
cancelEdit=()=>{
|
|
|
|
cancelEdit=()=>{
|
|
|
|
this.getSettingInfo();
|
|
|
|
this.getSettingInfo(1);
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
flagPageEdit:false
|
|
|
|
flagPageEdit:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|