|
@@ -197,7 +197,7 @@ export default {
|
|
if (checked) {
|
|
if (checked) {
|
|
questions.push(item.questionId);
|
|
questions.push(item.questionId);
|
|
console.log("AAAAAAAAA", questions);
|
|
console.log("AAAAAAAAA", questions);
|
|
- this.addQuestion(item, true);
|
|
|
|
|
|
+ this.addQuestion(item);
|
|
} else {
|
|
} else {
|
|
questions.splice(
|
|
questions.splice(
|
|
questions.findIndex(itemTemp => itemTemp === item.questionId),
|
|
questions.findIndex(itemTemp => itemTemp === item.questionId),
|
|
@@ -219,10 +219,18 @@ export default {
|
|
console.log("RRRRRRRRRR", selecteQuestionList);
|
|
console.log("RRRRRRRRRR", selecteQuestionList);
|
|
this.$store.dispatch("addQuestion", selecteQuestionList);
|
|
this.$store.dispatch("addQuestion", selecteQuestionList);
|
|
},
|
|
},
|
|
- addQuestion(item, isFirst) {
|
|
|
|
|
|
+ addQuestion(item) {
|
|
|
|
+ let questions = this.selectQuestions[this.currentPage - 1] || [];
|
|
|
|
+ var top = 170;
|
|
|
|
+ if (questions.length > 1) {
|
|
|
|
+ var question = this.questionList.filter(
|
|
|
|
+ item => item.questionId == questions[0]
|
|
|
|
+ );
|
|
|
|
+ top = question[0].optionList.length * 90 + 300;
|
|
|
|
+ }
|
|
// 添加题目
|
|
// 添加题目
|
|
let param = {};
|
|
let param = {};
|
|
- param.top = 170;
|
|
|
|
|
|
+ param.top = top;
|
|
param.left = 100;
|
|
param.left = 100;
|
|
param.questionId = item.questionId;
|
|
param.questionId = item.questionId;
|
|
param["type"] = "text";
|
|
param["type"] = "text";
|
|
@@ -238,7 +246,7 @@ export default {
|
|
param["nodeId"] = "Id" + Math.random();
|
|
param["nodeId"] = "Id" + Math.random();
|
|
this.$store.dispatch("addElement", param);
|
|
this.$store.dispatch("addElement", param);
|
|
// 添加选项
|
|
// 添加选项
|
|
- var itemTop = 250;
|
|
|
|
|
|
+ var itemTop = top + 50;
|
|
for (var i = 0; i < item.optionList.length; i++) {
|
|
for (var i = 0; i < item.optionList.length; i++) {
|
|
console.log("选项", item.optionList[i].content);
|
|
console.log("选项", item.optionList[i].content);
|
|
let obj = {};
|
|
let obj = {};
|