|
|
|
@ -2123,6 +2123,12 @@ class PollNew extends Component {
|
|
|
|
|
|
|
|
|
|
//最小值
|
|
|
|
|
HandleGradationGroupChangee = (value, index, max, length) => {
|
|
|
|
|
console.log("最小值");
|
|
|
|
|
console.log(value);
|
|
|
|
|
console.log(index);
|
|
|
|
|
console.log(max);
|
|
|
|
|
console.log(length);
|
|
|
|
|
|
|
|
|
|
// debugger
|
|
|
|
|
var minbool = false;
|
|
|
|
|
var maxbool = false;
|
|
|
|
@ -2137,7 +2143,7 @@ class PollNew extends Component {
|
|
|
|
|
if (minbool === true && maxbool === true) {
|
|
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
|
|
if (index === i) {
|
|
|
|
|
arr[i].question.min_choices = parseInt(value);
|
|
|
|
|
arr[i].question.min_choices = parseInt(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
@ -2146,18 +2152,8 @@ class PollNew extends Component {
|
|
|
|
|
} else {
|
|
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
|
|
if (index === i) {
|
|
|
|
|
try {
|
|
|
|
|
if(parseInt(value)===0){
|
|
|
|
|
arr[i].question.min_choices = 2;
|
|
|
|
|
arr[i].question.max_choices = length;
|
|
|
|
|
}else{
|
|
|
|
|
arr[i].question.min_choices = parseInt(value);
|
|
|
|
|
arr[i].question.max_choices = max;
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
arr[i].question.min_choices = 2;
|
|
|
|
|
arr[i].question.max_choices = length;
|
|
|
|
|
}
|
|
|
|
|
arr[i].question.max_choices = length;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2169,19 +2165,32 @@ class PollNew extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//最大值
|
|
|
|
|
HandleGradationGroupChangeee = (value, index,minchoices) => {
|
|
|
|
|
HandleGradationGroupChangeee = (value, index,minchoices,length) => {
|
|
|
|
|
// console.log("2112");
|
|
|
|
|
// console.log(value);
|
|
|
|
|
// console.log(minchoices);
|
|
|
|
|
console.log("最大值");
|
|
|
|
|
console.log(value);
|
|
|
|
|
console.log(index);
|
|
|
|
|
console.log(minchoices);
|
|
|
|
|
console.log(length);
|
|
|
|
|
let arr = this.state.adddom;
|
|
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
|
|
if (index === i) {
|
|
|
|
|
if(parseInt(value)===0&&parseInt(minchoices)===0){
|
|
|
|
|
arr[i].question.min_choices= parseInt(0);
|
|
|
|
|
arr[i].question.max_choices = parseInt(0);
|
|
|
|
|
}else if(parseInt(minchoices)===0){
|
|
|
|
|
arr[i].question.min_choices= parseInt(2);
|
|
|
|
|
arr[i].question.max_choices = parseInt(value);
|
|
|
|
|
}
|
|
|
|
|
else if(parseInt(value)===0&&parseInt(minchoices)>0){
|
|
|
|
|
arr[i].question.min_choices= parseInt(minchoices);
|
|
|
|
|
arr[i].question.max_choices = parseInt(value);
|
|
|
|
|
}else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
|
|
|
|
|
arr[i].question.max_choices = parseInt(value);
|
|
|
|
|
arr[i].question.max_choices = parseInt(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2874,7 +2883,7 @@ class PollNew extends Component {
|
|
|
|
|
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices}
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
<Option value={String("0")}>--</Option>
|
|
|
|
|
<Option value={"0"}>--</Option>
|
|
|
|
|
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
|
|
|
|
|
return (
|
|
|
|
|
indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : ""
|
|
|
|
@ -2885,10 +2894,10 @@ class PollNew extends Component {
|
|
|
|
|
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
|
|
|
|
|
{/*可选最大*/}
|
|
|
|
|
<Select className="fl w100"
|
|
|
|
|
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
|
|
|
|
|
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
|
|
|
|
|
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={"0"}>--</Option>
|
|
|
|
|
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
|
|
|
|
|
return (
|
|
|
|
|
indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : ""
|
|
|
|
@ -3128,7 +3137,7 @@ class PollNew extends Component {
|
|
|
|
|
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
|
|
|
|
|
{/*可选最大*/}
|
|
|
|
|
<Select className="fl w100"
|
|
|
|
|
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
|
|
|
|
|
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
|
|
|
|
|
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>
|
|
|
|
@ -3380,7 +3389,7 @@ class PollNew extends Component {
|
|
|
|
|
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
|
|
|
|
|
{/*可选最大*/}
|
|
|
|
|
<Select className="fl w100"
|
|
|
|
|
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
|
|
|
|
|
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
|
|
|
|
|
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>
|
|
|
|
|