dev_forum
杨树林 5 years ago
parent b78378bba3
commit 0ad641843d

@ -844,12 +844,12 @@ class PollNew extends Component {
if (object.question.question_type === 2) { if (object.question.question_type === 2) {
if (object.question.max_choices > 0) { if (object.question.max_choices > 0) {
if (object.question.min_choices < 2) { // if (object.question.min_choices < 2) {
this.props.showNotification(`可选最小不能少于2个`); // this.props.showNotification(`可选最小不能少于2个`);
//
return; // return;
//
} // }
} }
} }
@ -1332,10 +1332,10 @@ class PollNew extends Component {
if (object.question.question_type === 2) { if (object.question.question_type === 2) {
if (object.question.max_choices > 0) { if (object.question.max_choices > 0) {
if (object.question.min_choices < 2) { // if (object.question.min_choices < 2) {
this.props.showNotification(`可选最小不能少于2个`); // this.props.showNotification(`可选最小不能少于2个`);
return; // return;
} // }
} }
} }
if (object.question.new === "new") { 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; let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (index === i) { if (index === i) {
arr[i].question.min_choices= minchoices===null?0:minchoices===undefined?0:parseInt(minchoices);
arr[i].question.max_choices = parseInt(value); arr[i].question.max_choices = parseInt(value);
} }
} }
// console.log(2119);
// console.log(arr);
this.setState({ this.setState({
adddom: arr adddom: arr
}) })
@ -2772,7 +2775,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => 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} 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}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
@ -3015,7 +3018,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => 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} 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}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
@ -3267,7 +3270,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => 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} 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}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>

Loading…
Cancel
Save