| | |
| | | examDetail.value = detail; |
| | | }; |
| | | |
| | | const setActiveQuestion = (detail) => { |
| | | activeQuestion.value = detail; |
| | | }; |
| | | |
| | | const setQuestionAnswer = (type, index, answer) => { |
| | | const temp = examDetail.value.find(item => item.questionType === type); |
| | | if(temp) { |
| | |
| | | getActiveQuestion, |
| | | setExamInfo, |
| | | setExamDetail, |
| | | setActiveQuestion, |
| | | setQuestionAnswer |
| | | }; |
| | | }); |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue'; |
| | | import { ref } from 'vue'; |
| | | import {storeToRefs} from 'pinia'; |
| | | import ExamInfo from '@/components/ExamInfo/index.vue'; |
| | | import {useExamStore} from '@/store/index.js'; |
| | | const examStore = useExamStore(); |
| | | |
| | | const {currentType,currentIndex,examDetail} = storeToRefs(examStore); |
| | | const {currentType,currentIndex} = storeToRefs(examStore); |
| | | |
| | | const activeQuestion = ref(examStore.getActiveQuestion); |
| | | |
| | |
| | | <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)" :class="itemClass(item,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)" :class="itemClass(question,item.questionType, index)"> |
| | | {{ index + 1 }} |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref } from 'vue'; |
| | | import { ref,watchEffect } from 'vue'; |
| | | import {storeToRefs} from 'pinia'; |
| | | import {useExamStore} from '@/store/index.js'; |
| | | const examStore = useExamStore(); |
| | | |
| | | const {examType, examDetail,currentType,currentIndex} = storeToRefs(examStore); |
| | | |
| | | const activeNames = ref(examDetail.value.map(item => item.questionType)); |
| | | |
| | | const itemClass = (question,type,index) => { |
| | | return { |
| | |
| | | } |
| | | } |
| | | |
| | | const activeNames = ref(examDetail.value.map(item => item.questionType)); |
| | | |
| | | const sheetClick = (type,index) => { |
| | | currentType.value = type; |
| | | currentIndex.value = index; |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |