From a68b93b8b1102a0d8cd8585594c9f01706da8ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 26 Dec 2019 10:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E9=A2=98=E5=BA=93=20=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=95=B0=E6=8D=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 66 +++++++++++++++---- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index 5bc4c6614..bbb25c57c 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -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 { {/*