From 6ad528944f24daec8547126bf591868a00b1176a Mon Sep 17 00:00:00 2001
From: yj <2077506045@qq.com>
Date: 星期二, 07 五月 2024 18:12:37 +0800
Subject: [PATCH] 人格测试类型增加演示功能

---
 src/views/exam/paper/exercise.vue |  117 ++++++++++++++++++++--------------------------------------
 1 files changed, 41 insertions(+), 76 deletions(-)

diff --git a/src/views/exam/paper/exercise.vue b/src/views/exam/paper/exercise.vue
index 8c70b0b..0edbffc 100644
--- a/src/views/exam/paper/exercise.vue
+++ b/src/views/exam/paper/exercise.vue
@@ -1,18 +1,18 @@
 <template>
   <div>
     <el-container  class="app-item-contain">
-00      <el-main style="padding-top: 3%;">
+      <el-main style="padding-top: 3%;">
         <el-form :model="form" ref="form" label-width="100%">
           <el-row :key="index"  v-for="(titleItem,index) in titleItems">
             <div class="q-content">{{titleItem.description}}</div>
             <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length!==0"  style="border:2px solid #2b90ff;">
               <div class="align-center"><span style="font-size: small; float: left">{{$t('examinee')}}{{memberName}}</span><span style="margin-top: 0px;padding-right: 11%">鈼弡{form.name}}鈼�</span></div>
               <hr style="border : 1px dashed #b3d8ff;" />
-              <el-row style="margin-left:7px;margin-bottom:10px;">{{ questionItem.note }}</el-row>
-              <el-row style="margin-left:7px;margin-bottom:10px;">{{ questionItem.guide }}</el-row>
+              <el-row style="margin-left:7px;margin-bottom:10px;">{{ questionItem.items.length != 4?note:note_1 }}</el-row>
+              <el-row style="margin-left:7px;margin-bottom:10px;">{{ questionItem.items.length != 4?guide:guide_1 }}</el-row>
               <el-form-item :key="itemOrder" label-width="1px">
                 <QuestionEdit @callNextSubject="nextSubject" :qType="questionItem.questionType" :question="questionItem"
-                              :answer="answer.answerItems[questionItem.itemOrder-1]" :qLabel="itemOrder+'/'+itemSize"/>
+                              :answer="answer.answerItems[itemOrder-1]" :qLabel="itemOrder+'/'+itemSize"/>
               </el-form-item>
               <hr style="border : 0.5px dashed #b3d8ff;" />
               <div style="color: red;font-size: smaller">{{$t('pleaseAnswerCarefully_exercise')}}</div>
@@ -62,64 +62,36 @@
   components: { QuestionEdit },
   data () {
     return {
+      formDo: this.$route.query.formDo,
       memberName: this.$route.query.formDo.memberName,
       form: {
         name: this.$route.query.formDo.name
       },
       itemOrder: 1,
       itemSize: 2,
-      description: '',
-      guide: '',
-      questionItem: {
-        title: '鎴戝杽浜庝富鍔ㄥ拰闄岀敓浜轰氦璋堛��',
-        items: [
-          { content: '闈炲父涓嶅悓鎰�', prefix: '1', score: 0 },
-          { content: '涓嶅悓鎰�', prefix: '2', score: 0 },
-          { content: '涓嶇‘瀹�', prefix: '3', score: 0 },
-          { content: '鍚屾剰', prefix: '4', score: 0 },
-          { content: '闈炲父鍚屾剰', prefix: '5', score: 0 }
-        ],
-        questionType: 1,
-        note: '浠ヤ笅涓哄伐浣滆涓�/棰樼洰椋庢牸鐨勪緥瀛�',
-        guide: '璇蜂粩缁嗛槄璇讳笅闈㈢殑闄堣堪锛屽垽鏂偍鍦ㄥ澶х▼搴︿笂鍚屾剰姣忎竴闄堣堪瀵规偍鐨勬弿杩帮紝鐒跺悗鐐瑰嚮鐩稿簲鐨勯�夐」銆�'
-      },
+      note: this.$t('exercise_note'),
+      guide: this.$t('exercise_guide'),
+      note_1: this.$t('exercise_note_1'),
+      guide_1: this.$t('exercise_guide_1'),
       answer: {
-        questionId: null,
-        doTime: 0,
-        answerItems: [],
-        verifyStatus: 2
+        answerItems: [
+          {
+            content: '',
+            readOnly: false
+          },
+          {
+            content: '',
+            readOnly: false
+          }
+        ]
       },
-      titleItems: [
-        {
-          questionItems: [
-            {
-              title: '鎴戝杽浜庝富鍔ㄥ拰闄岀敓浜轰氦璋堛��',
-              items: [
-                { content: '闈炲父涓嶅悓鎰�', prefix: '1', score: 0 },
-                { content: '涓嶅悓鎰�', prefix: '2', score: 0 },
-                { content: '涓嶇‘瀹�', prefix: '3', score: 0 },
-                { content: '鍚屾剰', prefix: '4', score: 0 },
-                { content: '闈炲父鍚屾剰', prefix: '5', score: 0 }
-              ],
-              questionType: 1
-            },
-            {
-              title: '浣跨敤澶嶅嵃鏈恒��',
-              items: [
-                { content: '浠庢潵娌℃湁', prefix: '1', score: 0 },
-                { content: '1-2娆�', prefix: '2', score: 0 },
-                { content: '濂藉嚑娆�', prefix: '3', score: 0 },
-                { content: '缁忓父', prefix: '4', score: 0 }
-              ],
-              questionType: 1
-            }
-          ]
-        }
-      ],
+      titleItems: [],
+      questionItem: {},
       isSubmit: false
     }
   },
   created: function () {
+    this.initQuestion()
   },
   mounted () {
   },
