dev_aliyun_beta
杨树林 6 years ago
parent 622623eaae
commit 04cd8f4eab

@ -2141,8 +2141,14 @@ class PollNewQuestbank extends Component {
}) })
} }
//最小值 //最小值
HandleGradationGroupChangee = (value, index, max, length) => { HandleGradationGroupChangee = (value, index, max, length) => {
// console.log("最小值");
// console.log(value);
// console.log(index);
// console.log(max);
// console.log(length);
// debugger // debugger
var minbool = false; var minbool = false;
var maxbool = false; var maxbool = false;
@ -2166,18 +2172,8 @@ class PollNewQuestbank extends Component {
} else { } else {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (index === i) { if (index === i) {
try { arr[i].question.min_choices = parseInt(value);
if(parseInt(value)===0){ arr[i].question.max_choices = length;
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 = length;
}
}catch (e) {
arr[i].question.min_choices = 2;
arr[i].question.max_choices = length;
}
break; break;
} }
} }
@ -2189,19 +2185,32 @@ class PollNewQuestbank extends Component {
} }
//最大值 //最大值
HandleGradationGroupChangeee = (value, index,minchoices) => { HandleGradationGroupChangeee = (value, index,minchoices,length) => {
// console.log("2112"); // console.log("2112");
// console.log(value); // console.log(value);
// console.log(minchoices); // console.log(minchoices);
// console.log("最大值");
// console.log(value);
// console.log(index);
// console.log(minchoices);
// console.log(length);
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) {
if(parseInt(value)===0&&parseInt(minchoices)===0){ 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.min_choices= parseInt(minchoices);
arr[i].question.max_choices = parseInt(value); 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.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);
} }
} }
} }

Loading…
Cancel
Save