Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_aliyun_beta
cxt 5 years ago
commit 3519428066

@ -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;}

@ -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;}
/*延时*/

@ -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;}
/*延时*/

@ -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)}
/>
</div>

@ -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) => (
<span>
<span className={"task-hide"} style={{color:"#676767"}}><a className="tasknameName font-14" onClick={()=>this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>56?record.taskname.name:""} >
{record.taskname.name}{record.taskname.complete_status===2?<span className={"tasknamebox ml10"}>延时</span>:record.taskname.complete_status===3?<span className={"tasknameboxs ml10"}></span>:""}
</a></span>
<span className={"task-hide linhe15"} style={{color:"#676767"}}><a className="tasknameName font-14" onClick={()=>this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>15?record.taskname.name:""} >
{record.taskname.name}
</a>
{record.taskname.complete_status===2?<span className={"tasknamebox ml10"}>延时</span>:record.taskname.complete_status===3?<span className={"tasknameboxs ml10"}></span>:""}
</span>
</span>
),
}, {
@ -159,9 +191,9 @@ class OfficialAcademicTranscript extends Component {
render: (text, record) => (
<span>
<a><InputNumber size="small" defaultValue={record.game_scores.game_score}
onChange={(e) => this.editgame_scores(e,record.challenge_id.id)}
min={0} max={record.game_scores.game_score_full}
<a><InputNumber size="small" className={customsids===record.challenge_id.id?"bor-red":""} defaultValue={record.game_scores.game_score}
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>*/}
</span>
@ -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;
}
`}
</style>
{datas===undefined?"":<Table

@ -526,7 +526,7 @@ input::-ms-clear{display:none;}
.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;}
/*延时*/

@ -345,7 +345,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;}

Loading…
Cancel
Save