From 204d2a822b78caac40fa7bb394910a21aa0b96c2 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 24 七月 2024 15:43:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/exam/components/answer-time/index.vue | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/src/views/exam/components/answer-time/index.vue b/src/views/exam/components/answer-time/index.vue
index b37e18b..67ac431 100644
--- a/src/views/exam/components/answer-time/index.vue
+++ b/src/views/exam/components/answer-time/index.vue
@@ -1,16 +1,34 @@
<template>
- <div class="time-container flex justify-center text-white items-center shadow-md">
+ <div
+ class="time-container flex justify-center text-white items-center shadow-md"
+ >
<el-icon class="mr-1 text-xl" size="24"><Timer /></el-icon>
<div class="label mr-1">鍓╀綑鏃堕棿:</div>
- <el-countdown :value="time" />
+ <el-countdown :value="time" @finish="timeFinish" />
</div>
</template>
<script setup>
-import {ref} from 'vue';
-import { Timer } from '@element-plus/icons-vue';
+import { ref, defineExpose } from "vue";
+import dayjs from "dayjs";
+import { storeToRefs } from "pinia";
+import { Timer } from "@element-plus/icons-vue";
+import { useExamStore } from "@/store/index.js";
-const time = ref(1000);
+const examStore = useExamStore();
+const { examInfo } = storeToRefs(examStore);
+
+const emit = defineEmits(["timeOut"]);
+
+const time = ref(dayjs().valueOf() + examInfo.value.suggestTime * 1000 * 60);
+
+const timeFinish = () => {
+ emit("timeOut");
+};
+const addTime = (data) => {
+ time.value = time.value + data * 1000;
+};
+defineExpose({ addTime });
</script>
<style lang="scss" scoped>
@@ -19,10 +37,9 @@
border-radius: 100px;
padding: 10px 0;
background-color: rgba($color: #86d7f7, $alpha: 0.3);
-
}
:deep(.el-statistic__number) {
color: #ffffff;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0