From 517ada59580a84035d2373034f7b77c0bdf044c5 Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期一, 11 十一月 2024 15:33:05 +0800
Subject: [PATCH] 错题本分页
---
src/views/exam-list/data-list/index.vue | 40 +++++++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/src/views/exam-list/data-list/index.vue b/src/views/exam-list/data-list/index.vue
index 47c3163..c4d9735 100644
--- a/src/views/exam-list/data-list/index.vue
+++ b/src/views/exam-list/data-list/index.vue
@@ -5,12 +5,13 @@
<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 }}
</el-tag>
</div>
+ <div v-if="!item.isContinue" style="margin-left: 15px">鎮ㄥ凡鎻愪氦璇曞嵎</div>
</div>
<div class="mid-container flex items-center my-4 text-gray-700">
<el-icon class="mr-1">
@@ -20,7 +21,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,12 +31,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 || !item.isContinue">寮�濮嬭�冭瘯</el-button>
</div>
</div>
</div>
@@ -52,7 +53,6 @@
import { getExamInfo } from '@/api/modules/exam.js';
const examStore = useExamStore();
-
const router = useRouter();
const props = defineProps({
@@ -63,28 +63,38 @@
});
const stateList = {
- 1: {
+ 'not_start': {
text: '鏈紑濮�',
type: 'primary',
disabled: true
},
- 2: {
+ 'ing': {
text: '杩涜涓�',
type: 'success',
disabled: false
},
- 3: {
+ 'finished': {
text: '宸茬粨鏉�',
type: 'info',
+ disabled: true
+ },
+ 'cancel': {
+ text: '宸蹭綔搴�',
+ type: 'danger',
disabled: true
}
};
-const examClick = () => {
- getExamInfo().then((res) => {
- examStore.setExamInfo(res.data.examInfo);
- examStore.setExamDetail(res.data.examQuestionList);
- examStore.initExam();
+const examClick = (exam) => {
+ console.log(exam);
+ getExamInfo(exam.id).then((res) => {
+ examStore.setExamInfo({
+ id: res.data.id,
+ examName: res.data.examName,
+ suggestTime: res.data.suggestTime,
+ });
+ examStore.setExamDetail(res.data.titleList);
+ examStore.initExam(res.data.titleList[0].questionType);
router.push('/exam');
}).catch(err => {
@@ -102,4 +112,4 @@
.bottom-item {
margin-right: 30px;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0