Browse Source

答题页面增加简述题

pull/1/head
wangxy 3 years ago
parent
commit
a5a74d1fa0
1 changed files with 35 additions and 4 deletions
  1. +35
    -4
      src/views/questionnaire/question.vue

+ 35
- 4
src/views/questionnaire/question.vue View File

@ -283,6 +283,36 @@
</el-checkbox>
</el-checkbox-group>
</div>
</div>
<div v-if="item.subjecttype === '简述题'">
<div v-for="(obj, id) in item.valst" :key="id">
<el-input :label="obj.optionid" v-model="item.paper">
<span v-if="obj.optiontype !== 1"
style="width:98%;word-break:normal;white-space:pre-wrap;">{{ obj.optiontext }}</span>
<el-input v-else
v-model="obj.optioninput"
placeholder="请输入"
size="small">
<template slot="prepend">{{ obj.optiontext }}:</template>
</el-input>
<div v-if="obj.optionpicture.indexOf('.') !== -1">
<viewer :images=" obj.optionpicture.split(',')">
<img v-for="(src,i) in obj.optionpicture.split(',')"
:key="i"
:src="baseUrl + src"
width="100"
style="margin: 4px">
</viewer>
</div>
<div v-if="obj.optionvideo.indexOf('.') !== -1">
<video width="120" height="80" controls>
<source :src="baseUrl + obj.optionvideo"
:type="`video/${(obj.optionvideo || '1.').split('.').length > 1 ? obj.optionvideo.split('.')[1] : '' }`">
您的浏览器不支持 HTML5 video 标签
</video>
</div>
</el-input>
</div>
</div>
</div>
</div>
@ -351,7 +381,6 @@ export default {
surveysheetid: this.$route.query.surveysheetid,
cnr: this.$route.query.cnr
}).then((res) => {
console.log(res)
this.data = res.data.valst
this.data.forEach((item) => {
if (item.subjecttype === '单选题') {
@ -390,7 +419,6 @@ export default {
// }
// }
this.data = arr
console.log(arr)
})
},
commitEvent() {
@ -409,8 +437,11 @@ export default {
}
let flag = true
this.data.forEach((item) => {
if ((item.subjecttype === '单选题' && !item.radio && item.fsubjectid === '') ||
(item.subjecttype === '多选题' && item.checkList.length < 1 && item.fsubjectid === '')) {
if (
(item.subjecttype === '单选题' && !item.radio && item.fsubjectid === '') ||
(item.subjecttype === '多选题' && item.checkList.length < 1 && item.fsubjectid === '')
(item.subjecttype === '简述题' && !item.paper && item.fsubjectid === '')
) {
flag = false
return flag
}


Loading…
Cancel
Save