Explorar el Código

表格题只显示正确答案

natasha hace 1 semana
padre
commit
7828830c90

+ 18 - 18
src/views/book/courseware/preview/components/table/TablePreview.vue

@@ -299,7 +299,7 @@
                         :class="[index === 0 ? 'pinyin-text-left' : '']"
                         :class="[index === 0 ? 'pinyin-text-left' : '']"
                       >
                       >
                         <template v-if="item.type === 'input'">
                         <template v-if="item.type === 'input'">
-                          <template v-if="data.property.fill_type === fillTypeList[0].value">
+                          <!-- <template v-if="data.property.fill_type === fillTypeList[0].value">
                             <el-input
                             <el-input
                               :key="index"
                               :key="index"
                               v-model="item.value"
                               v-model="item.value"
@@ -354,7 +354,7 @@
                               :attrib="data.unified_attrib"
                               :attrib="data.unified_attrib"
                               @handleWav="handleMiniWav($event, item)"
                               @handleWav="handleMiniWav($event, item)"
                             />
                             />
-                          </template>
+                          </template> -->
                           <span v-if="data.property.pinyin_position === 'bottom'" class="pinyin">&nbsp;</span>
                           <span v-if="data.property.pinyin_position === 'bottom'" class="pinyin">&nbsp;</span>
                         </template>
                         </template>
                         <template v-else>
                         <template v-else>
@@ -369,9 +369,9 @@
                           }}</span>
                           }}</span>
                         </template>
                         </template>
                         <span
                         <span
-                          v-show="computedAnswerText(item, i, j).length > 0"
                           :key="`answer-${j}`"
                           :key="`answer-${j}`"
                           class="right-answer"
                           class="right-answer"
+                          v-show="computedAnswerText(item, i, j).length > 0"
                         >
                         >
                           {{ convertText(computedAnswerText(item, i, j)) }}
                           {{ convertText(computedAnswerText(item, i, j)) }}
                         </span>
                         </span>
@@ -390,7 +390,7 @@
                           v-html="convertText(sanitizeHTML(item.value))"
                           v-html="convertText(sanitizeHTML(item.value))"
                         ></span>
                         ></span>
                         <template v-if="item.type === 'input'">
                         <template v-if="item.type === 'input'">
-                          <template v-if="data.property.fill_type === fillTypeList[0].value">
+                          <!-- <template v-if="data.property.fill_type === fillTypeList[0].value">
                             <el-input
                             <el-input
                               :key="index"
                               :key="index"
                               v-model="item.value"
                               v-model="item.value"
@@ -445,12 +445,12 @@
                               :attrib="data.unified_attrib"
                               :attrib="data.unified_attrib"
                               @handleWav="handleMiniWav($event, item)"
                               @handleWav="handleMiniWav($event, item)"
                             />
                             />
-                          </template>
-                          {{ computedAnswerText(item, i, j) }}
+                          </template> -->
+
                           <span
                           <span
-                            v-show="computedAnswerText(item, i, j).length > 0"
                             :key="`answer-${j}`"
                             :key="`answer-${j}`"
                             class="right-answer"
                             class="right-answer"
+                            v-show="computedAnswerText(item, i, j).length > 0"
                           >
                           >
                             {{ convertText(computedAnswerText(item, i, j)) }}
                             {{ convertText(computedAnswerText(item, i, j)) }}
                           </span>
                           </span>
@@ -598,7 +598,7 @@ export default {
       let answerValue = answerOptionList[item.inputIndex] ? answerOptionList[item.inputIndex].split('/') : '';
       let answerValue = answerOptionList[item.inputIndex] ? answerOptionList[item.inputIndex].split('/') : '';
       let isRight = answerValue && answerValue.includes(selectValue);
       let isRight = answerValue && answerValue.includes(selectValue);
       if (isRight || !answerValue) return '';
       if (isRight || !answerValue) return '';
-      return `${answerValue.join('/')}`;
+      return `${answerValue.join('/')}`;
     },
     },
     /**
     /**
      * 计算答题对错选项字体颜色
      * 计算答题对错选项字体颜色
@@ -790,16 +790,6 @@ $border-color: #e6e6e6;
           }
           }
         }
         }
 
 
-        & + .right-answer {
-          position: relative;
-          left: -4px;
-          display: inline-block;
-          height: 32px;
-          line-height: 28px;
-          vertical-align: bottom;
-          border-bottom: 1px solid $font-color;
-        }
-
         :deep input.el-input__inner {
         :deep input.el-input__inner {
           padding: 0;
           padding: 0;
 
 
@@ -820,6 +810,16 @@ $border-color: #e6e6e6;
       }
       }
     }
     }
 
 
+    .right-answer {
+      position: relative;
+      left: -4px;
+      display: inline-block;
+      height: 24px;
+      line-height: 24px;
+      vertical-align: bottom;
+      border-bottom: 1px solid $font-color;
+    }
+
     .multilingual {
     .multilingual {
       display: block;
       display: block;
       word-break: break-word;
       word-break: break-word;