feat:更新考试记录功能

This commit is contained in:
2026-08-03 22:43:32 +08:00
parent 7ae51438f4
commit 69a5ab4851
8 changed files with 75 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
<template>
<el-dialog v-model="examStore.dialogVisible" title="考试配置" width="30%" center destroy-on-close>
<el-dialog v-model="examStore.dialogVisible" title="考试配置"
:width="appStore.isMobile ? '80%' : '30%'" center destroy-on-close>
<el-form ref="examFormRef" :model="examStore.config" :rules="rules" label-width="auto">
<el-form-item label="考试学科" prop="subject">
<el-select
@@ -34,11 +35,13 @@ import { ElInputNumber, ElLoading, ElMessage, ElOption, ElSelect, type FormInsta
import { useExamStore } from '@/stores/exam.ts'
import { useLibraryStore } from '@/stores/library.ts'
import { useQuestionStore } from '@/stores/question.ts'
import { useAppStore } from '@/stores/app.ts'
import { computed, ref } from 'vue'
const examStore = useExamStore()
const libraryStore = useLibraryStore()
const questionStore = useQuestionStore()
const appStore = useAppStore()
const examFormRef = ref<FormInstance>()
@@ -59,6 +62,7 @@ const confirmClick = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate(async (valid, fields) => {
if (valid) {
questionStore.type = 'Exam'
await generateExam()
} else {
ElMessage.error('请先输入信息')