|
|
|
|
@@ -24,7 +24,10 @@
|
|
|
|
|
<!-- <img :src="icon" alt="icon" />-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="styleInfo.logo_status && styleInfo.logo_url" class="example-logo" :style="[
|
|
|
|
|
<div
|
|
|
|
|
v-if="styleInfo.logo_status && styleInfo.logo_url"
|
|
|
|
|
class="example-logo"
|
|
|
|
|
:style="[
|
|
|
|
|
{
|
|
|
|
|
'justify-content':
|
|
|
|
|
styleInfo.logo_site === 1
|
|
|
|
|
@@ -39,7 +42,8 @@
|
|
|
|
|
!styleInfo.head_img_status && styleInfo.background_status
|
|
|
|
|
? `background-color: ${styleInfo.background_color};background-image: url(${styleInfo.background_url})`
|
|
|
|
|
: ''
|
|
|
|
|
]">
|
|
|
|
|
]"
|
|
|
|
|
>
|
|
|
|
|
<img class="logo" :src="styleInfo.logo_url" alt="logo" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@@ -47,8 +51,14 @@
|
|
|
|
|
<!-- eslint-disable-next-line -->
|
|
|
|
|
<div class="questions">
|
|
|
|
|
<!-- 提前终止和正常完成 -->
|
|
|
|
|
<q-last v-if="page === pages.length + 1" :code="questionsData?.action?.code" :action="questionsData?.action"
|
|
|
|
|
:survey="questionsData?.survey" :isAnswer="isAnswer" :isTemplate="isTemplate" />
|
|
|
|
|
<q-last
|
|
|
|
|
v-if="page === pages.length + 1"
|
|
|
|
|
:code="questionsData?.action?.code"
|
|
|
|
|
:action="questionsData?.action"
|
|
|
|
|
:survey="questionsData?.survey"
|
|
|
|
|
:isAnswer="isAnswer"
|
|
|
|
|
:isTemplate="isTemplate"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 问卷名和描述 -->
|
|
|
|
|
<!-- <q-first v-else-if="page === 0" isMobile :title="questionsData?.survey?.title"
|
|
|
|
|
:desc="questionsData?.survey?.introduction" :questions="questionsData?.questions" :isAnswer="isAnswer"
|
|
|
|
|
@@ -60,8 +70,13 @@
|
|
|
|
|
:questionType="question.question_type" :questionIndex="question.question_index"
|
|
|
|
|
:showTitle="styleInfo.is_question_number && true" isMobile :isAnswer="isAnswer"> -->
|
|
|
|
|
|
|
|
|
|
<div v-for="question in questions" v-else :id="'questionIndex' + question.question_index"
|
|
|
|
|
:key="question.question_index" class="question">
|
|
|
|
|
<div
|
|
|
|
|
v-for="question in questions"
|
|
|
|
|
v-else
|
|
|
|
|
:id="'questionIndex' + question.question_index"
|
|
|
|
|
:key="question.question_index"
|
|
|
|
|
class="question"
|
|
|
|
|
>
|
|
|
|
|
<!-- <q-radio-->
|
|
|
|
|
<!-- v-if="question.question_type === 1"-->
|
|
|
|
|
<!-- :list="question.list"-->
|
|
|
|
|
@@ -77,17 +92,37 @@
|
|
|
|
|
<!-- :question="question"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- 单选题 -->
|
|
|
|
|
<preview-choice v-if="question.question_type === 1" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
|
|
|
|
|
:config="question.config" :hideOptions="question.hideOptions" :stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
|
|
|
|
|
@previous="previous" @next="next" @change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-choice
|
|
|
|
|
v-if="question.question_type === 1"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:list="question.list"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:hideOptions="question.hideOptions"
|
|
|
|
|
:stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn"
|
|
|
|
|
:answerSurveySn="questionsData.answer.survey_sn"
|
|
|
|
|
:question="question"
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 多选题 -->
|
|
|
|
|
<preview-checkbox v-else-if="question.question_type === 2" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
|
|
|
|
|
:config="question.config" :hideOptions="question.hideOptions" :stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
|
|
|
|
|
@change-answer="onRelation($event, question)" @previous="previous" @next="next" />
|
|
|
|
|
<preview-checkbox
|
|
|
|
|
v-else-if="question.question_type === 2"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:list="question.list"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:hideOptions="question.hideOptions"
|
|
|
|
|
:stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn"
|
|
|
|
|
:answerSurveySn="questionsData.answer.survey_sn"
|
|
|
|
|
:question="question"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
/>
|
|
|
|
|
<!-- <!– 级联题 –>-->
|
|
|
|
|
<!-- <q-cascader-->
|
|
|
|
|
<!-- v-else-if="question.question_type === 3"-->
|
|
|
|
|
@@ -98,19 +133,43 @@
|
|
|
|
|
<!-- isMobile-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- 填空题 -->
|
|
|
|
|
<preview-completion v-else-if="question.question_type === 4" :config="question.config" :answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
|
|
|
|
|
@previous="previous" @next="next" @change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-completion
|
|
|
|
|
v-else-if="question.question_type === 4"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn"
|
|
|
|
|
:answerSurveySn="questionsData.answer.survey_sn"
|
|
|
|
|
:question="question"
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 打分题 -->
|
|
|
|
|
<preview-rate v-else-if="question.question_type === 5" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
|
|
|
|
|
:config="question.config" :question="question" isMobile @change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-rate
|
|
|
|
|
v-else-if="question.question_type === 5"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:list="question.list"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:question="question"
|
|
|
|
|
isMobile
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 图文说明题 -->
|
|
|
|
|
<preview-text-with-images :answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:stem="question.stem" v-else-if="question.question_type === 6" :config="question.config" @previous="previous"
|
|
|
|
|
@next="next" v-model:answer="question.answer" :answerSn="questionsData.answer.sn"
|
|
|
|
|
:answerSurveySn="questionsData.answer.survey_sn" :question="question" />
|
|
|
|
|
<preview-text-with-images
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:stem="question.stem"
|
|
|
|
|
v-else-if="question.question_type === 6"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerSn="questionsData.answer.sn"
|
|
|
|
|
:answerSurveySn="questionsData.answer.survey_sn"
|
|
|
|
|
:question="question"
|
|
|
|
|
/>
|
|
|
|
|
<!-- <!– 日期时间题 –>-->
|
|
|
|
|
<!-- <q-date-->
|
|
|
|
|
<!-- v-else-if="question.question_type === 7"-->
|
|
|
|
|
@@ -120,20 +179,45 @@
|
|
|
|
|
<!-- isMobile-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- 矩阵填空题 -->
|
|
|
|
|
<preview-matrix-text v-else-if="question.question_type === 8" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
|
|
|
|
|
:questionIndex="question.question_index" :config="question.config" :stem="question.stem" :question="question"
|
|
|
|
|
@previous="previous" @next="next" @change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-matrix-text
|
|
|
|
|
v-else-if="question.question_type === 8"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:list="question.list"
|
|
|
|
|
:questionIndex="question.question_index"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:stem="question.stem"
|
|
|
|
|
:question="question"
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 矩阵单选题 -->
|
|
|
|
|
<preview-matrix-radio v-else-if="question.question_type === 9" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
|
|
|
|
|
:questionIndex="question.question_index" :config="question.config" :stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn" :answerSurveySn="questionsData.answer.survey_sn" :question="question"
|
|
|
|
|
@change-answer="onRelation($event, question)" @previous="previous" @next="next" />
|
|
|
|
|
<preview-matrix-radio
|
|
|
|
|
v-else-if="question.question_type === 9"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:list="question.list"
|
|
|
|
|
:questionIndex="question.question_index"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:stem="question.stem"
|
|
|
|
|
:answerSn="questionsData.answer.sn"
|
|
|
|
|
:answerSurveySn="questionsData.answer.survey_sn"
|
|
|
|
|
:question="question"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 矩阵多选题 -->
|
|
|
|
|
<preview-matrix-checkbox v-else-if="question.question_type === 10" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :list="question.list"
|
|
|
|
|
:config="question.config" :question="question" @change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-matrix-checkbox
|
|
|
|
|
v-else-if="question.question_type === 10"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:list="question.list"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:question="question"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- <!– 矩阵打分题 –>-->
|
|
|
|
|
<!-- <matrix-rate-->
|
|
|
|
|
<!-- v-else-if="question.question_type === 11"-->
|
|
|
|
|
@@ -201,10 +285,16 @@
|
|
|
|
|
<!-- isMobile-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- 文件上传题 -->
|
|
|
|
|
<preview-file-upload v-else-if="question.question_type === 18" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :config="question.config"
|
|
|
|
|
:question="question" isMobile :questionIndex="question.question_index"
|
|
|
|
|
@change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-file-upload
|
|
|
|
|
v-else-if="question.question_type === 18"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:question="question"
|
|
|
|
|
isMobile
|
|
|
|
|
:questionIndex="question.question_index"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- <!– 地理位置题 –>-->
|
|
|
|
|
<!-- <q-map-->
|
|
|
|
|
<!-- v-else-if="question.question_type === 19"-->
|
|
|
|
|
@@ -233,9 +323,14 @@
|
|
|
|
|
<!-- isMobile-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- 签名题 -->
|
|
|
|
|
<preview-sign v-else-if="question.question_type === 22" :config="question.config" :question="question"
|
|
|
|
|
v-model:answer="question.answer" :answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
@change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-sign
|
|
|
|
|
v-else-if="question.question_type === 22"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:question="question"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- <!– 知情同意书 –>-->
|
|
|
|
|
<!-- <q-consent-->
|
|
|
|
|
<!-- v-else-if="question.question_type === 23"-->
|
|
|
|
|
@@ -359,12 +454,26 @@
|
|
|
|
|
<!-- :question="question"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- <!– 高级题型-NPS –>-->
|
|
|
|
|
<preview-n-p-s v-else-if="question.question_type === 106" v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)" :isPreview="isPreview"
|
|
|
|
|
:title="question.title" :stem="question.stem" :list="question.list" :config="question.config"
|
|
|
|
|
:isAnswer="isAnswer" :questionIndex="question.question_index" :label="question.title" :loading="loading"
|
|
|
|
|
:isTemplate="isTemplate" :showTitle="styleInfo.is_question_number" :question="question" @previous="previous"
|
|
|
|
|
@next="next" @change-answer="onRelation($event, question)" />
|
|
|
|
|
<preview-n-p-s
|
|
|
|
|
v-else-if="question.question_type === 106"
|
|
|
|
|
v-model:answer="question.answer"
|
|
|
|
|
:answerIndex="getQuestionIndex(questionsData.questions, question)"
|
|
|
|
|
:isPreview="isPreview"
|
|
|
|
|
:title="question.title"
|
|
|
|
|
:stem="question.stem"
|
|
|
|
|
:list="question.list"
|
|
|
|
|
:config="question.config"
|
|
|
|
|
:isAnswer="isAnswer"
|
|
|
|
|
:questionIndex="question.question_index"
|
|
|
|
|
:label="question.title"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
:isTemplate="isTemplate"
|
|
|
|
|
:showTitle="styleInfo.is_question_number"
|
|
|
|
|
:question="question"
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
@change-answer="onRelation($event, question)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- <LangTranslate v-if="isAnswer && styleInfo.is_yip" translate-key="PoweredByDigitalTechnologyCenterYIP"
|
|
|
|
|
@@ -375,14 +484,33 @@
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 分页 -->
|
|
|
|
|
<!-- eslint-disable max-len -->
|
|
|
|
|
<pfe-pagination v-if="isPreview" class="pagination" :isPreview="isPreview" :page="page" :pages="pages.length + 1"
|
|
|
|
|
:min="styleInfo.is_home ? 0 : 1" :loading="loading" :showPrevious="styleInfo.is_up_button"
|
|
|
|
|
:showStart="styleInfo.is_start_button" :startText="styleInfo.start_button_text"
|
|
|
|
|
:showSubmit="styleInfo.is_submit_button" :submitText="localPageTimer.is_show && localPageTimer.short_time
|
|
|
|
|
<pfe-pagination
|
|
|
|
|
v-if="isPreview"
|
|
|
|
|
class="pagination"
|
|
|
|
|
:isPreview="isPreview"
|
|
|
|
|
:page="page"
|
|
|
|
|
:pages="pages.length + 1"
|
|
|
|
|
:min="styleInfo.is_home ? 0 : 1"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
:showPrevious="styleInfo.is_up_button"
|
|
|
|
|
:showStart="styleInfo.is_start_button"
|
|
|
|
|
:startText="styleInfo.start_button_text"
|
|
|
|
|
:showSubmit="styleInfo.is_submit_button"
|
|
|
|
|
:submitText="
|
|
|
|
|
localPageTimer.is_show && localPageTimer.short_time
|
|
|
|
|
? `${localPageTimer.short_time}S`
|
|
|
|
|
: styleInfo.submit_button_text
|
|
|
|
|
" :buttonTextColor="styleInfo.button_text_color" :buttonColor="styleInfo.button_color" :nextText="localPageTimer.is_show && localPageTimer.short_time ? `${localPageTimer.short_time}S` : ''
|
|
|
|
|
" :nextDisabled="localPageTimer.short_time" isMobile @previous="previous" @next="next">
|
|
|
|
|
"
|
|
|
|
|
:buttonTextColor="styleInfo.button_text_color"
|
|
|
|
|
:buttonColor="styleInfo.button_color"
|
|
|
|
|
:nextText="
|
|
|
|
|
localPageTimer.is_show && localPageTimer.short_time ? `${localPageTimer.short_time}S` : ''
|
|
|
|
|
"
|
|
|
|
|
:nextDisabled="localPageTimer.short_time"
|
|
|
|
|
isMobile
|
|
|
|
|
@previous="previous"
|
|
|
|
|
@next="next"
|
|
|
|
|
>
|
|
|
|
|
</pfe-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- eslint-enable max-len -->
|
|
|
|
|
@@ -444,7 +572,6 @@ questionsData.value?.questions && clearAnswer(questionsData.value.questions);
|
|
|
|
|
page.value = 1;
|
|
|
|
|
// 清空action
|
|
|
|
|
// delete questionsData.value.action;
|
|
|
|
|
console.log(`come in preview`, questionsData.value);
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
isTemplate: {
|
|
|
|
|
@@ -460,7 +587,6 @@ const props = defineProps({
|
|
|
|
|
// 初始化 isTemplate
|
|
|
|
|
isTemplate.value = props.isTemplate ? props.isTemplate : route.query.is_template === '1';
|
|
|
|
|
|
|
|
|
|
console.log(`now page is template? ${isTemplate.value}`);
|
|
|
|
|
// 开始更新数据
|
|
|
|
|
getQuestions();
|
|
|
|
|
|
|
|
|
|
|