From d7fec12bb040f8a3f44a1743829dfadeb5ab780f 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, 2 Jan 2020 14:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 3 +- .../modules/question/component/Contentpart.js | 8 +++- .../src/modules/testpaper/Testpaperlibrary.js | 46 ++++++++++++------- .../testpaper/component/Contentpart.js | 4 +- 4 files changed, 41 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index c1b53d780..c4d0d3bfe 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -170,6 +170,7 @@ class Question extends Component { this.setState({ defaultActiveKey: key, selectallquestionsonthispages:false, + difficulty:null, }) var data = { discipline_id:this.state.discipline_id, @@ -177,7 +178,7 @@ class Question extends Component { tag_discipline_id:this.state.tag_discipline_id, public: key, item_type: this.state.item_type, - difficulty: this.state.difficulty, + difficulty: null, page: 1, per_page:10, }; diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index dbb1b4817..952c56f2f 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -40,8 +40,10 @@ class Contentpart extends Component { const content = (
this.props.setitem_types(null)}>全部
+this.props.setitem_types("SINGLE")}>单选题
this.props.setitem_types("MULTIPLE")}>多选题
@@ -56,8 +58,10 @@ class Contentpart extends Component { const contents = (this.props.setdifficulty(null)}>全部
+this.props.setdifficulty(1)}>简单
this.props.setdifficulty(2)}>适中
diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index 24eb130f2..5dcc35f60 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -96,8 +96,13 @@ class Testpaperlibrary extends Component { }) var data={ page:pages, + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + keywords: null, per_page:10, - public:this.state.defaultActiveKey, } this.getdata(data); } @@ -114,20 +119,31 @@ class Testpaperlibrary extends Component { keywords: value, }) var data={ - page:1, + page:this.state.page, + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + keywords: value, per_page:10, - public:this.state.defaultActiveKey, } this.getdata(data); } callback = (key) => { this.setState({ defaultActiveKey: key, + difficulty:null }) var data={ - page:1, + page:this.state.page, + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: key, + difficulty: this.state.difficulty, + keywords: this.state.keywords, per_page:10, - public:key, } this.getdata(data); } @@ -178,9 +194,9 @@ class Testpaperlibrary extends Component { sub_discipline_id:null, tag_discipline_id:null, public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: this.state.keywords, - page: this.state.page, + difficulty: null, + keywords: null, + page: 1, per_page:10, }; this.getdata(data); @@ -196,9 +212,9 @@ class Testpaperlibrary extends Component { sub_discipline_id:sub_discipline_id, tag_discipline_id:null, public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: this.state.keywords, - page: this.state.page, + difficulty: null, + keywords: null, + page:1, per_page:10, }; this.getdata(data); @@ -213,17 +229,15 @@ class Testpaperlibrary extends Component { sub_discipline_id:this.state.sub_discipline_id, tag_discipline_id:tag_discipline_id, public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: this.state.keywords, - page: this.state.page, + difficulty: null, + keywords: null, + page: 1, per_page:10, }; this.getdata(data); } - setdifficulty=(bool)=>{ - } modalCancels=()=>{ this.setState({ modalsTypes: false diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index 3ffca34c5..9e9cd246a 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -44,8 +44,10 @@ class Contentpart extends Component { const contents = (this.props.setdifficulty(null)}>全部
+this.props.setdifficulty(1)}>简单
this.props.setdifficulty(2)}>适中