|
@@ -508,6 +508,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
<PreviewOperation
|
|
<PreviewOperation
|
|
|
v-if="isHasInput"
|
|
v-if="isHasInput"
|
|
|
|
|
+ :is-show-retry="isHasInput"
|
|
|
|
|
+ :is-show-answer="isHasInput && isShowAnswerFill"
|
|
|
|
|
+ :is-show-judge-correct="isShowJudgeCorrect"
|
|
|
@showAnswerAnalysis="showAnswerAnalysis"
|
|
@showAnswerAnalysis="showAnswerAnalysis"
|
|
|
@judgeCorrect="judgeCorrect"
|
|
@judgeCorrect="judgeCorrect"
|
|
|
@retry="retry"
|
|
@retry="retry"
|
|
@@ -638,6 +641,14 @@
|
|
|
>
|
|
>
|
|
|
{{ convertText(computedAnswerText(word, i, j)) }}
|
|
{{ convertText(computedAnswerText(word, i, j)) }}
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="computedAnswerText(word, i, j).length === 0"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ v-model="word.value"
|
|
|
|
|
+ :disabled="disabled"
|
|
|
|
|
+ :class="[...computedAnswerClass(word, i, j)]"
|
|
|
|
|
+ :style="getInputStyle(item.styleObj, word)"
|
|
|
|
|
+ />
|
|
|
<span v-if="data.property.pinyin_position === 'bottom'" class="pinyin"> </span>
|
|
<span v-if="data.property.pinyin_position === 'bottom'" class="pinyin"> </span>
|
|
|
</template>
|
|
</template>
|
|
|
</span>
|
|
</span>
|
|
@@ -742,6 +753,14 @@
|
|
|
>
|
|
>
|
|
|
{{ convertText(computedAnswerText(word, i, j)) }}
|
|
{{ convertText(computedAnswerText(word, i, j)) }}
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ v-if="computedAnswerText(word, i, j).length === 0"
|
|
|
|
|
+ v-model="word.value"
|
|
|
|
|
+ :disabled="disabled"
|
|
|
|
|
+ :class="[...computedAnswerClass(word, i, j)]"
|
|
|
|
|
+ :style="getInputStyle(item.styleObj, word)"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</span>
|
|
</span>
|
|
|
</span>
|
|
</span>
|
|
@@ -876,6 +895,24 @@
|
|
|
>
|
|
>
|
|
|
{{ convertText(computedAnswerText(item, i, j)) }}
|
|
{{ convertText(computedAnswerText(item, i, j)) }}
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="computedAnswerText(item, i, j).length === 0"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ v-model="item.value"
|
|
|
|
|
+ :disabled="disabled"
|
|
|
|
|
+ :class="[...computedAnswerClass(item, i, j)]"
|
|
|
|
|
+ :style="[
|
|
|
|
|
+ {
|
|
|
|
|
+ width: Math.max(40, item.value.length * 21.3) + 'px',
|
|
|
|
|
+ fontSize:
|
|
|
|
|
+ data.unified_attrib && data.unified_attrib.font_size
|
|
|
|
|
+ ? data.unified_attrib.font_size
|
|
|
|
|
+ : '',
|
|
|
|
|
+ fontFamily:
|
|
|
|
|
+ data.unified_attrib && data.unified_attrib.font ? data.unified_attrib.font : '',
|
|
|
|
|
+ },
|
|
|
|
|
+ ]"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -991,6 +1028,20 @@ export default {
|
|
|
return { ...obj, ...styleObject };
|
|
return { ...obj, ...styleObject };
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ // 是否有固定答案(data.answer.answer_list 中存在任意一项 value 非空)
|
|
|
|
|
+ hasFixedAnswer() {
|
|
|
|
|
+ return this.data.answer_lists.some((subArr) =>
|
|
|
|
|
+ subArr.some((item) => (item.answer && item.answer.trim() !== '') || item.crossAnswer !== 'normal'),
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ // 是否显示判断对错按钮:有固定答案时才显示
|
|
|
|
|
+ isShowJudgeCorrect() {
|
|
|
|
|
+ return this.hasFixedAnswer;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 是否显示查看答案按钮:有固定答案或参考答案(answer_list)有数据时显示
|
|
|
|
|
+ isShowAnswerFill() {
|
|
|
|
|
+ return this.hasFixedAnswer || (this.data.answer_list || []).length > 0;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
'data.col_width': {
|
|
'data.col_width': {
|