调整题库

yslnewtiku
杨树林 5 years ago
parent d6de7bf531
commit c6e68308fa

@ -52,7 +52,7 @@ class Question extends Component {
single_questions_count: 0,
subjective_questions_count: 0,
page:1,
per_page:20,
per_page:10,
disciplinesdata:[],
discipline_id:null,
sub_discipline_id:null,
@ -78,7 +78,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
@ -98,7 +98,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
}
@ -116,7 +116,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
}
@ -130,7 +130,7 @@ class Question extends Component {
tag_discipline_id:this.state.tag_discipline_id,
public: defaultActiveKey,
page:1,
per_page:20,
per_page:10,
};
this.getdata(data);
@ -161,33 +161,6 @@ class Question extends Component {
this.setState({
disciplinesdata: response.data.disciplines,
})
const didata = response.data.disciplines;
var kc=0;
var zsd=0;
for (var i = 0; i < didata.length; i++) {
//方向
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
kc=kc+1;
//课程
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
zsd=zsd+1;
}
}
}
this.setState({
disciplinesdata: response.data.disciplines,
disciplinesdatakc:kc,
disciplinesdatazsd:zsd,
})
}
});
}
@ -204,7 +177,7 @@ class Question extends Component {
item_type: this.state.item_type,
difficulty: this.state.difficulty,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
@ -257,7 +230,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: pageNumber,
per_page:20,
per_page:10,
};
this.getdata(data);
}
@ -361,7 +334,7 @@ class Question extends Component {
difficulty: difficulty,
item_type: this.state.item_type,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
@ -381,7 +354,7 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: item_type,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
@ -428,7 +401,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: e.target.value,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
@ -447,7 +420,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: value,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
@ -470,7 +443,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
}
@ -495,7 +468,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
}
@ -555,7 +528,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
this.getbasket_listdata();
@ -585,7 +558,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
this.getbasket_listdata();
@ -626,7 +599,7 @@ class Question extends Component {
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
per_page:10,
};
this.getdata(data);
this.getbasket_listdata();
@ -724,7 +697,7 @@ class Question extends Component {
{/*<div className="educontent mt10 pb20 w1200s">*/}
{/* fenye*/}
{
items_count&&items_count>20?
items_count&&items_count>10?
<div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page}

@ -81,9 +81,36 @@ class Headplugselection extends Component {
// console.log(this.props.disciplinesdata);
// disciplinesdatakc:kc,
// disciplinesdatazsd:zsd,
var kc=0;
var zsd=0;
console.log(this.props.disciplinesdatakc);
console.log(this.props.disciplinesdatazsd);
if(this.props.disciplinesdata){
const didata = this.props.disciplinesdata;
for (var i = 0; i < didata.length; i++) {
//方向
const fxdidata = didata[i].sub_disciplines;
if(titlestting===didata[i].name){
for (var j = 0; j < fxdidata.length; j++) {
kc=kc+1;
//课程
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
zsd=zsd+1;
}
}
}else if(titlestting==="全部"){
kc=kc+1;
zsd=zsd+1;
}else{
}
}
}
return (
<div className=" clearfix mt21 ">
<div className="educontent w1200dbl">
@ -110,7 +137,7 @@ class Headplugselection extends Component {
</div>
{/*课程*/}
{
this.props.disciplinesdatakc===0?
kc===0?
""
:
<div className="mt30 sortinxdirection">
@ -153,7 +180,7 @@ class Headplugselection extends Component {
}
{/*知识点*/}
{
this.props.disciplinesdatazsd===0?
zsd===0?
""
:<div className="mt30 sortinxdirection">
<div className="w60 tophomsembolds">

Loading…
Cancel
Save