Merge pull request #3 from MKStoler4096/dev

v1.1.1 开发合并
This commit is contained in:
MKStoler 2024-10-09 19:58:20 +08:00 committed by GitHub
commit d1e951d067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 78 additions and 22 deletions

View File

@ -86,7 +86,7 @@
### 开发进度
- `main`分支上保留原作者`0.1.0`版本;
- 正在`main`分支上维护`1.1.0`版本。
- 正在`dev`分支上开发`1.1-Malkuth`版本。
### Project Setup

View File

@ -5,6 +5,7 @@
<template #append>
<div class="ga-4">
<v-btn @click="router.push('/mainWindow')">回到主页</v-btn>
<v-btn @click="router.push('/about')">关于</v-btn>
<v-icon icon="mdi-window-close" @click="ipcHandleExit"></v-icon>
</div>
</template>

View File

@ -73,6 +73,7 @@ const headers = [
const formatTime = (isoString: string) => {
const date = new Date(isoString);
date.setSeconds(date.getSeconds() + 1); // 1
return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
};

View File

@ -11,6 +11,7 @@
考试状态: <span :class="statusColor">{{ statusText }}</span>
</div>
<div v-if="isWarning" class="text-h5 text--warning">考试即将结束</div>
<div v-if="showRemainingTime" class="text-h5 text--info">剩余时间: {{ remainingTime }}</div>
</v-card-text>
</v-card>
@ -69,6 +70,27 @@ const isWarning = computed(() => {
return now.value >= fifteenMinutesBeforeEnd && now.value < end;
});
const showRemainingTime = computed(() => {
if (!props.exam) return false;
const start = new Date(props.exam.start);
const end = new Date(props.exam.end);
const fifteenMinutesBeforeStart = new Date(start.getTime() - 15 * 60 * 1000);
return now.value >= fifteenMinutesBeforeStart && now.value < end;
});
const remainingTime = computed(() => {
if (!props.exam) return '';
const end = new Date(props.exam.end);
const timeDiff = end.getTime() - now.value.getTime();
const minutes = Math.floor(timeDiff / (1000 * 60));
const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
return `${minutes}${seconds}`;
});
// Update the current time every second
const updateNow = () => {
now.value = new Date();
@ -86,6 +108,10 @@ updateNow();
color: #ffc107 !important; /* Vuetify's default warning color */
}
.text--info {
color: #17a2b8 !important; /* Info color */
}
.status-before {
color: orange;
}

View File

@ -0,0 +1,47 @@
<template>
<v-container class="main-container" fill-height>
<v-row justify="center" align="center">
<v-col cols="12" md="8">
<v-card class="pa-4" outlined>
<v-card-title class="text-h4">关于考试展板</v-card-title>
<v-card-text>
<p>
欢迎来到考试展板应用程序这是一个用于展示考试信息的工具帮助考生更好地了解考试安排和状态
</p>
<p>本应用程序旨在为考生提供便捷的考试信息查看体验</p>
<p>版本号 1.1.0-Malkuth</p>
<p>开发者Hello8963 & Mkstoler4096</p>
<v-btn
href="https://github.com/MKStoler4096/dsz-exam-showboard-next"
target="_blank"
color="primary"
class="mt-4"
>
GitHub 上查看源代码
</v-btn>
</v-card-text>
</v-card>
</v-col>
</v-row>
</v-container>
</template>
<style scoped>
.main-container {
padding: 20px;
display: flex;
align-items: center;
}
.v-card {
width: 100%;
max-width: 600px;
margin: auto;
transition: transform 0.3s ease-in-out;
}
.v-card:hover {
transform: scale(1.05);
}
.v-btn {
height: 48px;
}
</style>

View File

@ -1,19 +0,0 @@
<template>
<div>
<h1>测试页面</h1>
<ExamStatus
:exam="{
name: '语文',
start: '2024-07-25T08:54:52.717Z',
end: '2024-07-25T08:55:40.428Z'
}"
/>
</div>
</template>
<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
//
</script>

View File

@ -4,7 +4,7 @@ import { defineStore } from 'pinia';
export const useProfileStore = defineStore('app', {
state: () => ({
examName: '考试名称',
appHeader: 'DSZ考试看板',
appHeader: '考试看板',
message: '考试提醒信息',
examInfos: []
}),

View File

@ -19,8 +19,8 @@ declare module 'vue-router/auto-routes' {
*/
export interface RouteNamedMap {
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
'/about': RouteRecordInfo<'/about', '/about', Record<never, never>, Record<never, never>>,
'/infoPage': RouteRecordInfo<'/infoPage', '/infoPage', Record<never, never>, Record<never, never>>,
'/mainWindow': RouteRecordInfo<'/mainWindow', '/mainWindow', Record<never, never>, Record<never, never>>,
'/testComponents': RouteRecordInfo<'/testComponents', '/testComponents', Record<never, never>, Record<never, never>>,
}
}