diff --git a/app/templates/shared/main.css b/app/templates/shared/main.css index 9e9bc4f50..884f6fa37 100644 --- a/app/templates/shared/main.css +++ b/app/templates/shared/main.css @@ -344,7 +344,7 @@ a.edu-txt-w40,.edu-txt-w40{ width:40px; display: inline-block;text-align: center .bor-grey01{border:1px solid #E6EAEB;} .bor-orange{border:1px solid #FF7500;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} diff --git a/public/react/public/css/css_min_all.css b/public/react/public/css/css_min_all.css index 5ffdc4db7..9bbf43e9b 100755 --- a/public/react/public/css/css_min_all.css +++ b/public/react/public/css/css_min_all.css @@ -533,7 +533,7 @@ input::-ms-clear{display:none;} .bor-grey-d{border:1px solid #ddd;} .bor-grey01{border:1px solid #E6EAEB;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/react/public/css/edu-common.css b/public/react/public/css/edu-common.css index a82fa22d2..6817312ad 100755 --- a/public/react/public/css/edu-common.css +++ b/public/react/public/css/edu-common.css @@ -536,7 +536,7 @@ input::-ms-clear{display:none;} .bor-grey-d{border:1px solid #ddd;} .bor-grey01{border:1px solid #E6EAEB;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index b5d50abb9..434101f33 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -134,6 +134,17 @@ class ShixunWorkReport extends Component { goback = () => { this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.state.data.homework_common_id}/list?tab=0`); } + + setupdalist=(challenge_score,overall_appraisal,work_score)=>{ + let {data}=this.state; + let newdata=data; + newdata.challenge_score=challenge_score; + newdata.overall_appraisal=overall_appraisal; + newdata.work_score=work_score; + this.setState({ + data:newdata + }) + } render() { let{data} =this.state; console.log(data) @@ -199,6 +210,7 @@ class ShixunWorkReport extends Component { data={data} jumptopic={this.jumptopic} getdatalist={()=>this.getdatalist()} + setupdalist={(challenge_score,overall_appraisal,work_score)=>this.setupdalist(challenge_score,overall_appraisal,work_score)} /> diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index fd00aa699..19dce082e 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -9,44 +9,12 @@ class OfficialAcademicTranscript extends Component { super(props); this.state = { loadingstate:true, - datas:undefined + datas:undefined, + customsids:undefined } } componentDidMount() { - - } - myjumptopic=(e)=>{ - console.log("获取到值"); - console.log(e); - this.props.jumptopic(e); - } - - editgame_scores=(score,id)=>{ - 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); - }else{ - this.props.showNotification(result.data.message); - } - }).catch((error)=>{ - - }) - }else{ - this.props.showNotification("调分为空将不会修改之前的分数"); - } - } - - render() { - let {data}=this.props; let datas=[]; @@ -65,8 +33,70 @@ 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<0){ + this.props.showNotification("调分不能小于0"); + this.setState({ + customsids:id + }) + }else if(score>maxsum){ + this.props.showNotification(`调分不能大于${maxsum}`); + this.setState({ + customsids:id + }) + }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, + customsids:undefined + }) + }else{ + this.props.showNotification(result.data.message); + } + }).catch((error)=>{ + + }) + } + + }else{ + this.props.showNotification("调分为空将不会修改之前的分数"); + } + } + render() { + let {datas,customsids}=this.state; let columns=[{ title: '关卡', @@ -84,9 +114,11 @@ class OfficialAcademicTranscript extends Component { className:"TaskForms", render: (text, record) => ( - this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>56?record.taskname.name:""} > - {record.taskname.name}{record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} - + this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>15?record.taskname.name:""} > + {record.taskname.name} + + {record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} + ), }, { @@ -159,9 +191,9 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( - this.editgame_scores(e,record.challenge_id.id)} - min={0} max={record.game_scores.game_score_full} + this.editgame_scores(e,record.challenge_id.id,record.game_scores.game_score_full)} + // min={0} max={record.game_scores.game_score_full} /> {/*查看*/} @@ -224,11 +256,11 @@ class OfficialAcademicTranscript extends Component { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - max-width: 450px; + max-width: 225px; text-align: left !important; } .TaskForms{ - max-width: 450px; + max-width: 260px; text-align: left !important; padding: 16px !important; } @@ -241,6 +273,9 @@ class OfficialAcademicTranscript extends Component { border-radius: 0px; width: 66px; } + .linhe15{ + line-height: 15px; + } `} {datas===undefined?"":