@@ -128,42 +100,35 @@
   watch: {
   },
   methods: {
+    // 鍒濆鍖栭鐩�
+    initQuestion () {
+      this.titleItems = [
+        {
+          questionItems: [
+            this.formDo.titleItems[0].questionItems[0],
+            this.formDo.titleItems[0].questionItems[1]
+          ]
+        }
+      ]
+      this.questionItem = this.titleItems[0].questionItems[this.itemOrder - 1]
+    },
     nextSubject () {
+      console.log(this.answer)
+      console.log('formDo')
+      console.log(this.formDo)
       if (this.itemOrder === 2) {
         this.isSubmit = true
         return
       }
-      this.questionItem = {
-        title: '浣跨敤澶嶅嵃鏈恒��',
-        items: [
-          { content: '浠庢潵娌℃湁', prefix: '1', score: 0 },
-          { content: '1-2娆�', prefix: '2', score: 0 },
-          { content: '濂藉嚑娆�', prefix: '3', score: 0 },
-          { content: '缁忓父', prefix: '4', score: 0 }
-        ],
-        questionType: 1,
-        note: '浠ヤ笅涓哄熀鏈妧鑳借繃寰�缁忛獙棰樼洰鐨勪緥瀛�',
-        guide: '鎮ㄥ湪杩囧幓涓�骞翠腑浣跨敤杩囪繖浜涘熀鏈妧鑳界殑棰戝害锛屽苟鐐瑰嚮鐩稿簲鐨勯�夐」銆�'
-
-      }
       this.itemOrder = 2
+      this.answer.answerItems[this.itemOrder - 1].readOnly = false
+      this.questionItem = this.titleItems[0].questionItems[this.itemOrder - 1]
     },
     preSubject () {
       this.isSubmit = false
-      this.questionItem = {
-        title: '鎴戝杽浜庝富鍔ㄥ拰闄岀敓浜轰氦璋堛��',
-        items: [
-          { content: '闈炲父涓嶅悓鎰�', prefix: '1', score: 0 },
-          { content: '涓嶅悓鎰�', prefix: '2', score: 0 },
-          { content: '涓嶇‘瀹�', prefix: '3', score: 0 },
-          { content: '鍚屾剰', prefix: '4', score: 0 },
-          { content: '闈炲父鍚屾剰', prefix: '5', score: 0 }
-        ],
-        questionType: 1,
-        note: '浠ヤ笅涓哄伐浣滆涓�/棰樼洰椋庢牸鐨勪緥瀛�',
-        guide: '璇蜂粩缁嗛槄璇讳笅闈㈢殑闄堣堪锛屽垽鏂偍鍦ㄥ澶х▼搴︿笂鍚屾剰姣忎竴闄堣堪瀵规偍鐨勬弿杩帮紝鐒跺悗鐐瑰嚮鐩稿簲鐨勯�夐」銆�'
-      }
       this.itemOrder = 1
+      this.answer.answerItems[this.itemOrder - 1].readOnly = false
+      this.questionItem = this.titleItems[0].questionItems[this.itemOrder - 1]
     },
     doExam () {
       let _this = this

--
Gitblit v1.9.1