|
@@ -13,7 +13,7 @@
|
|
></base-select>
|
|
></base-select>
|
|
<div :class="{ 'm-t-super-large': !isCreate }">
|
|
<div :class="{ 'm-t-super-large': !isCreate }">
|
|
<confirm-button
|
|
<confirm-button
|
|
- :loading="loading || checkLoading"
|
|
|
|
|
|
+ :loading="loading"
|
|
:ok-text="isCreate ? '创建考试' : '确定'"
|
|
:ok-text="isCreate ? '创建考试' : '确定'"
|
|
cancel-text="退出"
|
|
cancel-text="退出"
|
|
@confirm="joinOrCreateExam(isCreate)"
|
|
@confirm="joinOrCreateExam(isCreate)"
|
|
@@ -30,6 +30,7 @@ import { ref, computed } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
import { logout } from '@/utils/shared'
|
|
import { logout } from '@/utils/shared'
|
|
|
|
+import { sessionStorage } from '@/plugins/storage'
|
|
import useFetch from '@/hooks/useFetch'
|
|
import useFetch from '@/hooks/useFetch'
|
|
import useMainStore from '@/store/main'
|
|
import useMainStore from '@/store/main'
|
|
import BaseSelect from '@/components/element/BaseSelect.vue'
|
|
import BaseSelect from '@/components/element/BaseSelect.vue'
|
|
@@ -41,7 +42,7 @@ const mainStore = useMainStore()
|
|
const examId = ref<number>()
|
|
const examId = ref<number>()
|
|
|
|
|
|
const { result, loading, fetch } = useFetch('getExamList')
|
|
const { result, loading, fetch } = useFetch('getExamList')
|
|
-const { fetch: checkExam, loading: checkLoading } = useFetch('checkExam')
|
|
|
|
|
|
+// const { fetch: checkExam, loading: checkLoading } = useFetch('checkExam')
|
|
|
|
|
|
const examList = computed(() => {
|
|
const examList = computed(() => {
|
|
return result.value?.result?.map((exam) => ({ ...exam, value: exam.id, label: exam.name })) || []
|
|
return result.value?.result?.map((exam) => ({ ...exam, value: exam.id, label: exam.name })) || []
|
|
@@ -65,7 +66,8 @@ async function joinOrCreateExam(isCreate: boolean) {
|
|
replace({ name: 'InitCreateExam' })
|
|
replace({ name: 'InitCreateExam' })
|
|
} else {
|
|
} else {
|
|
if (examId.value) {
|
|
if (examId.value) {
|
|
- await checkExam({ examId: examId.value })
|
|
|
|
|
|
+ // await checkExam({ examId: examId.value })
|
|
|
|
+ sessionStorage.set('EXAM_ID', examId.value)
|
|
} else {
|
|
} else {
|
|
ElMessage.error(`请选择一个考试批次`)
|
|
ElMessage.error(`请选择一个考试批次`)
|
|
}
|
|
}
|