feat[preview]: 增加图文题的支持
- 增加组件 PreviewTextWithImages.vue. - preview 开放图文题入口
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<van-field
|
<van-field
|
||||||
readonly
|
readonly
|
||||||
:label="element.stem"
|
:label="element.stem"
|
||||||
:required="element.config.is_required === 1"
|
:required="element.config?.is_required === 1"
|
||||||
label-align="top"
|
label-align="top"
|
||||||
class="base-select contenteditable-question-title"
|
class="base-select contenteditable-question-title"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -157,19 +157,19 @@
|
|||||||
isMobile
|
isMobile
|
||||||
@change-answer="onRelation($event, question)"
|
@change-answer="onRelation($event, question)"
|
||||||
/>
|
/>
|
||||||
<!-- <!– 图文说明题 –>-->
|
<!-- 图文说明题 -->
|
||||||
<!-- <q-img-text-->
|
<preview-text-with-images
|
||||||
<!-- :stem="question.stem"-->
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
||||||
<!-- v-else-if="question.question_type === 6"-->
|
:stem="question.stem"
|
||||||
<!-- :config="question.config"-->
|
v-else-if="question.question_type === 6"
|
||||||
<!-- isMobile-->
|
:config="question.config"
|
||||||
<!-- @previous="previous"-->
|
@previous="previous"
|
||||||
<!-- @next="next"-->
|
@next="next"
|
||||||
<!-- v-model:answer="question.answer"-->
|
v-model:answer="question.answer"
|
||||||
<!-- :answerSn="questionsData.answer.sn"-->
|
:answerSn="questionsData.answer.sn"
|
||||||
<!-- :answerSurveySn="questionsData.answer.survey_sn"-->
|
:answerSurveySn="questionsData.answer.survey_sn"
|
||||||
<!-- :question="question"-->
|
:question="question"
|
||||||
<!-- />-->
|
/>
|
||||||
<!-- <!– 日期时间题 –>-->
|
<!-- <!– 日期时间题 –>-->
|
||||||
<!-- <q-date-->
|
<!-- <q-date-->
|
||||||
<!-- v-else-if="question.question_type === 7"-->
|
<!-- v-else-if="question.question_type === 7"-->
|
||||||
@@ -540,6 +540,7 @@ import { getQuestionIndex } from '@/utils/utils.js';
|
|||||||
import PreviewCheckbox from '@/views/Survey/views/Preview/components/questions/PreviewCheckbox.vue';
|
import PreviewCheckbox from '@/views/Survey/views/Preview/components/questions/PreviewCheckbox.vue';
|
||||||
import PreviewRate from '@/views/Survey/views/Preview/components/questions/PreviewRate.vue';
|
import PreviewRate from '@/views/Survey/views/Preview/components/questions/PreviewRate.vue';
|
||||||
import PreviewSign from '@/views/Survey/views/Preview/components/questions/PreviewSign.vue';
|
import PreviewSign from '@/views/Survey/views/Preview/components/questions/PreviewSign.vue';
|
||||||
|
import PreviewTextWithImages from '@/views/Survey/views/Preview/components/questions/PreviewTextWithImages.vue';
|
||||||
const isPreview = defineModel('isPreview', {
|
const isPreview = defineModel('isPreview', {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import TextWithImages from '@/views/Design/components/Questions/TextWithImages.vue';
|
||||||
|
|
||||||
|
// 问题
|
||||||
|
const question = defineModel<question>('question', { default: {} });
|
||||||
|
// question 序号
|
||||||
|
const answerIndex = defineModel('answerIndex', { default: 0 });
|
||||||
|
// 答案
|
||||||
|
const answer = defineModel('answer', { default: {} });
|
||||||
|
// answer 提供默认值
|
||||||
|
answer.value = {};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<text-with-images :element="question" :index="answerIndex" :error-message="question.error" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
Reference in New Issue
Block a user