|
@@ -174,7 +174,7 @@
|
|
|
import { getDetail, add, follow, getActiveList, getActiveDetail } from "@/api/activityOrder";
|
|
|
export default {
|
|
|
components: {ImageUpload},
|
|
|
- props: ['id','title','formType'],
|
|
|
+ props: ['id','title','formType','activeId'],
|
|
|
data() {
|
|
|
return {
|
|
|
dataList: [],
|
|
@@ -223,6 +223,10 @@
|
|
|
if(this.id){
|
|
|
this.getDetail()
|
|
|
}
|
|
|
+ if(this.activeId){
|
|
|
+ this.formData.active = {id: this.activeId}
|
|
|
+ this.getActiveDetail(this.activeId)
|
|
|
+ }
|
|
|
this.getActiveList()
|
|
|
},
|
|
|
methods: {
|
|
@@ -316,20 +320,20 @@
|
|
|
let activeItems = JSON.parse(JSON.stringify(this.activeItems));
|
|
|
for(let index = 0; index < activeItems.length; index++) {
|
|
|
// 单选题多选题
|
|
|
- if ((activeItems[index].type == 1 || activeItems[index].type == 2) && activeItems[index].answer.some(o => o.active)) {
|
|
|
+ if ((activeItems[index].type == 1 || activeItems[index].type == 2)) {
|
|
|
activeItems[index].answer = activeItems[index].answer.filter(o => o.active);
|
|
|
activeItems[index].answer = JSON.stringify(activeItems[index].answer);
|
|
|
items.push(activeItems[index]);
|
|
|
}
|
|
|
// 填写题
|
|
|
- if (activeItems[index].type == 3 && activeItems[index].inputValue) {
|
|
|
+ if (activeItems[index].type == 3) {
|
|
|
activeItems[index].answer[0].option_value = activeItems[index].inputValue;
|
|
|
activeItems[index].answer = JSON.stringify(activeItems[index].answer);
|
|
|
items.push(activeItems[index]);
|
|
|
}
|
|
|
// 图片视频
|
|
|
- if (activeItems[index].type == 4 && activeItems[index].inputValue.length > 0) {
|
|
|
- activeItems[index].answer[0].option_value = activeItems[index].inputValue[0].url;
|
|
|
+ if (activeItems[index].type == 4) {
|
|
|
+ activeItems[index].answer[0].option_value = activeItems[index].inputValue.length>0?activeItems[index].inputValue[0].url:'';
|
|
|
activeItems[index].answer = JSON.stringify(activeItems[index].answer);
|
|
|
items.push(activeItems[index]);
|
|
|
}
|