试题库 筛选数据功能

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

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

Loading…
Cancel
Save