From 34c98099b187bef54aa81fc3fa680fe8099eb3ad Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期二, 02 七月 2024 17:55:41 +0800
Subject: [PATCH] feat:资源文件列表接口
---
src/views/exam/components/answer-sheet/index.vue | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/views/exam/components/answer-sheet/index.vue b/src/views/exam/components/answer-sheet/index.vue
index 2199d32..bb9bc94 100644
--- a/src/views/exam/components/answer-sheet/index.vue
+++ b/src/views/exam/components/answer-sheet/index.vue
@@ -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.answer || (question.answerList && question.answerList.length),
+ 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