feat:更新考试记录功能
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import type { IExamConfig } from '@/types/exam.ts'
|
||||
import type { IExamConfig, IExamRecord } from '@/types/exam.ts'
|
||||
import { addExamRecordApi } from '@/apis/exam.ts'
|
||||
|
||||
export const useExamStore = defineStore('exam', {
|
||||
state: () => ({
|
||||
hasStart: false,
|
||||
hasSubmit: false,
|
||||
dialogVisible: false,
|
||||
config: {} as IExamConfig
|
||||
config: {} as IExamConfig,
|
||||
currentRecord: {} as IExamRecord
|
||||
}),
|
||||
actions: {
|
||||
getEmptyConfig(): IExamConfig {
|
||||
@@ -14,6 +14,9 @@ export const useExamStore = defineStore('exam', {
|
||||
subject: '',
|
||||
total: 50
|
||||
}
|
||||
},
|
||||
async addRecord() {
|
||||
await addExamRecordApi(this.currentRecord)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user