From d2fc22d5f2b0f095b4c49c618ef03ae2f0f41b5d Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 21 十月 2024 11:21:36 +0800
Subject: [PATCH] 江西空管发版
---
src/views/exam-list/data-list/index.vue | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 101 insertions(+), 2 deletions(-)
diff --git a/src/views/exam-list/data-list/index.vue b/src/views/exam-list/data-list/index.vue
index 239f314..dcf1a5d 100644
--- a/src/views/exam-list/data-list/index.vue
+++ b/src/views/exam-list/data-list/index.vue
@@ -1,15 +1,114 @@
<template>
<div class="list-container w-full h-full">
<el-scrollbar>
-
+ <el-card shadow="hover" class="mb-3" v-for="item in props.dataList">
+ <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.examName }}</div>
+ <div class="tag">
+ <el-tag :type="stateList[item.status].type" effect="light" round>
+ {{ stateList[item.status].text }}
+ </el-tag>
+ </div>
+ </div>
+ <div class="mid-container flex items-center my-4 text-gray-700">
+ <el-icon class="mr-1">
+ <Timer />
+ </el-icon>
+ <div class="time">
+ 鑰冭瘯鏃堕棿: {{ item.startTime }} ~ {{ item.endTime }}
+ </div>
+ </div>
+ <!-- <div class="bottom-container flex text-sm text-gray-400">
+ <div class="bottom-item">
+ 鎬诲垎: {{ item.examScore }}
+ </div>
+ <div class="bottom-item">
+ 棰樻暟: {{ item.examTotal }}
+ </div>
+ <div class="bottom-item">
+ 绛旈鏃堕棿: {{ item.examTime }}鍒嗛挓
+ </div>
+ </div> -->
+ </div>
+ <div class="right-container">
+ <div class="button-container">
+ <el-button type="primary" size="large" @click="examClick(item)"
+ :disabled="stateList[item.status].disabled">寮�濮嬭�冭瘯</el-button>
+ </div>
+ </div>
+ </div>
+ </el-card>
</el-scrollbar>
</div>
</template>
<script setup>
+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({
+ dataList: {
+ type: Array,
+ default: () => []
+ }
+});
+
+const stateList = {
+ 'not_start': {
+ text: '鏈紑濮�',
+ type: 'primary',
+ disabled: true
+ },
+ 'ing': {
+ text: '杩涜涓�',
+ type: 'success',
+ disabled: false
+ },
+ 'finished': {
+ text: '宸茬粨鏉�',
+ type: 'info',
+ disabled: true
+ },
+ 'cancel': {
+ text: '宸蹭綔搴�',
+ type: 'danger',
+ disabled: true
+ }
+};
+
+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 => {
+
+ });
+}
</script>
<style lang="scss" scoped>
+.item {
+ width: 100%;
+ min-height: 120px;
+}
-</style>
\ No newline at end of file
+.bottom-item {
+ margin-right: 30px;
+}
+</style>
--
Gitblit v1.8.0