dev_hjm
杨树林 6 years ago
parent 612d455a7a
commit d3ad02535a

@ -156,12 +156,6 @@ class ShixunStudentWork extends Component {
datalist:datas, datalist:datas,
lunxun:false, lunxun:false,
}); });
}else {
setInterval(() => {
if(this.state.lunxun===true){
this.getupdata();
}
}, 5000);
} }
} }
} }
@ -182,7 +176,13 @@ class ShixunStudentWork extends Component {
description: response.data.message description: response.data.message
}); });
} }
setInterval(() => {
console.log("开始轮询了");
if(this.state.lunxun===true){
console.log("开始轮询了getupdata");
this.getupdatasysk();
}
}, 5000);
}).catch((error) => { }).catch((error) => {
@ -194,6 +194,53 @@ class ShixunStudentWork extends Component {
this.setState({ this.setState({
shixuntypes:type[3] shixuntypes:type[3]
}) })
};
getupdatasysk=(pages)=>{
let {order,b_order,page,limit,group_infolist,search}=this.state;
var homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/" + homeworkid + "/code_review_results.json";
axios.get(url,{params:{
order:order,
sort:b_order,
page:pages===undefined?page:pages,
limit:limit,
group_ids:group_infolist,
search:search
},
paramsSerializer: function(params) {
return qs.stringify(params, {arrayFormat: 'brackets'})
}}).then((response) => {
if (response.data.status === undefined || response.data.status === 0) {
if(response.data!=undefined){
if(response.data.status!=-2){
let datas=[];
let list=response.data.users_reviews;
for(var i=0; i<list.length; i++){
datas.push({
number:i+1,
name:list[i].username,
stduynumber:list[i].student_id,
classroom:parseInt(list[i].code_rate),
operating:list[i].user_id
})
}
this.setState({
data: response.data,
datalist:datas,
lunxun:false,
});
}
}
}
}).catch((error) => {
console.log(error)
});
} }
getcode_review_results=(order,b_order,page,limit,group_infolist,search)=>{ getcode_review_results=(order,b_order,page,limit,group_infolist,search)=>{

Loading…
Cancel
Save