dev_aliyun_beta
杨树明 5 years ago
parent daad546710
commit 6d80a53e6d

@ -14,42 +14,6 @@ class OfficialAcademicTranscript extends Component {
}
componentDidMount() {
}
myjumptopic=(e)=>{
console.log("获取到值");
console.log(e);
this.props.jumptopic(e);
}
editgame_scores=(e,id)=>{
let score=e.target.value;
if(score!=null&&score!=undefined&&score!=""){
let work_id=this.props.data.work_id;
let url=`/student_works/${work_id}/adjust_review_score.json`
axios.post(url,{
type:"report",
score:score,
challenge_id:id
}).then((result)=>{
if(result.data.status===0){
// this.props.getdatalist()
this.props.showNotification(result.data.message);
this.props.setupdalist(result.data.challenge_score,result.data.overall_appraisal,result.data.work_score)
}else{
this.props.showNotification(result.data.message);
}
}).catch((error)=>{
})
}else{
this.props.showNotification("调分为空将不会修改之前的分数");
}
}
render() {
let {data}=this.props;
let datas=[];
@ -68,8 +32,63 @@ class OfficialAcademicTranscript extends Component {
// adjustmentminute:asdasd
})
})
this.setState({
datas:datas
})
}
}
myjumptopic=(e)=>{
console.log("获取到值");
console.log(e);
this.props.jumptopic(e);
}
editgame_scores=(e,id,maxsum)=>{
let{datas}=this.state;
let newdatas=datas;
let score=e.target.value;
if(score!=null&&score!=undefined&&score!=""){
if(score<maxsum){
this.props.showNotification("调分不能小于0");
}else if(score>maxsum){
this.props.showNotification(`调分不能大于${maxsum}`);
}else{
let work_id=this.props.data.work_id;
let url=`/student_works/${work_id}/adjust_review_score.json`
axios.post(url,{
type:"report",
score:score,
challenge_id:id
}).then((result)=>{
if(result.data.status===0){
// this.props.getdatalist()
this.props.showNotification(result.data.message);
this.props.setupdalist(result.data.challenge_score,result.data.overall_appraisal,result.data.work_score)
newdatas.map((item,key)=>{
if(item.challenge_id.id===id){
item.game_scores.game_score=score
}
})
this.setState({
datas:newdatas
})
}else{
this.props.showNotification(result.data.message);
}
}).catch((error)=>{
})
}
}else{
this.props.showNotification("调分为空将不会修改之前的分数");
}
}
render() {
let {datas}=this.state;
let columns=[{
title: '关卡',
@ -165,7 +184,7 @@ class OfficialAcademicTranscript extends Component {
render: (text, record) => (
<span>
<a><InputNumber size="small" defaultValue={record.game_scores.game_score}
onBlur={(e) => this.editgame_scores(e,record.challenge_id.id)}
onBlur={(e) => this.editgame_scores(e,record.challenge_id.id,record.game_scores.game_score_full)}
min={0} max={record.game_scores.game_score_full}
/></a>
{/*<a style={{textAlign: "center"}} className="color-blue font-14 mr20">查看</a>*/}

Loading…
Cancel
Save