diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index 64595580b..ce6afc5fd 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -21,6 +21,7 @@ import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import Bottomsubmit from "../modals/Bottomsubmit"; import QuestionModalys from "./component/QuestionModalys"; +import Listjihe from "./component/Listjihe"; //exam_id 试卷的id var Undoclickable=true; @@ -264,12 +265,6 @@ class NewMyShixunModel extends Component { } this.callback(defaultActiveKeys); } - if(prevProps.Contentdata !== this.props.Contentdata){ - this.setState({ - Contentdata:this.props.Contentdata, - }) - - } } //公共和我的 @@ -721,33 +716,33 @@ class NewMyShixunModel extends Component { getbasket_listdata = () => { // 获取试题篮展开的数据 - // const url = "/item_baskets/basket_list.json"; - // axios.get(url) - // .then((result) => { - // // ////console.log("getbasket_listdata"); - // // ////console.log(result.data); - // this.setState({ - // completion_questions_count: result.data.completion_questions_count, - // judgement_questions_count: result.data.judgement_questions_count, - // multiple_questions_count: result.data.multiple_questions_count, - // practical_questions_count: result.data.practical_questions_count, - // program_questions_count: result.data.program_questions_count, - // single_questions_count: result.data.single_questions_count, - // subjective_questions_count: result.data.subjective_questions_count, - // }) - // - // }).catch((error) => { - // // ////console.log(error); - // this.setState({ - // completion_questions_count: 0, - // judgement_questions_count: 0, - // multiple_questions_count: 0, - // practical_questions_count: 0, - // program_questions_count: 0, - // single_questions_count: 0, - // subjective_questions_count: 0, - // }) - // }) + const url = "/item_baskets/basket_list.json"; + axios.get(url) + .then((result) => { + // ////console.log("getbasket_listdata"); + // ////console.log(result.data); + this.setState({ + completion_questions_count: result.data.completion_questions_count, + judgement_questions_count: result.data.judgement_questions_count, + multiple_questions_count: result.data.multiple_questions_count, + practical_questions_count: result.data.practical_questions_count, + program_questions_count: result.data.program_questions_count, + single_questions_count: result.data.single_questions_count, + subjective_questions_count: result.data.subjective_questions_count, + }) + + }).catch((error) => { + // ////console.log(error); + this.setState({ + completion_questions_count: 0, + judgement_questions_count: 0, + multiple_questions_count: 0, + practical_questions_count: 0, + program_questions_count: 0, + single_questions_count: 0, + subjective_questions_count: 0, + }) + }) } @@ -1029,8 +1024,10 @@ class NewMyShixunModel extends Component { + single_questions_count + subjective_questions_count; - // console.log("弹出框"); - // console.log(Contentdata) + console.log("弹出框"); + console.log(Datacount) + console.log(Contentdata) + return (
@@ -1103,6 +1100,8 @@ class NewMyShixunModel extends Component { Contentdata={Contentdata} exam_id={this.props.exam_id} Isitapopup={"true"} + Datacount={Datacount} + Datacountbool={true} chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexibool={(e)=>this.chakanjiexibool(e)} getitem_basketss={(id)=>this.getitem_basketss(id)} diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index d305574ac..772a75fb1 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -788,12 +788,37 @@ class Question extends Component { } //全选试题库 selectallquestionsonthispage=(bool)=>{ + if(bool===true){ + //bool 是选中状态 + let { + completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count, + program_questions_count, single_questions_count, subjective_questions_count, + } = this.state; + + const Datacount = completion_questions_count + judgement_questions_count + + multiple_questions_count + practical_questions_count + + program_questions_count + + single_questions_count + + subjective_questions_count; + + + if(Datacount===100){ + this.props.showNotification(`已选100个试题(不能在选用更多试题)`); + return; + } + + } + + + if(myGrandtotal===true){ this.props.showNotification(`本页全部试题未发布,不能选择`); return } + + var item_idsdata=[]; var arr= this.state.Contentdata.items; @@ -1083,6 +1108,8 @@ class Question extends Component { this.chakanjiexibool(e)} getitem_basketss={(id)=>this.getitem_basketss(id)} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index ca637b9b5..94233133a 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -466,6 +466,8 @@ class Contentpart extends Component { : this.props.Contentdata.items.map((object, index) => { return ( this.chakanjiexibool(keindex)} diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 8778c3f79..12ea6c2c3 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -97,6 +97,19 @@ class Listjihe extends Component { } //选用 Selectingpracticaltraining = (id) => { + try { + if(this.props.Datacountbool){ + if(this.props.Datacount===100){ + this.props.showNotification(`已选100个试题(不能在选用更多试题)`); + return; + } + } + }catch (e) { + + } + + + let data = {} if (this.props.exam_id === undefined) { data = {