|
@@ -219,7 +219,14 @@ export default {
|
|
var questionList = res.single.questionList;
|
|
var questionList = res.single.questionList;
|
|
var children = []
|
|
var children = []
|
|
for (var i = 0; i < questionList.length; i++) {
|
|
for (var i = 0; i < questionList.length; i++) {
|
|
- children.push({ value: questionList[i].questionId, label: questionList[i].content, disabled: false })
|
|
|
|
|
|
+ var question = questionList[i];
|
|
|
|
+ var disabled = false;
|
|
|
|
+ const found = this.value.find(element => element[1] == question.questionId);
|
|
|
|
+ console.log("XXXXXXXXXfound", found);
|
|
|
|
+ if (found) {
|
|
|
|
+ disabled = true
|
|
|
|
+ }
|
|
|
|
+ children.push({ value: question.questionId, label: question.content, disabled: disabled })
|
|
}
|
|
}
|
|
var element = { value: item._id, label: item.title, children: children, id: item._id };
|
|
var element = { value: item._id, label: item.title, children: children, id: item._id };
|
|
this.options.push(element);
|
|
this.options.push(element);
|
|
@@ -239,7 +246,20 @@ export default {
|
|
var questionList = res.single.questionList;
|
|
var questionList = res.single.questionList;
|
|
var children = []
|
|
var children = []
|
|
for (var i = 0; i < questionList.length; i++) {
|
|
for (var i = 0; i < questionList.length; i++) {
|
|
- children.push({ value: questionList[i].questionId, label: questionList[i].content, disabled: false })
|
|
|
|
|
|
+ var question = questionList[i];
|
|
|
|
+ var disabled = false;
|
|
|
|
+
|
|
|
|
+ const foundX = this.optionsXValue.find(element => element[1] == question.questionId);
|
|
|
|
+ console.log("XXXXXXXXXfound", foundX);
|
|
|
|
+ if (foundX) {
|
|
|
|
+ disabled = true
|
|
|
|
+ }
|
|
|
|
+ const foundY = this.optionsYValue.find(element => element[1] == question.questionId);
|
|
|
|
+ console.log("XXXXXXXXXfound", foundY);
|
|
|
|
+ if (foundY) {
|
|
|
|
+ disabled = true
|
|
|
|
+ }
|
|
|
|
+ children.push({ value: question.questionId, label: question.content, disabled: disabled })
|
|
}
|
|
}
|
|
var element = { value: item._id, label: item.title, children: children, id: item._id };
|
|
var element = { value: item._id, label: item.title, children: children, id: item._id };
|
|
this.optionsX.push(element);
|
|
this.optionsX.push(element);
|
|
@@ -258,7 +278,20 @@ export default {
|
|
var questionList = res.single.questionList;
|
|
var questionList = res.single.questionList;
|
|
var children = []
|
|
var children = []
|
|
for (var i = 0; i < questionList.length; i++) {
|
|
for (var i = 0; i < questionList.length; i++) {
|
|
- children.push({ value: questionList[i].questionId, label: questionList[i].content, disabled: false })
|
|
|
|
|
|
+ var question = questionList[i];
|
|
|
|
+ var disabled = false;
|
|
|
|
+
|
|
|
|
+ const foundX = this.optionsXValue.find(element => element[1] == question.questionId);
|
|
|
|
+ console.log("XXXXXXXXXfound", foundX);
|
|
|
|
+ if (foundX) {
|
|
|
|
+ disabled = true
|
|
|
|
+ }
|
|
|
|
+ const foundY = this.optionsYValue.find(element => element[1] == question.questionId);
|
|
|
|
+ console.log("XXXXXXXXXfound", foundY);
|
|
|
|
+ if (foundY) {
|
|
|
|
+ disabled = true
|
|
|
|
+ }
|
|
|
|
+ children.push({ value: question.questionId, label: question.content, disabled: disabled })
|
|
}
|
|
}
|
|
var element = { value: item._id, label: item.title, children: children, id: item._id };
|
|
var element = { value: item._id, label: item.title, children: children, id: item._id };
|
|
this.optionsY.push(element);
|
|
this.optionsY.push(element);
|
|
@@ -295,10 +328,8 @@ export default {
|
|
if (this.optionsXOldValue.length >= index + 1) {
|
|
if (this.optionsXOldValue.length >= index + 1) {
|
|
console.log("XXXXXXXXXXXXX");
|
|
console.log("XXXXXXXXXXXXX");
|
|
this.setOptionsDisabledXY(this.optionsXOldValue[index], false, 0);
|
|
this.setOptionsDisabledXY(this.optionsXOldValue[index], false, 0);
|
|
-
|
|
|
|
this.setOptionsDisabledXY(this.optionsYOldValue[index], false, 1);
|
|
this.setOptionsDisabledXY(this.optionsYOldValue[index], false, 1);
|
|
}
|
|
}
|
|
- // this.questionListSel[index] = this.questionList[i];
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -307,8 +338,6 @@ export default {
|
|
|
|
|
|
this.optionsXValue[index] = value;
|
|
this.optionsXValue[index] = value;
|
|
this.optionsXOldValue[index] = value;
|
|
this.optionsXOldValue[index] = value;
|
|
- // this.checkList.splice(index, 1, []);
|
|
|
|
- // this.questionChilds.splice(index, 1, []);
|
|
|
|
},
|
|
},
|
|
handleChangeY(value, index) {
|
|
handleChangeY(value, index) {
|
|
console.log("handleChangeX", value, index, this.optionsYOldValue);
|
|
console.log("handleChangeX", value, index, this.optionsYOldValue);
|
|
@@ -320,7 +349,6 @@ export default {
|
|
this.setOptionsDisabledXY(this.optionsYOldValue[index], false, 1);
|
|
this.setOptionsDisabledXY(this.optionsYOldValue[index], false, 1);
|
|
this.setOptionsDisabledXY(this.optionsYOldValue[index], false, 0);
|
|
this.setOptionsDisabledXY(this.optionsYOldValue[index], false, 0);
|
|
}
|
|
}
|
|
- // this.questionListSel[index] = this.questionList[i];
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -329,8 +357,6 @@ export default {
|
|
|
|
|
|
this.optionsYValue[index] = value;
|
|
this.optionsYValue[index] = value;
|
|
this.optionsYOldValue[index] = value;
|
|
this.optionsYOldValue[index] = value;
|
|
- // this.checkList.splice(index, 1, []);
|
|
|
|
- // this.questionChilds.splice(index, 1, []);
|
|
|
|
},
|
|
},
|
|
addfilterX() {
|
|
addfilterX() {
|
|
this.filterXList.push('');
|
|
this.filterXList.push('');
|
|
@@ -653,7 +679,7 @@ export default {
|
|
for (var q = 0; q < qqq.length; q++) {
|
|
for (var q = 0; q < qqq.length; q++) {
|
|
sss.push({ name: rowArr[q], title: qqq[q].name, value: qqq[q].value })
|
|
sss.push({ name: rowArr[q], title: qqq[q].name, value: qqq[q].value })
|
|
}
|
|
}
|
|
- this.crossAnalyse.push({ table: sss, data: [], question: null });
|
|
|
|
|
|
+ this.crossAnalyse.push({ table: sss, data: [], question: null, name: null });
|
|
}
|
|
}
|
|
console.log("SSSSS", this.crossAnalyse);
|
|
console.log("SSSSS", this.crossAnalyse);
|
|
|
|
|
|
@@ -670,8 +696,20 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
this.crossAnalyse[x].data = data;
|
|
this.crossAnalyse[x].data = data;
|
|
this.crossAnalyse[x].question = data;
|
|
this.crossAnalyse[x].question = data;
|
|
|
|
+
|
|
|
|
+ const found = this.optionsY.find(element => element.id == this.optionsYValue[x][0]);
|
|
|
|
+ console.log("XXXXXXXXXfound", found);
|
|
|
|
+ if (found) {
|
|
|
|
+ const children = found.children.find(element => element.value == this.optionsYValue[x][1]);
|
|
|
|
+ console.log("XXXXXXXXXchildren", children);
|
|
|
|
+ if (children) {
|
|
|
|
+ this.crossAnalyse[x].name = children.label
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
console.log("data", this.crossAnalyse);
|
|
console.log("data", this.crossAnalyse);
|
|
|
|
|