|
@@ -133,14 +133,18 @@ export default {
|
|
|
console.log("XXXxXXX", list);
|
|
|
this.dataList = list;
|
|
|
|
|
|
+ this.answerData = [];
|
|
|
this.options = []
|
|
|
this.questionList = []
|
|
|
+ var testThemesList = [];
|
|
|
for (var i = 0; i < this.dataList.length; i++) {
|
|
|
var element = this.dataList[i]
|
|
|
if (element.isSelected) {
|
|
|
this.getCNCTestDetail(element)
|
|
|
+ testThemesList.push(element);
|
|
|
}
|
|
|
}
|
|
|
+ this.getCNCTestDetails(testThemesList);
|
|
|
|
|
|
this.optionsX = []
|
|
|
for (var i = 0; i < this.dataList.length; i++) {
|
|
@@ -176,14 +180,41 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- async getCNCTestDetail(item) {
|
|
|
+ async getCNCTestDetails(testThemesList) {
|
|
|
this.currentDate = timeFormat.getNowFormatDate();
|
|
|
+ var testThemesIdList = [];
|
|
|
+ for (var i = 0; i < testThemesList.length; i++) {
|
|
|
+ var element = testThemesList[i]
|
|
|
+ testThemesIdList.push(element._id);
|
|
|
+ }
|
|
|
+ let data = {
|
|
|
+ testThemesIdList: testThemesIdList
|
|
|
+ }
|
|
|
+ api.answerData(data).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ console.log("success", res);
|
|
|
+ var answerData = res.single;
|
|
|
+ for (var i = 0; i < answerData.questionList.length; i++) {
|
|
|
+ var element = answerData.questionList[i]
|
|
|
+ if (element.belongTestOrder <= testThemesIdList.length) {
|
|
|
+ element.lable = testThemesList[element.belongTestOrder - 1].title;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log("answerData", answerData);
|
|
|
+ this.answerData = answerData;
|
|
|
+ // 查询数据包列表
|
|
|
+ this.getCondition();
|
|
|
+ } else {
|
|
|
+ console.log("error");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async getCNCTestDetail(item) {
|
|
|
let data = {
|
|
|
testThemesIdList: [item._id]
|
|
|
}
|
|
|
api.answerData(data).then((res) => {
|
|
|
if (res.success) {
|
|
|
- this.answerData = res.single;
|
|
|
console.log("success", res);
|
|
|
var questionList = res.single.questionList;
|
|
|
var children = []
|
|
@@ -193,8 +224,6 @@ export default {
|
|
|
var element = { value: item._id, label: item.title, children: children, id: item._id };
|
|
|
this.options.push(element);
|
|
|
this.questionList.push(questionList);
|
|
|
- // 查询数据包列表
|
|
|
- this.getCondition();
|
|
|
} else {
|
|
|
console.log("error");
|
|
|
}
|
|
@@ -206,7 +235,6 @@ export default {
|
|
|
}
|
|
|
api.answerData(data).then((res) => {
|
|
|
if (res.success) {
|
|
|
- this.answerData = res.single;
|
|
|
console.log("success", res);
|
|
|
var questionList = res.single.questionList;
|
|
|
var children = []
|
|
@@ -226,7 +254,6 @@ export default {
|
|
|
}
|
|
|
api.answerData(data).then((res) => {
|
|
|
if (res.success) {
|
|
|
- this.answerData = res.single;
|
|
|
console.log("success", res);
|
|
|
var questionList = res.single.questionList;
|
|
|
var children = []
|
|
@@ -482,8 +509,23 @@ export default {
|
|
|
}
|
|
|
api.answerData(data).then((res) => {
|
|
|
if (res.success) {
|
|
|
- this.answerData = res.single;
|
|
|
console.log("success", res);
|
|
|
+ var answerData = res.single;
|
|
|
+ for (var i = 0; i < answerData.questionList.length; i++) {
|
|
|
+ var element = answerData.questionList[i]
|
|
|
+ const found = conditionQuestionList.find(element => element.questionId == element.questionId);
|
|
|
+ console.log("found", found);
|
|
|
+ if (element.belongTestOrder <= this.options.length) {
|
|
|
+ element.lable = this.options[element.belongTestOrder - 1].label;
|
|
|
+ }
|
|
|
+ if (found.questionId == element.questionId) {
|
|
|
+ element.isFilter = true
|
|
|
+ } else {
|
|
|
+ element.isFilter = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log("answerData", answerData);
|
|
|
+ this.answerData = answerData;
|
|
|
} else {
|
|
|
console.log("error");
|
|
|
}
|