From 0ad641843d5b0792c2fb7b47986e1418c8f810a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 27 Jul 2019 11:55:59 +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 --- .../react/src/modules/courses/poll/PollNew.js | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 705b1658c..82d06a991 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -844,12 +844,12 @@ class PollNew extends Component { if (object.question.question_type === 2) { if (object.question.max_choices > 0) { - if (object.question.min_choices < 2) { - this.props.showNotification(`可选最小不能少于2个`); - - return; - - } + // if (object.question.min_choices < 2) { + // this.props.showNotification(`可选最小不能少于2个`); + // + // return; + // + // } } } @@ -1332,10 +1332,10 @@ class PollNew extends Component { if (object.question.question_type === 2) { if (object.question.max_choices > 0) { - if (object.question.min_choices < 2) { - this.props.showNotification(`可选最小不能少于2个`); - return; - } + // if (object.question.min_choices < 2) { + // this.props.showNotification(`可选最小不能少于2个`); + // return; + // } } } if (object.question.new === "new") { @@ -2108,14 +2108,17 @@ class PollNew extends Component { } //最大值 - HandleGradationGroupChangeee = (value, index) => { - + HandleGradationGroupChangeee = (value, index,minchoices) => { + // console.log(value); let arr = this.state.adddom; for (var i = 0; i < arr.length; i++) { if (index === i) { + arr[i].question.min_choices= minchoices===null?0:minchoices===undefined?0:parseInt(minchoices); arr[i].question.max_choices = parseInt(value); } } + // console.log(2119); + // console.log(arr); this.setState({ adddom: arr }) @@ -2772,7 +2775,7 @@ class PollNew extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/} this.HandleGradationGroupChangeee(value, indexo)} + onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)} value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} > @@ -3267,7 +3270,7 @@ class PollNew extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/}