ZhangXianQiang
2024-06-18 8c7361e8803a4a52cb1144dec576f01085d2a297
fix:修改多选题问题
2个文件已修改
14 ■■■■ 已修改文件
src/views/exam/components/answer-main/answer-single/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/components/answer-sheet/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/components/answer-main/answer-single/index.vue
@@ -22,11 +22,13 @@
import {useExamStore} from '@/store/index.js';
const examStore = useExamStore();
const {currentIndex,activeQuestion} = storeToRefs(examStore);
const {currentType,currentIndex,activeQuestion,examDetail} = storeToRefs(examStore);
const answerClick = (item) => {
  if(item) {
    resetAnswer();
    item.isActive = true
    item.isActive = true;
  }
};
@@ -40,6 +42,9 @@
  activeQuestion.value.items.forEach(item => item.isActive = false);
}
const filterExam = () => {
}
</script>
src/views/exam/components/answer-sheet/index.vue
@@ -5,7 +5,7 @@
        <template v-for="item in examDetail">
          <el-collapse-item :title="examType[item.questionType]" :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,question)" :class="itemClass(item.questionType, index)">
              <div class="sheet-item cursor-pointer flex justify-center items-center" v-for="question,index in item.questionList" @click="sheetClick(item.questionType,index,question)" :class="itemClass(item,item.questionType, index)">
                {{ index + 1 }}
              </div>
            </div>
@@ -24,8 +24,9 @@
const {examType, examDetail,currentType,currentIndex} = storeToRefs(examStore);
const itemClass = (type,index) => {
const itemClass = (question,type,index) => {
  return {
    answer: question.correct,
    active: currentType.value === type && currentIndex.value === index
  }
}