|
|
@ -24,22 +24,6 @@
|
|
|
|
<a-input v-model="form.title" style="margin: 20px;width: 980px" placeholder="问卷标题(限40字)"></a-input>
|
|
|
|
<a-input v-model="form.title" style="margin: 20px;width: 980px" placeholder="问卷标题(限40字)"></a-input>
|
|
|
|
<a-textarea v-model="form.description" style="margin: 0px 20px 20px 20px;width: 980px;height:88px" placeholder="问卷说明"></a-textarea>
|
|
|
|
<a-textarea v-model="form.description" style="margin: 0px 20px 20px 20px;width: 980px;height:88px" placeholder="问卷说明"></a-textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="question-area-top" style="margin-top: 20px" v-for="(item,index) in form.questionnaireInsertTopicDTOList" :key="index">
|
|
|
|
|
|
|
|
<div class="question-list">
|
|
|
|
|
|
|
|
<span style="font-weight: 600">{{index+1}}.{{item.topic}}</span>
|
|
|
|
|
|
|
|
<a-tag>{{item.type==1?'单选题':item.type==2?'多选题':item.type==3?'下拉单选':item.type==4?'判断题':'开放题'}}</a-tag>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="margin-left: 40px" v-if="item.type==1||item.type==3">
|
|
|
|
|
|
|
|
<a-radio disabled v-for="(it,id) in item.questionnaireInsertTopicChoiceDTOList" :key="id">{{it.answer}}</a-radio>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="margin-left: 40px" v-if="item.type==2">
|
|
|
|
|
|
|
|
<a-checkbox disabled v-for="(it,id) in item.questionnaireInsertTopicChoiceDTOList" :key="id">{{it.answer}}</a-checkbox>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="padding: 20px">
|
|
|
|
|
|
|
|
<a-button type="primary" style="margin-left: 20px" @click="editQuestionItem(item,index)">编辑</a-button>
|
|
|
|
|
|
|
|
<a-button style="margin-left: 20px" @click="deleteQuestionItem(item,index)">删除</a-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="question-item">
|
|
|
|
<div class="question-item">
|
|
|
|
<div style="padding: 20px;display: flex">
|
|
|
|
<div style="padding: 20px;display: flex">
|
|
|
|
<div style="width: 80%" v-if="questionCard.type == 1 || questionCard.type == 2 || questionCard.type == 3">
|
|
|
|
<div style="width: 80%" v-if="questionCard.type == 1 || questionCard.type == 2 || questionCard.type == 3">
|
|
|
@ -87,9 +71,25 @@
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model>
|
|
|
|
</a-form-model>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="question-area-top" style="margin-top: 20px" v-for="(item,index) in form.questionnaireUpdateTopicDTOList" :key="index">
|
|
|
|
|
|
|
|
<div class="question-list">
|
|
|
|
|
|
|
|
<span style="font-weight: 600">{{index+1}}.{{item.topic}}</span>
|
|
|
|
|
|
|
|
<a-tag>{{item.type==1?'单选题':item.type==2?'多选题':item.type==3?'下拉单选':item.type==4?'判断题':'开放题'}}</a-tag>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="margin-left: 40px" v-if="item.type==1||item.type==3">
|
|
|
|
|
|
|
|
<a-radio disabled v-for="(it,id) in item.questionnaireUpdateTopicChoiceDTOList" :key="id">{{it.answer}}</a-radio>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="margin-left: 40px" v-if="item.type==2">
|
|
|
|
|
|
|
|
<a-checkbox disabled v-for="(it,id) in item.questionnaireUpdateTopicChoiceDTOList" :key="id">{{it.answer}}</a-checkbox>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="padding: 20px">
|
|
|
|
|
|
|
|
<a-button type="primary" style="margin-left: 20px" @click="editQuestionItem(item,index)">编辑</a-button>
|
|
|
|
|
|
|
|
<a-button style="margin-left: 20px" @click="deleteQuestionItem(item,index)">删除</a-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="question-setting">
|
|
|
|
<div class="question-setting">
|
|
|
|
<div style="padding: 20px">
|
|
|
|
<div style="padding: 20px">
|
|
|
@ -141,7 +141,7 @@ export default {
|
|
|
|
answerType: undefined,
|
|
|
|
answerType: undefined,
|
|
|
|
beginDate: '',
|
|
|
|
beginDate: '',
|
|
|
|
endDate: '',
|
|
|
|
endDate: '',
|
|
|
|
questionnaireInsertTopicDTOList: [],
|
|
|
|
questionnaireUpdateTopicDTOList: [],
|
|
|
|
isRelease: 0,
|
|
|
|
isRelease: 0,
|
|
|
|
imgUrls: [],
|
|
|
|
imgUrls: [],
|
|
|
|
deleteTopicIds: [],
|
|
|
|
deleteTopicIds: [],
|
|
|
@ -173,7 +173,7 @@ export default {
|
|
|
|
this.form.endDate = data.endDate;
|
|
|
|
this.form.endDate = data.endDate;
|
|
|
|
this.form.isRelease = data.isRelease;
|
|
|
|
this.form.isRelease = data.isRelease;
|
|
|
|
this.form.imgUrls = [];
|
|
|
|
this.form.imgUrls = [];
|
|
|
|
// this.form.questionnaireInsertTopicDTOList = data.questionnaireFBITopicVoList;
|
|
|
|
// this.form.questionnaireUpdateTopicDTOList = data.questionnaireFBITopicVoList;
|
|
|
|
if (res.data.imgList.length > 0) {
|
|
|
|
if (res.data.imgList.length > 0) {
|
|
|
|
const pic = [];
|
|
|
|
const pic = [];
|
|
|
|
this.form.imgUrls.push(res.data.imgList[0].url);
|
|
|
|
this.form.imgUrls.push(res.data.imgList[0].url);
|
|
|
@ -199,11 +199,11 @@ export default {
|
|
|
|
type: ele.type,
|
|
|
|
type: ele.type,
|
|
|
|
topic: ele.topic,
|
|
|
|
topic: ele.topic,
|
|
|
|
deleteTopicChoiceIds: [],
|
|
|
|
deleteTopicChoiceIds: [],
|
|
|
|
questionnaireInsertTopicChoiceDTOList: ele.questionnaireFBITopicChoiceVoList
|
|
|
|
questionnaireUpdateTopicChoiceDTOList: ele.questionnaireFBITopicChoiceVoList
|
|
|
|
};
|
|
|
|
};
|
|
|
|
arr.push(obj)
|
|
|
|
arr.push(obj)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.form.questionnaireInsertTopicDTOList = arr
|
|
|
|
this.form.questionnaireUpdateTopicDTOList = arr
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -216,7 +216,7 @@ export default {
|
|
|
|
type: type,
|
|
|
|
type: type,
|
|
|
|
topic: '',
|
|
|
|
topic: '',
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
questionnaireInsertTopicChoiceDTOList: [],
|
|
|
|
questionnaireUpdateTopicChoiceDTOList: [],
|
|
|
|
deleteTopicChoiceIds:[]
|
|
|
|
deleteTopicChoiceIds:[]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.questionCard = obj
|
|
|
|
this.questionCard = obj
|
|
|
@ -232,19 +232,19 @@ export default {
|
|
|
|
type: this.questionCard.type,
|
|
|
|
type: this.questionCard.type,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
questionnaireInsertTopicChoiceDTOList: this.questionChoice,
|
|
|
|
questionnaireUpdateTopicChoiceDTOList: this.questionChoice,
|
|
|
|
deleteTopicChoiceIds: [],
|
|
|
|
deleteTopicChoiceIds: [],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.form.questionnaireInsertTopicDTOList.push(obj)
|
|
|
|
this.form.questionnaireUpdateTopicDTOList.push(obj)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let obj = {
|
|
|
|
let obj = {
|
|
|
|
type: this.questionCard.type,
|
|
|
|
type: this.questionCard.type,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
questionnaireInsertTopicChoiceDTOList: [],
|
|
|
|
questionnaireUpdateTopicChoiceDTOList: [],
|
|
|
|
deleteTopicChoiceIds: []
|
|
|
|
deleteTopicChoiceIds: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.form.questionnaireInsertTopicDTOList.push(obj)
|
|
|
|
this.form.questionnaireUpdateTopicDTOList.push(obj)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (this.isEdit == true) {
|
|
|
|
} else if (this.isEdit == true) {
|
|
|
|
if(type == 1 || type == 2 || type == 3) {
|
|
|
|
if(type == 1 || type == 2 || type == 3) {
|
|
|
@ -255,19 +255,19 @@ export default {
|
|
|
|
type: this.questionCard.type,
|
|
|
|
type: this.questionCard.type,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
id: this.questionCard.id,
|
|
|
|
id: this.questionCard.id,
|
|
|
|
questionnaireInsertTopicChoiceDTOList: this.questionChoice,
|
|
|
|
questionnaireUpdateTopicChoiceDTOList: this.questionChoice,
|
|
|
|
deleteTopicChoiceIds: deleteId
|
|
|
|
deleteTopicChoiceIds: deleteId
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.form.questionnaireInsertTopicDTOList[this.activeIndex] = obj
|
|
|
|
this.form.questionnaireUpdateTopicDTOList[this.activeIndex] = obj
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let obj = {
|
|
|
|
let obj = {
|
|
|
|
type: this.questionCard.type,
|
|
|
|
type: this.questionCard.type,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
topic: this.questionCard.topic,
|
|
|
|
id: this.questionCard.id,
|
|
|
|
id: this.questionCard.id,
|
|
|
|
questionnaireInsertTopicChoiceDTOList: [],
|
|
|
|
questionnaireUpdateTopicChoiceDTOList: [],
|
|
|
|
deleteTopicChoiceIds: []
|
|
|
|
deleteTopicChoiceIds: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.form.questionnaireInsertTopicDTOList[this.activeIndex] = obj
|
|
|
|
this.form.questionnaireUpdateTopicDTOList[this.activeIndex] = obj
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.questionCancel()
|
|
|
|
this.questionCancel()
|
|
|
@ -304,14 +304,14 @@ export default {
|
|
|
|
this.questionCard.type = item.type;
|
|
|
|
this.questionCard.type = item.type;
|
|
|
|
this.questionCard.topic = item.topic;
|
|
|
|
this.questionCard.topic = item.topic;
|
|
|
|
this.questionCard.id = item.id;
|
|
|
|
this.questionCard.id = item.id;
|
|
|
|
if(item.questionnaireInsertTopicChoiceDTOList) {
|
|
|
|
if(item.questionnaireUpdateTopicChoiceDTOList) {
|
|
|
|
this.questionChoice = item.questionnaireInsertTopicChoiceDTOList
|
|
|
|
this.questionChoice = item.questionnaireUpdateTopicChoiceDTOList
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//删除已经添加的问题
|
|
|
|
//删除已经添加的问题
|
|
|
|
deleteQuestionItem(item,index) {
|
|
|
|
deleteQuestionItem(item,index) {
|
|
|
|
this.form.deleteTopicIds.push(item.id)
|
|
|
|
this.form.deleteTopicIds.push(item.id)
|
|
|
|
this.form.questionnaireInsertTopicDTOList.splice(index,1)
|
|
|
|
this.form.questionnaireUpdateTopicDTOList.splice(index,1)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//保存
|
|
|
|
//保存
|
|
|
|
save() {
|
|
|
|
save() {
|
|
|
|