试题库 筛选数据功能

yslnewtiku
杨树林 5 years ago
parent 6a8de41685
commit a68b93b8b1

@ -23,8 +23,6 @@ class Question extends Component {
constructor(props) {
super(props);
this.state = {
page: 1,
limit: 20,
count: 50,
defaultActiveKey: 1,
Headertop: "",
@ -53,6 +51,8 @@ class Question extends Component {
program_questions_count: 0,
single_questions_count: 0,
subjective_questions_count: 0,
page:1,
per_page:20,
}
}
@ -61,7 +61,9 @@ class Question extends Component {
componentDidMount() {
let {defaultActiveKey} = this.state;
var data = {
public: defaultActiveKey
public: defaultActiveKey,
page:1,
per_page:20,
};
this.getdata(data);
@ -90,6 +92,8 @@ class Question extends Component {
public: key,
item_type: this.state.item_type,
difficulty: this.state.difficulty,
page: this.state.page,
per_page:20,
};
this.getdata(data);
@ -119,8 +123,19 @@ class Question extends Component {
});
}
paginationonChange = () => {
paginationonChange = (pageNumber) => {
this.setState({
page: pageNumber,
})
var data = {
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: pageNumber,
per_page:20,
};
this.getdata(data);
}
showDrawer = () => {
this.setState({
@ -190,6 +205,9 @@ class Question extends Component {
}
setDownloads=(item_type)=>{
this.Deletebigquestiontype(item_type);
this.setState({
modalsTypes: false
})
}
setDownload = () => {
//确认
@ -215,6 +233,8 @@ class Question extends Component {
public: this.state.defaultActiveKey,
difficulty: difficulty,
item_type: this.state.item_type,
page: this.state.page,
per_page:20,
};
this.getdata(data);
@ -230,6 +250,8 @@ class Question extends Component {
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: item_type,
page: this.state.page,
per_page:20,
};
this.getdata(data);
@ -272,6 +294,8 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: e.target.value,
page: this.state.page,
per_page:20,
};
this.getdata(data);
@ -286,6 +310,8 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: value,
page: this.state.page,
per_page:20,
};
this.getdata(data);
@ -304,6 +330,8 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
};
this.getdata(data);
}
@ -324,6 +352,8 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
};
this.getdata(data);
}
@ -379,9 +409,14 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
};
this.getdata(data);
this.getbasket_listdata();
this.setState({
visible:true
})
}
}).catch((error) => {
console.log(error);
@ -401,6 +436,8 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
};
this.getdata(data);
this.getbasket_listdata();
@ -437,6 +474,8 @@ class Question extends Component {
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:20,
};
this.getdata(data);
this.getbasket_listdata();
@ -453,7 +492,7 @@ class Question extends Component {
render() {
let {
page, limit, count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count
} = this.state;
@ -528,11 +567,16 @@ class Question extends Component {
{/*<div className="clearfix mt5">*/}
{/*<div className="educontent mt10 pb20 w1200s">*/}
{/* fenye*/}
{
items_count&&items_count>20?
<div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={limit}
total={count}></Pagination>
pageSize={per_page}
total={items_count}></Pagination>
</div>
:""
}
{/*抽屉效果*/}
<style>

Loading…
Cancel
Save