From f439a4abfe16ba5f68713c625ec55c9775bb806d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 21 Jan 2020 21:59:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/question/NewMyShixunModel.js | 86 ++++++++++++----- .../modules/question/Paperreview_single.js | 29 ++++-- public/react/src/modules/question/Question.js | 92 +++++++++++++------ .../modules/question/Questionitem_banks.js | 2 +- .../modules/question/component/Contentpart.js | 4 +- .../question/component/Headplugselections.js | 9 +- .../question/component/Itembankstop.js | 44 ++++++--- .../modules/question/component/Listjihe.js | 55 +++++++---- .../question/component/Newknledpots.js | 14 ++- .../question/component/QuestionModalys.js | 42 +++++++++ .../comthetestpaper/Comthetestpaperst.js | 58 +++++++----- .../comthetestpaper/Intelligentcomponents.js | 72 +++++++++------ .../question/questioncss/questioncom.css | 8 +- .../src/modules/testpaper/Testpaperlibrary.js | 40 ++++---- .../modules/testpaper/component/Listjihe.js | 14 ++- .../component/Paperlibraryseeid_items.js | 25 +++-- .../testpaper/testioncss/testioncss.css | 7 ++ public/react/src/modules/tpm/NewHeader.js | 35 ++++--- 18 files changed, 439 insertions(+), 197 deletions(-) create mode 100644 public/react/src/modules/question/component/QuestionModalys.js diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index 232ba9d72..d50f41484 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -20,6 +20,7 @@ import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import Bottomsubmit from "../modals/Bottomsubmit"; +import QuestionModalys from "./component/QuestionModalys"; //exam_id 试卷的id class NewMyShixunModel extends Component { @@ -67,15 +68,28 @@ class NewMyShixunModel extends Component { oj_status:null, isVisible: false, selectionbools:false, + chakanjiexiboolindex:"无", } } + + chakanjiexibool=(index)=>{ + if(this.state.chakanjiexiboolindex===index){ + this.setState({ + chakanjiexiboolindex:"无", + }) + return + } + this.setState({ + chakanjiexiboolindex:index, + }) + } setdiscipline_id=(discipline_id)=>{ this.setState({ discipline_id:discipline_id, sub_discipline_id:null, tag_discipline_id:null, - keywords:"", + keyword:"", page:1, per_page:10, oj_status:null @@ -87,7 +101,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: null, + keyword: null, page: this.state.page, per_page:10, oj_status:null, @@ -101,7 +115,7 @@ class NewMyShixunModel extends Component { this.setState({ sub_discipline_id:sub_discipline_id, tag_discipline_id:null, - keywords:"", + keyword:"", page:1, per_page:10, oj_status:null @@ -113,7 +127,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords:null, + keyword:null, page: 1, per_page:10, oj_status:null, @@ -125,7 +139,7 @@ class NewMyShixunModel extends Component { settag_discipline_id=(tag_discipline_id)=>{ this.setState({ tag_discipline_id:tag_discipline_id, - keywords:"", + keyword:"", page:1, per_page:10, oj_status:null @@ -137,7 +151,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: null, + keyword: null, page: 1, per_page:10, oj_status:null, @@ -355,7 +369,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: pageNumber, per_page:10, oj_status:this.state.oj_status, @@ -463,7 +477,7 @@ class NewMyShixunModel extends Component { visiblemys: false, page: 1, per_page:10, - keywords:"", + keyword:"", oj_status:null }) @@ -474,7 +488,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: difficulty, item_type: this.state.item_type, - keywords:null, + keyword:null, page:1, per_page:10, oj_status:null, @@ -490,7 +504,7 @@ class NewMyShixunModel extends Component { visiblemyss: false, page: 1, per_page:10, - keywords:"", + keyword:"", oj_status:null }) @@ -503,7 +517,7 @@ class NewMyShixunModel extends Component { item_type: item_type, page: 1, per_page:10, - keywords:null, + keyword:null, oj_status:null, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; @@ -524,6 +538,19 @@ class NewMyShixunModel extends Component { } } + showmodelsInaudit = (e) => { + this.setState({ + modalsTypeInaudit: true, + titilesm: "公开申请已提交,请等待管理员的审核", + titiless: "我们将在1-2个工作日内完成审核", + }) + }; + modalsTypeInauditbool=()=>{ + this.setState({ + modalsTypeInaudit:false, + }) + } + handleVisibleChanges = (boll) => { if (this.state.visiblemys === true) { @@ -541,13 +568,13 @@ class NewMyShixunModel extends Component { setdatafunsval = (e) => { this.setState({ - keywords: e.target.value + keyword: e.target.value }) } setdatafuns = (value) => { this.setState({ - keywords: value, + keyword: value, }) var data = { discipline_id:this.state.discipline_id, @@ -556,7 +583,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: value, + keyword: value, page: this.state.page, per_page:10, oj_status:this.state.oj_status, @@ -581,7 +608,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), @@ -607,7 +634,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), @@ -675,7 +702,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), @@ -706,7 +733,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), @@ -732,7 +759,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), @@ -805,7 +832,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), @@ -842,7 +869,7 @@ class NewMyShixunModel extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, oj_status:oj_status, @@ -856,7 +883,8 @@ class NewMyShixunModel extends Component { let { 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,selectionbools + program_questions_count, single_questions_count, subjective_questions_count,selectionbools, + modalsTypeInaudit } = this.state; const Datacount = completion_questions_count + judgement_questions_count @@ -914,7 +942,12 @@ class NewMyShixunModel extends Component { setDownload={() => this.setDownload()}> :"" } - + { + modalsTypeInaudit===true? + this.modalsTypeInauditbool()} + setDownload={() => this.modalsTypeInauditbool()}> + :"" + } {/*顶部*/} this.chakanjiexibool(e)} getitem_basketss={(id)=>this.getitem_basketss(id)} selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} getitem_baskets={(e)=>this.getitem_baskets(e)} @@ -941,7 +976,10 @@ class NewMyShixunModel extends Component { showmodels={(e) => this.showmodels(e)} showmodelysl={(e) => this.showmodelysl(e)} callback={(e) => this.callback(e)} - setoj_status={(e)=>this.setoj_status(e)}> + setoj_status={(e)=>this.setoj_status(e)} + showmodelsInaudit={(e)=>this.showmodelsInaudit(e)} + + > { items_count&&items_count>10? diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index 0875506e1..3eacc9c16 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -26,6 +26,7 @@ const tagArray = [ ] //单选题 +//Paperlibraryseeid_items.js Listjihe.js class Paperreview_single extends Component { constructor(props) { super(props); @@ -165,10 +166,16 @@ class Paperreview_single extends Component {
- + { + itemssname===null|| itemssname===undefined? + "" + : + + } +
@@ -202,10 +209,16 @@ class Paperreview_single extends Component { objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description?

- + { + itemsnamesy===null || itemsnamesy===undefined? + "" + : + + } +

: ""} diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index f1f139257..ba0b10b68 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -20,6 +20,7 @@ import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import SiderBars from "../question/component/SiderBars"; +import QuestionModalys from "./component/QuestionModalys"; class Question extends Component { constructor(props) { @@ -32,6 +33,7 @@ class Question extends Component { visible: false, placement: 'right', modalsType: false, + modalsTypeInaudit:false, modalsTypes:false, titilesm: "在平台审核后,所有成员均可使用试题", titiless: "是否设置为公开?", @@ -92,7 +94,7 @@ class Question extends Component { discipline_id:discipline_id, sub_discipline_id:null, tag_discipline_id:null, - keywords:"", + keyword:"", page:1, per_page:10, oj_status:null @@ -104,7 +106,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: null, + keyword: null, page: this.state.page, per_page:10, oj_status:null @@ -117,7 +119,7 @@ class Question extends Component { this.setState({ sub_discipline_id:sub_discipline_id, tag_discipline_id:null, - keywords:"", + keyword:"", page:1, per_page:10, oj_status:null @@ -129,7 +131,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords:null, + keyword:null, page: 1, per_page:10, oj_status:null @@ -140,7 +142,7 @@ class Question extends Component { settag_discipline_id=(tag_discipline_id)=>{ this.setState({ tag_discipline_id:tag_discipline_id, - keywords:"", + keyword:"", page:1, per_page:10, oj_status:null @@ -152,7 +154,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: null, + keyword: null, page: 1, per_page:10, oj_status:null @@ -213,12 +215,19 @@ class Question extends Component { } //刷新加载 - getdata = (data) => { + getdata = (data,bool) => { const url = `/item_banks.json`; - this.setState({ - booljupyterurls:true, - selectionbools:false, - }) + if(bool){ + this.setState({ + selectionbools:false, + }) + }else { + this.setState({ + booljupyterurls:true, + selectionbools:false, + }) + } + axios.get((url), {params: data}).then((response) => { setTimeout(()=>{ this.setState({ @@ -335,7 +344,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: pageNumber, per_page:10, oj_status:this.state.oj_status @@ -389,6 +398,16 @@ class Question extends Component { timuid: id }) }; + + showmodelsInaudit = (e) => { + this.setState({ + modalsTypeInaudit: true, + titilesm: "公开申请已提交,请等待管理员的审核", + titiless: "我们将在1-2个工作日内完成审核", + }) + }; + + showmodelysl = (id) => { this.setState({ modalsType: true, @@ -398,7 +417,11 @@ class Question extends Component { timuid: id }) }; - + modalsTypeInauditbool=()=>{ + this.setState({ + modalsTypeInaudit:false, + }) + } modalCancel = () => { this.setState({ @@ -443,7 +466,7 @@ class Question extends Component { visiblemys: false, page: 1, per_page:10, - keywords:"", + keyword:"", oj_status:null }) @@ -454,7 +477,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: difficulty, item_type: this.state.item_type, - keywords:null, + keyword:null, page:1, per_page:10, oj_status:null @@ -469,7 +492,7 @@ class Question extends Component { visiblemyss: false, page: 1, per_page:10, - keywords:"", + keyword:"", oj_status:null }) @@ -482,7 +505,7 @@ class Question extends Component { item_type: item_type, page: 1, per_page:10, - keywords:null, + keyword:null, oj_status:null }; @@ -519,13 +542,13 @@ class Question extends Component { setdatafunsval = (e) => { this.setState({ - keywords: e.target.value + keyword: e.target.value }) } setdatafuns = (value) => { this.setState({ - keywords: value, + keyword: value, }) var data = { discipline_id:this.state.discipline_id, @@ -534,7 +557,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: value, + keyword: value, page: this.state.page, per_page:10, oj_status:this.state.oj_status @@ -558,11 +581,11 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, }; - this.getdata(data); + this.getdata(data,true); } }) .catch(function (error) { @@ -583,11 +606,11 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, }; - this.getdata(data); + this.getdata(data,true); } }).catch((error) => { ////console.log(error); @@ -643,7 +666,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, }; @@ -673,7 +696,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, }; @@ -741,7 +764,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, }; @@ -777,7 +800,7 @@ class Question extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: this.state.item_type, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, oj_status:oj_status @@ -792,7 +815,8 @@ class Question extends Component { let { 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,selectionbools + program_questions_count, single_questions_count, subjective_questions_count,selectionbools, + modalsTypeInaudit } = this.state; const Datacount = completion_questions_count + judgement_questions_count @@ -852,6 +876,12 @@ class Question extends Component { setDownload={() => this.setDownload()}> :"" } + { + modalsTypeInaudit===true? + this.modalsTypeInauditbool()} + setDownload={() => this.modalsTypeInauditbool()}> + :"" + } @@ -920,7 +950,9 @@ class Question extends Component { showmodels={(e) => this.showmodels(e)} showmodelysl={(e) => this.showmodelysl(e)} callback={(e) => this.callback(e)} - setoj_status={(e)=>this.setoj_status(e)}> + setoj_status={(e)=>this.setoj_status(e)} + showmodelsInaudit={(e)=>this.showmodelsInaudit(e)} + > { items_count&&items_count>10? diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index 549bcc5ae..d62b4f1df 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -465,7 +465,7 @@ class Questionitem_banks extends Component { sub_discipline_id: Getdatasdata[3].rbkc[1], tag_discipline_id: myrbkc, }); - this.props.history.replace('/problems/new'); + window.open("/problems/new"); } diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 96ac64153..61a0fb8ea 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -319,7 +319,9 @@ class Contentpart extends Component { getitem_basketss={(id)=>this.props.getitem_basketss(id)} getitem_baskets={(e)=>this.props.getitem_baskets(e)} showmodels={(e)=>this.props.showmodels(e)} - showmodelysl={(e)=>this.props.showmodelysl(e)}> + showmodelysl={(e)=>this.props.showmodelysl(e)} + showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} + > ) diff --git a/public/react/src/modules/question/component/Headplugselections.js b/public/react/src/modules/question/component/Headplugselections.js index 643729ec1..b3da84054 100644 --- a/public/react/src/modules/question/component/Headplugselections.js +++ b/public/react/src/modules/question/component/Headplugselections.js @@ -231,11 +231,16 @@ class Headplugselections extends Component { { disciplinesdata&&disciplinesdata.map((item,key)=>{ return( - trigger.parentNode} overlay={overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}> + item.sub_disciplines.length>0? + trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}> +
  • this.shixunsearchAll(item.id)}> + {item.name} +
  • +
    + :
  • this.shixunsearchAll(item.id)}> {item.name}
  • -
    ) }) } diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index b7143f6a1..e1fa235e8 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -58,7 +58,7 @@ class Itembankstop extends Component { NewknTypedel:false, boolred:false, boolnews:false, - + sub_disciplineslength:1, } } @@ -463,15 +463,22 @@ class Itembankstop extends Component { const didata = this.props.disciplinesdata; const knowledgepointsdata = []; - + var sub_disciplineslength=0; for (var i = 0; i < didata.length; i++) { //方向 if (value[0] === didata[i].id) { const fxdidata = didata[i].sub_disciplines; + try { + sub_disciplineslength=fxdidata.length; + }catch (e) { + + } for (var j = 0; j < fxdidata.length; j++) { //课程 if (value[1] === fxdidata[j].id) { + const zsddata = fxdidata[j].tag_disciplines; + for (var k = 0; k < zsddata.length; k++) { //知识点 knowledgepointsdata.push(zsddata[k]); @@ -491,6 +498,7 @@ class Itembankstop extends Component { Knowpoints: [], knowledgepoints: knowledgepointsdata, knowledgepoints2:knowledgepointsdata, + sub_disciplineslength:sub_disciplineslength, }) this.props.form.setFieldsValue({ @@ -559,10 +567,15 @@ class Itembankstop extends Component { } NewknTypedeldel=(bool)=>{ + if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){ this.props.showNotification(`请选择课程方向`); return; } + // if(this.state.sub_disciplineslength===undefined || this.state.sub_disciplineslength===null || this.state.sub_disciplineslength===0){ + // this.props.showNotification(`无二级课程时没有新建入口`); + // return; + // } this.setState({ NewknTypedel:bool }) @@ -723,20 +736,22 @@ class Itembankstop extends Component { )} - + > {getFieldDecorator("rbzsd" )(
    - + @@ -746,7 +761,10 @@ class Itembankstop extends Component {
    )} -
    + + + } + { this.state.Knowpoints===undefined||this.state.Knowpoints===null?"": this.state.Knowpoints.length>0? diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 92a5a9e3a..cdca0367e 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -23,7 +23,7 @@ const tagArrays = [ 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] - +//Paperreview_single.js Paperlibraryseeid_items.js class Listjihe extends Component { constructor(props) { super(props); @@ -151,7 +151,10 @@ class Listjihe extends Component { }catch (e) { analysisnames=items&&items.analysis; } + console.log(items.name); + console.log(itemsnamesy); + console.log(analysisnames); return (
    @@ -190,6 +193,7 @@ class Listjihe extends Component { "" : items.name.length>0? + itemssname===null|| itemssname===undefined?"": : items.item_type === "PROGRAM" ?

    -

    +

    { items&&items.program_attr&&items.program_attr.description?

    - - + { + itemsnamesy===null || itemsnamesy===undefined? + "" + : + + }

    :"" } @@ -346,7 +354,7 @@ class Listjihe extends Component { this.props.Isitapopup&&this.props.Isitapopup==="true"? "" : - +

    编辑 @@ -366,16 +374,26 @@ class Listjihe extends Component { { items.public === false ? items.item_type === "PROGRAM" ? - items.program_attr.status === 0 ? - "" - : - items.apply===false? -

    this.props.showmodels(items.id)}> - - 公开 -

    - : + ( + items.program_attr.status === 0 ? "" + : + items.apply===false? +

    this.props.showmodels(items.id)}> + + 公开 +

    + : + ( + items.public==true? + "" + : +

    this.props.showmodelsInaudit(e)}> + + 公开审核中 +

    + ) + ) :items.apply===false?

    this.props.showmodels(items.id)}> @@ -433,7 +451,7 @@ class Listjihe extends Component {

    -

    {items ? @@ -442,6 +460,7 @@ class Listjihe extends Component { "" : items.analysis.length>0? + analysisnames===null || analysisnames===undefined?"": { + if ( str == "" ) return true; + var regu = "^[ ]+$"; + var re = new RegExp(regu); + //为空或纯空格为 true    有值为false + console.log(re.test(str)) + return re.test(str); + } handleChange=(e)=>{ // this.setState({ @@ -20,6 +28,10 @@ class PaperDeletModel extends Component { // }) // //console.log(e.target.value); // //console.log(e.target.value.length); + if(this.isNull(e.target.value)===true){ + this.props.showNotification('不能输入空格'); + return + } this.setState({ newkntypeinput: e.target.value }) @@ -60,7 +72,7 @@ class PaperDeletModel extends Component { >

    - +
    this.props.NewknTypedeldel(false)}>取消 diff --git a/public/react/src/modules/question/component/QuestionModalys.js b/public/react/src/modules/question/component/QuestionModalys.js new file mode 100644 index 000000000..29482e464 --- /dev/null +++ b/public/react/src/modules/question/component/QuestionModalys.js @@ -0,0 +1,42 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Modal} from 'antd'; +import axios from 'axios'; +import './../questioncss/questioncom.css' +//立即申请试用 +class QuestionModalys extends Component { + + constructor(props) { + super(props); + this.state={ + + } + } + + + render() { + + return( + +
    +

    {this.props.titilesm}

    +

    {this.props.titiless}

    + +
    +
    + ) + } +} + +export default QuestionModalys; diff --git a/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js b/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js index bc1e8cd00..662a5a9d5 100644 --- a/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js +++ b/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js @@ -41,7 +41,7 @@ const options = [ ], }, ]; -//Itembankstop 题库的 +//Itembankstop Intelligentcomponents 题库的 class Comthetestpaperst extends Component { constructor(props) { super(props); @@ -56,6 +56,7 @@ class Comthetestpaperst extends Component { options: [], NewknTypedel:false, boolred:false, + sub_disciplineslength:1, } } setboolred=(bool)=>{ @@ -413,11 +414,16 @@ class Comthetestpaperst extends Component { const didata = this.props.disciplinesdata; const knowledgepointsdata = []; - + var sub_disciplineslength=0; for (var i = 0; i < didata.length; i++) { //方向 if (value[0] === didata[i].id) { const fxdidata = didata[i].sub_disciplines; + try { + sub_disciplineslength=fxdidata.length; + }catch (e) { + + } for (var j = 0; j < fxdidata.length; j++) { //课程 if (value[1] === fxdidata[j].id) { @@ -441,6 +447,7 @@ class Comthetestpaperst extends Component { Knowpoints: [], knowledgepoints: knowledgepointsdata, knowledgepoints2:knowledgepointsdata, + sub_disciplineslength:sub_disciplineslength, }) this.props.form.setFieldsValue({ @@ -686,34 +693,39 @@ class Comthetestpaperst extends Component {
    -
    - - {getFieldDecorator("rbzsd" - )( -
    - - - + { + this.state.sub_disciplineslength===null || this.state.sub_disciplineslength===undefined||this.state.sub_disciplineslength===0?"": +
    + + {getFieldDecorator("rbzsd" + )( +
    + + + - this.NewknTypedeldel(true)}/> + this.NewknTypedeldel(true)}/> + +
    + )} +
    - )} - -
    + } + { this.state.Knowpoints===undefined||this.state.Knowpoints===null?"": this.state.Knowpoints.length>0? diff --git a/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js b/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js index 64d57e452..19b08899e 100644 --- a/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js +++ b/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js @@ -20,7 +20,9 @@ import Newknledpots from '../component/Newknledpots'; import Ldanxuan from './lntlligentpone'; const InputGroup = Input.Group; const {Option} = Select; -//Itembankstop Comthetestpaperst 题库的 +// Comthetestpaperst 题库的 +// Itembankstop 题库的 + class Intelligentcomponents extends Component { constructor(props) { super(props); @@ -35,7 +37,8 @@ class Intelligentcomponents extends Component { options: [], NewknTypedel:false, boolred:false, - rbly:"1" + rbly:"1", + sub_disciplineslength:1, } } setboolred=(bool)=>{ @@ -310,11 +313,16 @@ class Intelligentcomponents extends Component { const didata = this.props.disciplinesdata; const knowledgepointsdata = []; - + var sub_disciplineslength=0; for (var i = 0; i < didata.length; i++) { //方向 if (value[0] === didata[i].id) { const fxdidata = didata[i].sub_disciplines; + try { + sub_disciplineslength=fxdidata.length; + }catch (e) { + + } for (var j = 0; j < fxdidata.length; j++) { //课程 if (value[1] === fxdidata[j].id) { @@ -597,34 +605,38 @@ class Intelligentcomponents extends Component {
    -
    - - {getFieldDecorator("rbzsd" - )( -
    - - - - - - - this.NewknTypedeldel(true)}/> - - + { + this.state.sub_disciplineslength === null || this.state.sub_disciplineslength === undefined || this.state.sub_disciplineslength === 0 ? "" : +
    + + {getFieldDecorator("rbzsd" + )( +
    + + + + + + + this.NewknTypedeldel(true)}/> + + + +
    + )} +
    +
    + } -
    - )} -
    -
    { this.state.Knowpoints===undefined||this.state.Knowpoints===null?"": this.state.Knowpoints.length>0? diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index dcfdff84d..98edd9915 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -950,6 +950,12 @@ .mr15{ margin-right: 15px; } +.ant-modal-mask{ + z-index: 6000 !important; +} +.ant-modal-wrap{ + z-index: 6000 !important; +} .fangdatwo{ background: #fefefe; background-color: #fefefe; @@ -960,7 +966,7 @@ top:0px; bottom: 0px; left: 0px; - z-index: 999999; + z-index: 5000; right: 0px; } diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index fe244b9c4..86a267b83 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -30,7 +30,7 @@ class Testpaperlibrary extends Component { public:null, difficulty:null, item_type:null, - keywords:null, + keyword:null, page:1, per_page:10, booljupyterurls:false, @@ -88,7 +88,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:this.state.tag_discipline_id, public: this.state.defaultActiveKey, difficulty: this.state.difficulty, - keywords: null, + keyword: null, per_page:10, } this.getdata(data); @@ -96,14 +96,14 @@ class Testpaperlibrary extends Component { setdatafunsval = (e) => { this.setState({ - keywords: e.target.value + keyword: e.target.value }) } setdatafuns = (value) => { this.setState({ - keywords: value, + keyword: value, }) var data={ page:this.state.page, @@ -112,7 +112,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:this.state.tag_discipline_id, public: this.state.defaultActiveKey, difficulty: this.state.difficulty, - keywords: value, + keyword: value, per_page:10, } this.getdata(data); @@ -121,7 +121,7 @@ class Testpaperlibrary extends Component { this.setState({ defaultActiveKey: key, difficulty:null, - keywords:null, + keyword:null, page:1, }) var data={ @@ -131,7 +131,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:this.state.tag_discipline_id, public: key, difficulty:null, - keywords: null, + keyword: null, per_page:10, } this.getdata(data); @@ -177,7 +177,7 @@ class Testpaperlibrary extends Component { discipline_id:discipline_id, sub_discipline_id:null, tag_discipline_id:null, - keywords:null, + keyword:null, page: 1, per_page:10, }) @@ -187,7 +187,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:null, public: this.state.defaultActiveKey, difficulty: this.props.difficulty, - keywords: null, + keyword: null, page: 1, per_page:10, }; @@ -198,7 +198,7 @@ class Testpaperlibrary extends Component { this.setState({ sub_discipline_id:sub_discipline_id, tag_discipline_id:null, - keywords:null, + keyword:null, page:1, per_page:10, }) @@ -208,7 +208,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:null, public: this.state.defaultActiveKey, difficulty: this.state.difficulty, - keywords: null, + keyword: null, page:1, per_page:10, }; @@ -218,7 +218,7 @@ class Testpaperlibrary extends Component { settag_discipline_id=(tag_discipline_id)=>{ this.setState({ tag_discipline_id:tag_discipline_id, - keywords:null, + keyword:null, page:1, per_page:10, }) @@ -228,7 +228,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:tag_discipline_id, public: this.state.defaultActiveKey, difficulty: this.state.difficulty, - keywords: null, + keyword: null, page: 1, per_page:10, }; @@ -284,7 +284,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:this.state.tag_discipline_id, public: this.state.defaultActiveKey, difficulty: this.state.difficulty, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, }; @@ -310,7 +310,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:this.state.tag_discipline_id, public: this.state.defaultActiveKey, difficulty: this.state.difficulty, - keywords: this.state.keywords, + keyword: this.state.keywords, page: this.state.page, per_page:10, }; @@ -325,7 +325,7 @@ class Testpaperlibrary extends Component { showmodels = (id) => { this.setState({ modalsType: true, - titilesm: "设为公开后,所有成员均可使用试卷", + titilesm: "在平台审核后,所有成员均可使用试题", titiless: "是否设置为公开?", titbool: true, timuid: id @@ -353,7 +353,7 @@ class Testpaperlibrary extends Component { this.setState({ difficulty: difficulty, visiblemys: false, - keywords:"", + keyword:"", page: 1, per_page:10, }) @@ -364,7 +364,7 @@ class Testpaperlibrary extends Component { tag_discipline_id:this.state.tag_discipline_id, public: this.state.defaultActiveKey, difficulty: difficulty, - keywords:null, + keyword:null, page:1, per_page:10, }; @@ -379,7 +379,7 @@ class Testpaperlibrary extends Component { this.setState({ item_type: item_type, visiblemyss: false, - keywords:null, + keyword:null, page: 1, per_page:10, }) @@ -391,7 +391,7 @@ class Testpaperlibrary extends Component { public: this.state.defaultActiveKey, difficulty: this.state.difficulty, item_type: item_type, - keywords:"", + keyword:"", page: 1, per_page:10, }; diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js index 53fc7181a..db08b97f3 100644 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ b/public/react/src/modules/testpaper/component/Listjihe.js @@ -80,7 +80,7 @@ class Listjihe extends Component {
    -

    this.gotoseesj(items.id)}>{names}

    +
    this.gotoseesj(items.id)}>

    {names}

    试题数:{question_counts}

    总分:{total_scores}

    @@ -92,9 +92,15 @@ class Listjihe extends Component { 更新时间:{update_times}

    -

    - 使用次数:{quotess} -

    + { + quotess===null||quotess===undefined||quotess===0? + "" + : +

    + 使用次数:{quotess} +

    + } + { defaultActiveKey===1||defaultActiveKey==="1"?

    diff --git a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js b/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js index 7d66a19c4..c7c974c5b 100644 --- a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js +++ b/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js @@ -24,6 +24,7 @@ const tagArray = [ ] //单选题 +//Paperreview_single.js Listjihe.js class Paperlibraryseeid_items extends Component { constructor(props) { super(props); @@ -160,10 +161,16 @@ class Paperlibraryseeid_items extends Component {

    - + { + itemssname===null || itemssname===undefined? + "" + : + + } +
    @@ -196,10 +203,16 @@ class Paperlibraryseeid_items extends Component { objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description?

    - + /> + } +

    : ""} diff --git a/public/react/src/modules/testpaper/testioncss/testioncss.css b/public/react/src/modules/testpaper/testioncss/testioncss.css index 2025779ab..0426c119c 100644 --- a/public/react/src/modules/testpaper/testioncss/testioncss.css +++ b/public/react/src/modules/testpaper/testioncss/testioncss.css @@ -927,3 +927,10 @@ color:rgba(51,51,51,1); line-height:19px; } +.maxnamewidth100s{ + max-width: 774px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 5ca8e986b..6f970a404 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -940,10 +940,9 @@ submittojoinclass=(value)=>{ width:'93px', height:'80px', }}> -

    试题库

    -

    -

    试卷库

    +

    试题库

    +

    试卷库

    ); return ( @@ -951,7 +950,7 @@ submittojoinclass=(value)=>{
    - {/*
  • */} - {/* */} - {/*
    */} - {/*
    */} - {/* 题库*/} - {/*
    */} - {/*
    */} - {/*
    */} - {/*
  • */} +
  • + +
    +
    + 题库 +
    +
    +
    +
  • Date: Wed, 22 Jan 2020 22:20:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/question/Paperreview_single.js | 12 ++--- .../question/component/ChoquesEditor.js | 30 ++++++++++--- .../question/component/JudquestionEditor.js | 41 ++++++++++++++--- .../modules/question/component/Listjihe.js | 21 +++++++-- .../question/component/SingleEditor.js | 30 ++++++++++--- .../question/questioncss/questioncom.css | 22 ++++++++- .../src/modules/testpaper/Testpaperlibrary.js | 45 +++++++++++++++---- .../testpaper/component/Contentpart.js | 1 + .../modules/testpaper/component/Listjihe.js | 13 +++++- .../testpaper/component/QuestionModalys.js | 42 +++++++++++++++++ 10 files changed, 216 insertions(+), 41 deletions(-) create mode 100644 public/react/src/modules/testpaper/component/QuestionModalys.js diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index 3eacc9c16..c5bfa9832 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -90,6 +90,7 @@ class Paperreview_single extends Component { }catch (e) { itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description; } + var fenshul=(objectsingle.score+"分"); return (
    ({objectsingle.score}分)
    -
    + +
    : -
    -
    +
    ({objectsingle.score}分)
    -
    { itemssname===null|| itemssname===undefined? diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index 3637fad3e..b218f1e88 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -230,7 +230,11 @@ class ChoquesEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - texts=""; + try { + texts=JSON.stringify(value); + }catch (e) { + texts=""; + } } else { if(_text.length>=301){ var result = _text.substring(0,300); @@ -269,9 +273,15 @@ class ChoquesEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl:"" - }) + try { + this.setState({ + question_titleysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; var texts=""; @@ -293,9 +303,15 @@ class ChoquesEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl:"" - }) + try { + this.setState({ + question_titlesysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; var texts=""; diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index 0ab6176b2..cff1f186b 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -187,6 +187,13 @@ class JudquestionEditor extends Component{ }catch (e) { } + const params = this.props && this.props.match && this.props.match.params; + if(JSON.stringify(params) === "{}"){ + //新增 + this.setState({ + zqda:"0" + }) + } } componentDidUpdate(prevProps) { @@ -282,14 +289,29 @@ class JudquestionEditor extends Component{ } onContentChange=(value,quill)=>{ + // console.log("这是题干赋值"); + // console.log(value); + // console.log(quill); const _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; + // console.log(_text); + // console.log(_text.length); if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl:"" - }) + try { + this.setState({ + question_titleysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } + + // console.log("空"); } else { + // console.log("有"); + // 提交到后台的内容需要处理一下; var texts=""; if(_text.length>=1001){ @@ -310,9 +332,16 @@ class JudquestionEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl:"" - }) + try { + this.setState({ + question_titlesysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } + } else { // 提交到后台的内容需要处理一下; var texts=""; diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index cdca0367e..24118ef26 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -319,8 +319,8 @@ class Listjihe extends Component { { items.choosed === true ?

    this.Selectingpracticaltrainings(items.id)}> - - 撤销

    + {/**/} + 撤销

    : items.item_type === "PROGRAM" ? items.program_attr.status === 0 ? @@ -400,7 +400,15 @@ class Listjihe extends Component { 公开

    : - "" + ( + items.public==true? + "" + : +

    this.props.showmodelsInaudit(e)}> + + 公开审核中 +

    + ) : "" } @@ -451,7 +459,12 @@ class Listjihe extends Component {
    -

    + 解析: +

    +

    {items ? diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index dffbf620c..fd7f8ce94 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -253,7 +253,11 @@ class SingleEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - texts=""; + try { + texts= JSON.stringify(value) + }catch (e) { + texts=""; + } } else { if(_text.length>=301){ var result = _text.substring(0,300); @@ -291,9 +295,15 @@ class SingleEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl:"" - }) + try { + this.setState({ + question_titleysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; @@ -322,9 +332,15 @@ class SingleEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl:"" - }) + try { + this.setState({ + question_titlesysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } } else { var texts=""; if(_text.length>=1001){ diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 98edd9915..7f164535b 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -705,6 +705,9 @@ font-size: 14px; } +.testfondexsysl{ + width:5% !important; +} .yldxtits{ color: #888888; font-size: 14px; @@ -712,7 +715,9 @@ .mt25{ margin-top: 25px; } - +.wt930px{ + width: 930px !important; +} .postitonrelati{ position: relative; } @@ -1072,3 +1077,18 @@ .lh34{ line-height: 34px !important; } +.titesstwos{ + position: relative; +} +.titesstwostest{ + position: absolute; +} +.text-indents40{ + text-indent:40px +} +.text-indents44{ + text-indent:44px +} +.text-indents50{ + text-indent: 50px +} diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index 86a267b83..4d9ad75a9 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -18,6 +18,7 @@ import SiderBar from "../tpm/SiderBar"; import Headplugselections from "../question/component/Headplugselections"; import QuestionModal from "./component/QuestionModal"; import QuestionModals from "./component/QuestionModals"; +import QuestionModalys from "./component/QuestionModalys"; class Testpaperlibrary extends Component { constructor(props) { super(props); @@ -40,6 +41,7 @@ class Testpaperlibrary extends Component { modalsTypes:false, modalsType:false, timuid:0, + modalsTypeInaudit:false, } } getContainer = () => { @@ -138,11 +140,16 @@ class Testpaperlibrary extends Component { } //获取数据 - getdata=(data)=>{ + getdata=(data,bool)=>{ const url = `/examination_banks.json`; - this.setState({ - booljupyterurls:true, - }) + if(bool){ + + }else { + this.setState({ + booljupyterurls:true, + }) + } + axios.get((url), {params: data}).then((response) => { setTimeout(()=>{ this.setState({ @@ -288,7 +295,7 @@ class Testpaperlibrary extends Component { page: this.state.page, per_page:10, }; - this.getdata(data); + this.getdata(data,true); } }).catch((error) => { ////console.log(error); @@ -314,7 +321,7 @@ class Testpaperlibrary extends Component { page: this.state.page, per_page:10, }; - this.getdata(data); + this.getdata(data,true); } }) .catch(function (error) { @@ -325,8 +332,8 @@ class Testpaperlibrary extends Component { showmodels = (id) => { this.setState({ modalsType: true, - titilesm: "在平台审核后,所有成员均可使用试题", - titiless: "是否设置为公开?", + titilesm: "在平台审核后,所有成员均可使用试卷", + titiless: "是否设置为公开", titbool: true, timuid: id }) @@ -337,7 +344,19 @@ class Testpaperlibrary extends Component { } + showmodelsInaudit = (e) => { + this.setState({ + modalsTypeInaudit: true, + titilesm: "公开申请已提交,请等待管理员的审核", + titiless: "我们将在1-2个工作日内完成审核", + }) + }; + modalsTypeInauditbool=()=>{ + this.setState({ + modalsTypeInaudit:false, + }) + } showmodelysl = (id) => { this.setState({ @@ -403,7 +422,7 @@ class Testpaperlibrary extends Component { render() { - let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state; + let{Headertop,items_count,page,per_page,modalsTypes,modalsType,modalsTypeInaudit}=this.state; const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; @@ -424,6 +443,12 @@ class Testpaperlibrary extends Component { setDownload={() => this.setDownload()}> :"" } + { + modalsTypeInaudit===true? + this.modalsTypeInauditbool()} + setDownload={() => this.modalsTypeInauditbool()}> + :"" + } {/*试卷库*/} this.callback(key)} setdatafunsval={(key)=>this.setdatafunsval(key)} setdifficulty={(bool)=>this.setdifficulty(bool)} + showmodelsInaudit={(e)=>this.showmodelsInaudit(e)} + > diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index 7df1997cd..e0151a2ff 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -222,6 +222,7 @@ class Contentpart extends Component { showmodels={(e)=>this.props.showmodels(e)} showmodelysl={(e)=>this.props.showmodelysl(e)} Isitapopup={this.props.Isitapopup} + showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} > diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js index db08b97f3..1ae0d3e70 100644 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ b/public/react/src/modules/testpaper/component/Listjihe.js @@ -133,12 +133,21 @@ class Listjihe extends Component { } { - items.public === false ? + items.apply===false?

    this.props.showmodels(items.id)}> 公开

    - :"" + : + ( + items.public==true? + "" + : +

    this.props.showmodelsInaudit(e)}> + + 公开审核中 +

    + ) }
    :""} diff --git a/public/react/src/modules/testpaper/component/QuestionModalys.js b/public/react/src/modules/testpaper/component/QuestionModalys.js new file mode 100644 index 000000000..7bd704884 --- /dev/null +++ b/public/react/src/modules/testpaper/component/QuestionModalys.js @@ -0,0 +1,42 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Modal} from 'antd'; +import axios from 'axios'; +import './../../question/questioncss/questioncom.css' +//立即申请试用 +class QuestionModalys extends Component { + + constructor(props) { + super(props); + this.state={ + + } + } + + + render() { + + return( + +
    +

    {this.props.titilesm}

    +

    {this.props.titiless}

    + +
    +
    + ) + } +} + +export default QuestionModalys; From fe9b028827b5673e9cfcf0048cd6048010e0ac9f 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, 10 Feb 2020 16:26:52 +0800 Subject: [PATCH 3/3] =?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/component/Listjihe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 24118ef26..447fd669b 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -354,7 +354,7 @@ class Listjihe extends Component { this.props.Isitapopup&&this.props.Isitapopup==="true"? "" : - +

    编辑