This commit is contained in:
xuyucheng 2021-12-31 10:22:53 +08:00
parent 3b7f0b3193
commit 00631ea361
2 changed files with 8 additions and 15 deletions

View File

@ -127,15 +127,6 @@ export default {
}); });
}, },
}, },
watch:{
data:{
handler(val){
console.log(val["经营问卷"])
},
deep:true
}
}
}; };
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>

View File

@ -121,17 +121,19 @@ export default {
const state = this.data["经营问卷"].every((item) => { const state = this.data["经营问卷"].every((item) => {
return item !== null ? true : false; return item !== null ? true : false;
}); });
var sum = 0;
res.result.forEach((item, index) => { res.result.forEach((item, index) => {
if (index === 0) {
sum = 0;
} else {
sum = sum + res.result[index - 1].children.length;
}
item.children.forEach((child, i) => { item.children.forEach((child, i) => {
if (state) { if (state) {
if (index === 0) { if (index === 0) {
child.answer = child.answer = this.data["经营问卷"][i];
this.data["经营问卷"][index * item.children.length + i];
} else { } else {
child.answer = child.answer = this.data["经营问卷"][sum + i];
this.data["经营问卷"][
index * item.children.length + i + 2 * index - 1
];
} }
} else { } else {
child.answer = child.type === "多选题" ? [] : ""; child.answer = child.type === "多选题" ? [] : "";