From 6ab6b35fe3ac1ce90711e3555b19dde8ce1e21dc Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期三, 26 六月 2024 17:43:12 +0800 Subject: [PATCH] feat:对接考试 --- src/views/exam-list/data-list/index.vue | 32 +++++++++++++++++++++++++------- 1 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/views/exam-list/data-list/index.vue b/src/views/exam-list/data-list/index.vue index 28a0d1d..12feff2 100644 --- a/src/views/exam-list/data-list/index.vue +++ b/src/views/exam-list/data-list/index.vue @@ -5,7 +5,7 @@ <div class="item flex justify-between items-center"> <div class="left-container flex flex-col justify-between"> <div class="top-container flex items-center"> - <div class="title mr-5 text-xl font-bold">{{ item.name }}</div> + <div class="title mr-5 text-xl font-bold">{{ item.examName }}</div> <div class="tag"> <el-tag :type="stateList[item.status].type" effect="light" round> {{ stateList[item.status].text }} @@ -20,7 +20,7 @@ 鑰冭瘯鏃堕棿: {{ item.startTime }} ~ {{ item.endTime }} </div> </div> - <div class="bottom-container flex text-sm text-gray-400"> + <!-- <div class="bottom-container flex text-sm text-gray-400"> <div class="bottom-item"> 鎬诲垎: {{ item.examScore }} </div> @@ -30,11 +30,12 @@ <div class="bottom-item"> 绛旈鏃堕棿: {{ item.examTime }}鍒嗛挓 </div> - </div> + </div> --> </div> <div class="right-container"> <div class="button-container"> - <el-button type="primary" size="large" @click="examClick" :disabled="stateList[item.status].disabled">寮�濮嬭�冭瘯</el-button> + <el-button type="primary" size="large" @click="examClick(item)" + :disabled="stateList[item.status].disabled">寮�濮嬭�冭瘯</el-button> </div> </div> </div> @@ -47,6 +48,11 @@ import { ref } from 'vue'; import { Timer } from '@element-plus/icons-vue'; import { useRouter } from 'vue-router'; +import { useExamStore } from '@/store/index.js'; +import { getExamInfo } from '@/api/modules/exam.js'; +const examStore = useExamStore(); + + const router = useRouter(); const props = defineProps({ @@ -62,7 +68,7 @@ type: 'primary', disabled: true }, - 2: { + 'ing': { text: '杩涜涓�', type: 'success', disabled: false @@ -74,8 +80,20 @@ } }; -const examClick = () => { - router.push('/exam'); +const examClick = (exam) => { + console.log(exam); + getExamInfo(exam.id).then((res) => { + examStore.setExamInfo({ + examName: exam.examName + }); + examStore.setExamDetail(res.data); + // examStore.setExamInfo(res.data.examInfo); + // examStore.setExamDetail(res.data.examQuestionList); + // examStore.initExam(); + router.push('/exam'); + }).catch(err => { + + }); } </script> -- Gitblit v1.8.0