38 lines
1.0 KiB
Vue
38 lines
1.0 KiB
Vue
<template>
|
|
<div class="exam-view common-view">
|
|
<div class="view-header">
|
|
<div class="view-content">
|
|
<h2 class="view-title">考试中心</h2>
|
|
<p class="view-subtitle">模拟真实考试环境</p>
|
|
</div>
|
|
<el-button type="primary" :icon="Aim" @click="examClick">开始考试</el-button>
|
|
</div>
|
|
|
|
<question-list v-if="questionStore.questionList.length > 0"/>
|
|
|
|
<exam-dialog />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import QuestionList from '@/components/question/QuestionList.vue'
|
|
import ExamDialog from '@/components/exam/ExamDialog.vue'
|
|
import { Aim } from '@element-plus/icons-vue'
|
|
import { useExamStore } from '@/stores/exam.ts'
|
|
import { useQuestionStore } from '@/stores/question.ts'
|
|
import { onMounted } from 'vue'
|
|
|
|
const examStore = useExamStore()
|
|
const questionStore = useQuestionStore()
|
|
|
|
onMounted(() => {
|
|
questionStore.questionList = []
|
|
})
|
|
|
|
const examClick = () => {
|
|
questionStore.questionList = []
|
|
examStore.config = examStore.getEmptyConfig()
|
|
examStore.dialogVisible = true
|
|
}
|
|
</script>
|