From b30367bb84985e7db740c0b9d7d188ad59e8e800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 6 Jan 2020 16:20:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 49 ++++++++++++++-- .../modules/question/component/Contentpart.js | 56 ++++++++++++------- .../question/component/Headplugselections.js | 4 +- .../modules/question/component/Listjihe.js | 52 ++++++++++++++--- .../question/questioncss/questioncom.css | 27 +++++++++ .../modules/testpaper/component/Listjihe.js | 12 ++-- .../testpaper/testioncss/testioncss.css | 13 +++++ 7 files changed, 174 insertions(+), 39 deletions(-) diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index d017e3187..73b7eb00d 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -62,6 +62,7 @@ class Question extends Component { disciplinesdatakc:0, disciplinesdatazsd:0, selectallquestionsonthispages:false, + oj_status:null, } } @@ -73,6 +74,7 @@ class Question extends Component { keywords:"", page:1, per_page:10, + oj_status:null }) var data = { discipline_id:discipline_id, @@ -84,6 +86,7 @@ class Question extends Component { keywords: null, page: this.state.page, per_page:10, + oj_status:null }; this.getdata(data); @@ -96,6 +99,7 @@ class Question extends Component { keywords:"", page:1, per_page:10, + oj_status:null }) var data = { discipline_id:this.state.discipline_id, @@ -107,6 +111,7 @@ class Question extends Component { keywords:null, page: 1, per_page:10, + oj_status:null }; this.getdata(data); } @@ -117,6 +122,7 @@ class Question extends Component { keywords:"", page:1, per_page:10, + oj_status:null }) var data = { discipline_id:this.state.discipline_id, @@ -128,6 +134,7 @@ class Question extends Component { keywords: null, page: 1, per_page:10, + oj_status:null }; this.getdata(data); } @@ -175,13 +182,14 @@ class Question extends Component { } }); } - + //公共和我的 callback = (key) => { this.setState({ defaultActiveKey: key, selectallquestionsonthispages:false, difficulty:null, - page:1 + page:1, + oj_status:null }) var data = { discipline_id:this.state.discipline_id, @@ -192,6 +200,7 @@ class Question extends Component { difficulty: null, page: 1, per_page:10, + oj_status:null }; this.getdata(data); @@ -245,6 +254,7 @@ class Question extends Component { keywords: this.state.keywords, page: pageNumber, per_page:10, + oj_status:this.state.oj_status }; this.getdata(data); } @@ -340,7 +350,8 @@ class Question extends Component { visiblemys: false, page: 1, per_page:10, - keywords:"" + keywords:"", + oj_status:null }) var data = { @@ -353,6 +364,7 @@ class Question extends Component { keywords:null, page:1, per_page:10, + oj_status:null }; this.getdata(data); @@ -364,7 +376,8 @@ class Question extends Component { visiblemyss: false, page: 1, per_page:10, - keywords:"" + keywords:"", + oj_status:null }) var data = { @@ -376,7 +389,8 @@ class Question extends Component { item_type: item_type, page: 1, per_page:10, - keywords:null + keywords:null, + oj_status:null }; this.getdata(data); @@ -443,6 +457,7 @@ class Question extends Component { keywords: value, page: this.state.page, per_page:10, + oj_status:this.state.oj_status }; this.getdata(data); @@ -646,6 +661,27 @@ class Question extends Component { } + setoj_status=(oj_status)=>{ + //编程题发布未发布 + this.setState({ + selectallquestionsonthispages:false, + difficulty:null, + oj_status:oj_status + }) + var data = { + 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, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + oj_status:oj_status + }; + this.getdata(data); + } render() { let { page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list, @@ -735,7 +771,8 @@ class Question extends Component { handleVisibleChange={(e) => this.handleVisibleChange(e)} showmodels={(e) => this.showmodels(e)} showmodelysl={(e) => this.showmodelysl(e)} - callback={(e) => this.callback(e)}> + callback={(e) => this.callback(e)} + setoj_status={(e)=>this.setoj_status(e)}> { items_count&&items_count>10? diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 0fd38e4e3..7d18f4c11 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -72,13 +72,11 @@ class Contentpart extends Component { width:'93px', height:'161px', }}> -
this.props.setdifficulty(null)}>全部
+this.props.setoj_status(null)}>全部
-this.props.setdifficulty(1)}>简单
+this.props.setoj_status(0)}>未发布
-this.props.setdifficulty(2)}>适中
- -this.props.setdifficulty(3)}>困难
+this.props.setoj_status(1)}>已发布
); @@ -158,15 +156,22 @@ class Contentpart extends Component { :"" } - {/*编程语言:{items.program_attr.language}
:"" } - + { + items.item_type==="PROGRAM"? + items.program_attr.status===0? +未发布
+ :"" + :"" + }+ + 选用 +
+ : +this.Selectingpracticaltraining(items.id)}> + + 选用 +
+ :this.Selectingpracticaltraining(items.id)}> - 选用
+ 选用 + } { defaultActiveKey===0||defaultActiveKey==="0"? @@ -185,11 +204,25 @@ class Listjihe extends Component { } + { + items.public===false? + items.item_type==="PROGRAM"? + items.program_attr.status===0? + "" + : +this.props.showmodels(items.id)}> + + 公开 +
+ : +this.props.showmodels(items.id)}> + + 公开 +
+ : + "" + } -this.props.showmodels(items.id)}> - - 公开 -
编辑
-this.props.showmodels(items.id)} > - - 公开 -
+ { + items.public === false ? +this.props.showmodels(items.id)}> + + 公开 +
+ :"" + }