From 993befc0fe32d3a5bf95e62ac6d7dcd9ee2d0bd4 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 29 十月 2024 14:44:16 +0800
Subject: [PATCH] 正式环境
---
src/views/exam/components/answer-sheet/index.vue | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/views/exam/components/answer-sheet/index.vue b/src/views/exam/components/answer-sheet/index.vue
index fef8708..bb9bc94 100644
--- a/src/views/exam/components/answer-sheet/index.vue
+++ b/src/views/exam/components/answer-sheet/index.vue
@@ -3,7 +3,7 @@
<el-scrollbar>
<el-collapse v-model="activeNames">
<template v-for="item in examDetail">
- <el-collapse-item :title="examType[item.questionType]" :name="item.questionType">
+ <el-collapse-item :title="item.title" :name="item.questionType">
<div class="sheet-list grid grid-cols-5 gap-4 justify-items-center">
<div class="sheet-item cursor-pointer flex justify-center items-center" v-for="question,index in item.questionList" @click="sheetClick(item.questionType,index)" :class="itemClass(question,item.questionType, index)">
{{ index + 1 }}
@@ -22,13 +22,13 @@
import {useExamStore} from '@/store/index.js';
const examStore = useExamStore();
-const {examType, examDetail,currentType,currentIndex} = storeToRefs(examStore);
+const {examDetail,currentType,currentIndex} = storeToRefs(examStore);
const activeNames = ref(examDetail.value.map(item => item.questionType));
const itemClass = (question,type,index) => {
return {
- answer: question.correct,
+ answer: question.answer || checkAnswerList(question.answerList),
active: currentType.value === type && currentIndex.value === index
}
}
@@ -38,6 +38,11 @@
currentIndex.value = index;
}
+
+const checkAnswerList = (answerList) => {
+ return Array.isArray(answerList) && answerList.length && answerList.every(item => item);
+}
+
</script>
<style lang="scss" scoped>
--
Gitblit v1.8.0