From 51ad6706fed4b080b0cb1bb771028a551b9ec27c Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期二, 22 十月 2024 15:19:18 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout

---
 src/components/examinations/index.vue |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue
index c8068ec..2d35390 100644
--- a/src/components/examinations/index.vue
+++ b/src/components/examinations/index.vue
@@ -38,7 +38,7 @@
               <p
                 class="titleText text-fl"
                 v-if="
-                  value.stemStyle == 'Txt' && value.questionType != 'completion'
+                  value.stemStyle == 'Txt' && value.questionType != 'completion' &&  value.questionType !='dropdown'
                 "
                 :id="value.id"
                 v-html="value.stem.stemTxt"
@@ -73,6 +73,7 @@
                   <span
                     v-if="typeof itemText == 'string'"
                     v-html="itemText"
+                    class="input-txt"
                   ></span>
                   <input
                     v-else
@@ -91,6 +92,33 @@
                 v-html="value.stem.stemTxt"
                 v-cloak
               ></p>
+              <!-- 涓嬫媺閫夋嫨棰� -->
+              <p class="titleText" v-if="value.questionType == 'dropdown'">
+                <span
+                  v-for="(itemText, indexText) in value.stem"
+                  :key="indexText + 'questionType'"
+                >
+                  <span
+                    v-if="typeof itemText == 'string'"
+                    v-html="itemText"
+                    class="input-txt"
+                  ></span>
+                  <el-select 
+                    v-else 
+                    v-model="value.userAnswer" 
+                    :disabled="value.isComplete"
+                  >
+                    <el-option 
+                      v-for="citem in value.option"
+                      :key="citem.index"
+                      :label="citem.txt"
+                      :value="citem.value"
+                    >
+
+                    </el-option>
+                  </el-select>
+                </span>
+              </p>
             </div>
             <img
               :src="value.isCollect ? isHeart : heart"
@@ -551,7 +579,6 @@
   watch: {
     cardList: {
       handler(newVal) {
-        // console.log('鏂板��',newVal);
         this.cardData = this.cardList;
         if (newVal && newVal.length) {
           this.loading = false;
@@ -566,6 +593,18 @@
     this.getErrorList();
   },
   methods: {
+    // 鑾峰彇涓嶅彈淇濇姢鐨勫浘鐗�
+    getPublicImage(md5, width, height) {
+      if(!md5) return 
+      if(md5.includes('http')) return md5
+      let src = null;
+      if (md5) {
+        src = process.env.VUE_APP_API_URL + `/file/GetPreViewImage?md5=${md5}`;
+      } 
+      if (width) src += `&width=${width}`;
+      if (height) src += `&height=${height}`;
+      return src;
+    },
     // 鏁扮粍杞负瀛楃涓叉柟娉�
     arrayToString(data) {
       // 妫�鏌ユ槸鍚︿负鏁扮粍
@@ -646,9 +685,9 @@
             }
           } else if (
             citem.questionType == "singleChoice" ||
-            citem.questionType == "judge"
+            citem.questionType == "judge" || 
+            citem.questionType == 'dropdown'
           ) {
-            if (citem.id == "63825") console.log("i", item);
             citem.isRight = citem.answer == citem.userAnswer;
           } else if (citem.questionType == "shortAnswer") {
             // 绠�绛� 缈昏瘧
@@ -858,6 +897,12 @@
 </script>
 
 
+<style lang="less" >
+  .titleText img {
+    max-width: 80%;
+  }
+</style>
+
 <style lang="less" scoped>
 .catalogName {
   text-indent: 1em !important;
@@ -1010,11 +1055,14 @@
       font-size: 16px;
       line-height: 32px;
       color: #000;
-
+      .input-txt {
+        display: flex;
+        flex-wrap: wrap;
+        align-items: center;
+      }
       span {
         display: inline-block;
         font-size: 16px;
-        // line-height: 26px;
         color: #000;
         font-weight: 400;
         margin-top: 6px;

--
Gitblit v1.9.1