From da2f959b7f5e0ec28dc29b638dffad8eae305152 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期三, 19 六月 2024 11:52:35 +0800
Subject: [PATCH] fix:限制图片大小
---
src/views/exam/components/answer-main/answer-multiple/index.vue | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/views/exam/components/answer-main/answer-multiple/index.vue b/src/views/exam/components/answer-main/answer-multiple/index.vue
index 328da09..e925454 100644
--- a/src/views/exam/components/answer-main/answer-multiple/index.vue
+++ b/src/views/exam/components/answer-main/answer-multiple/index.vue
@@ -17,17 +17,23 @@
<script setup>
import { ref } from 'vue';
-import {storeToRefs} from 'pinia';
+import { storeToRefs } from 'pinia';
import ExamInfo from '@/components/ExamInfo/index.vue';
-import {useExamStore} from '@/store/index.js';
+import { useExamStore } from '@/store/index.js';
const examStore = useExamStore();
-const {currentIndex,activeQuestion} = storeToRefs(examStore);
+const { currentType, currentIndex } = storeToRefs(examStore);
+
+const activeQuestion = ref(examStore.getActiveQuestion);
+
const answerClick = (item) => {
- if(item) {
+ if (item) {
// resetAnswer();
item.isActive = !item.isActive;
+ const answerList = filterAnswer();
+ examStore.setQuestionAnswer(currentType.value, currentIndex.value, answerList.join(','));
+
}
};
@@ -35,10 +41,10 @@
return {
active: item.isActive
};
-}
+};
-const resetAnswer = () => {
- activeQuestion.value.items.forEach(item => item.isActive = false);
+const filterAnswer = () => {
+ return activeQuestion.value.items.filter(item => item.isActive);
}
@@ -82,6 +88,7 @@
.active {
border-color: #409EFF !important;
+
.answer-icon {
color: #ffffff !important;
border-color: #409EFF !important;
--
Gitblit v1.8.0