competitions
杨树明 6 years ago
parent 66f03ecea2
commit 1e4d6e8f2b

@ -528,6 +528,7 @@ class Coursesleftnav extends Component{
axios.post(url, axios.post(url,
{name:value}).then((result)=>{ {name:value}).then((result)=>{
if(result!=undefined){
if(result.data.status===0){ if(result.data.status===0){
// window.location.reload() // window.location.reload()
this.updasaveNavmoda() this.updasaveNavmoda()
@ -537,9 +538,19 @@ class Coursesleftnav extends Component{
description:result.data.message description:result.data.message
}); });
trigger('updateNavSuccess') trigger('updateNavSuccess')
if(positiontype==="files"){ if(positiontype==="files"){
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
// this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`) }
if(positiontype==="boards"){
window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`;
}
if(positiontype==="course_groups"){
window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`;
}
} }
} }
}).catch((error)=>{ }).catch((error)=>{
@ -549,6 +560,7 @@ class Coursesleftnav extends Component{
saveboardpost=(url,value)=>{ saveboardpost=(url,value)=>{
axios.put(url, axios.put(url,
{name:value}).then((result)=>{ {name:value}).then((result)=>{
if(result!=undefined){
if(result.data.status===0){ if(result.data.status===0){
// window.location.reload() // window.location.reload()
this.updasaveNavmoda() this.updasaveNavmoda()
@ -560,6 +572,7 @@ class Coursesleftnav extends Component{
description:result.data.message description:result.data.message
}); });
} }
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
@ -599,7 +612,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId; let newid=this.props.match.params.coursesId;
let url="/courses/"+newid+"/course_groups.json"; let url="/courses/"+newid+"/course_groups.json";
this.saveNavmodapost(url,NavmodalValue) this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===3){ }else if(Navmodaltypename===3){
@ -620,7 +633,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId; let newid=this.props.match.params.coursesId;
let url = "/courses/"+newid+"/boards.json"; let url = "/courses/"+newid+"/boards.json";
this.saveNavmodapost(url,NavmodalValue) this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===7) { }else if(Navmodaltypename===7) {
@ -708,6 +721,7 @@ class Coursesleftnav extends Component{
droppablepost=(url,list)=>{ droppablepost=(url,list)=>{
axios.post(url,{position: list}).then((result)=>{ axios.post(url,{position: list}).then((result)=>{
if(result!=undefined){
// this.updasaveNavmoda(result.data.message) // this.updasaveNavmoda(result.data.message)
this.updasaveNavmoda() this.updasaveNavmoda()
// //
@ -715,6 +729,7 @@ class Coursesleftnav extends Component{
message:"提示", message:"提示",
description:result.data.message description:result.data.message
}); });
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })

@ -19,7 +19,7 @@ class Exercisestatisticalresult extends Component {
super(props); super(props);
this.state = { this.state = {
data:undefined, data:undefined,
sort:"percent", sort:"asc",
exercise_group_id:[], exercise_group_id:[],
page:1, page:1,
limit:10, limit:10,
@ -69,12 +69,19 @@ class Exercisestatisticalresult extends Component {
} }
onSortTypeChange=(value)=>{ onSortTypeChange=()=>{
let{exercise_group_id,page,limit}=this.state; let{exercise_group_id,page,limit,sort}=this.state;
let newdesc="asc";
if(sort==="desc"){
newdesc="asc"
}else{
newdesc="desc"
}
this.setState({ this.setState({
sort:value sort:newdesc
}) })
this.updatefun(value,exercise_group_id,page,limit)
this.updatefun(newdesc,exercise_group_id,page,limit)
} }
funtaskstatustwo=(checkedValues,list)=>{ funtaskstatustwo=(checkedValues,list)=>{
@ -177,7 +184,7 @@ class Exercisestatisticalresult extends Component {
</style> </style>
<div className="stud-class-set fafafa"> <div className="stud-class-set fafafa">
<li className="drop_down fr mt10 mr33" onClick={() => this.onSortTypeChange('percent')}> <li className="drop_down fr mt10 mr33 cursor" onClick={() => this.onSortTypeChange()}>
{/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/} {/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/}
{/*<i className="iconfont icon-xiajiantou font-12 ml2"></i>*/} {/*<i className="iconfont icon-xiajiantou font-12 ml2"></i>*/}
{/*<ul className="drop_down_normal">*/} {/*<ul className="drop_down_normal">*/}

Loading…
Cancel
Save