mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamShowboard-Legacy.git
synced 2025-04-29 07:56:33 +00:00
commit
c73ab46e01
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -25,5 +25,6 @@
|
|||||||
"command": "extension.execute",
|
"command": "extension.execute",
|
||||||
"priority": 4
|
"priority": 4
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"Codegeex.RepoIndex": true
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# DSZ考试展板·改(指不定期对原项目修修补补)
|
# 考试展板(原DSZ考试展板)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -74,6 +74,8 @@
|
|||||||
|
|
||||||
## 开发
|
## 开发
|
||||||
|
|
||||||
|
### 环境要求
|
||||||
|
|
||||||
要在本地编译应用您需要安装以下负载和工具
|
要在本地编译应用您需要安装以下负载和工具
|
||||||
|
|
||||||
- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)
|
- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)
|
||||||
@ -82,6 +84,11 @@
|
|||||||
|
|
||||||
必须使用Yarn包管理。Node版本要求为20。
|
必须使用Yarn包管理。Node版本要求为20。
|
||||||
|
|
||||||
|
### 开发进度
|
||||||
|
|
||||||
|
- 在`main`分支上保留原作者`0.1.0`版本;
|
||||||
|
- 正在`dev`分支上开发`1.1-Malkuth`版本。
|
||||||
|
|
||||||
### Project Setup
|
### Project Setup
|
||||||
|
|
||||||
#### 安装
|
#### 安装
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "dsz-exam-showboard",
|
"name": "examshowboard",
|
||||||
"version": "0.1.0",
|
"version": "1.1.0",
|
||||||
"description": "An Electron application with Vue",
|
"description": "电子考试展示板",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "Hello8693 <hello8693@hello8693.xyz>",
|
"author": "Hello8693 <hello8693@hello8693.xyz>",
|
||||||
"homepage": "https://dsz.hello8693.xyz/",
|
"homepage": "https://dsz.hello8693.xyz/",
|
||||||
|
@ -1,46 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-system-bar class="position-fixed">
|
|
||||||
<v-icon icon="mdi-window-close" @click="ipcHandleExit"></v-icon>
|
|
||||||
<span class="ms-2">{{ currentTime }}</span>
|
|
||||||
</v-system-bar>
|
|
||||||
<v-app-bar :elevation="2" class="position-fixed">
|
<v-app-bar :elevation="2" class="position-fixed">
|
||||||
<v-app-bar-title>{{ profileStore.appHeader }}</v-app-bar-title>
|
<v-app-bar-title>{{ profileStore.appHeader }}</v-app-bar-title>
|
||||||
|
|
||||||
<template #append>
|
<template #append>
|
||||||
<div class="ga-4">
|
<div class="ga-4">
|
||||||
<v-btn @click="router.push('/mainWindow')">回到主页</v-btn>
|
<v-btn @click="router.push('/mainWindow')">回到主页</v-btn>
|
||||||
|
<v-icon icon="mdi-window-close" @click="ipcHandleExit"></v-icon>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useProfileStore } from '../stores/app';
|
import { useProfileStore } from '../stores/app';
|
||||||
|
|
||||||
const profileStore = useProfileStore();
|
const profileStore = useProfileStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const currentTime = ref(
|
|
||||||
new Date().toLocaleTimeString('en-US', {
|
|
||||||
hour: 'numeric',
|
|
||||||
minute: 'numeric',
|
|
||||||
hour12: false
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const updateTime = () => {
|
|
||||||
currentTime.value = new Date().toLocaleTimeString('en-US', {
|
|
||||||
hour: 'numeric',
|
|
||||||
minute: 'numeric',
|
|
||||||
hour12: false
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
const interval = setInterval(updateTime, 1000);
|
|
||||||
onUnmounted(() => clearInterval(interval));
|
|
||||||
});
|
|
||||||
|
|
||||||
const ipcHandleExit = () => window.electron.ipcRenderer.send('prog:exit');
|
const ipcHandleExit = () => window.electron.ipcRenderer.send('prog:exit');
|
||||||
</script>
|
</script>
|
||||||
|
@ -21,19 +21,45 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { useProfileStore } from '@renderer/stores/app';
|
import { useProfileStore } from '@renderer/stores/app';
|
||||||
import { getCurrentTimeSlot, getNextExamTimeSlot } from '@renderer/utils/subjectUtils';
|
import { getCurrentTimeSlot, getNextExamTimeSlot } from '@renderer/utils/subjectUtils';
|
||||||
|
|
||||||
const globalStore = useProfileStore();
|
const globalStore = useProfileStore();
|
||||||
|
const currentExam = ref(null);
|
||||||
|
let timeout = null;
|
||||||
|
|
||||||
getCurrentTimeSlot(globalStore.examInfos);
|
const updateCurrentExam = () => {
|
||||||
|
|
||||||
const currentExam = computed(() => {
|
|
||||||
const current = getCurrentTimeSlot(globalStore.examInfos);
|
const current = getCurrentTimeSlot(globalStore.examInfos);
|
||||||
if (current == null) {
|
currentExam.value = current ? current : getNextExamTimeSlot(globalStore.examInfos);
|
||||||
return getNextExamTimeSlot(globalStore.examInfos);
|
};
|
||||||
} else {
|
|
||||||
return current;
|
const scheduleNextUpdate = () => {
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextExam = getNextExamTimeSlot(globalStore.examInfos);
|
||||||
|
if (nextExam) {
|
||||||
|
const nextEndTime = new Date(nextExam.end).getTime();
|
||||||
|
const now = Date.now();
|
||||||
|
const delay = nextEndTime - now + 60000; // 下一次考试结束时间 + 1分钟
|
||||||
|
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
updateCurrentExam();
|
||||||
|
scheduleNextUpdate();
|
||||||
|
}, delay);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
updateCurrentExam();
|
||||||
|
scheduleNextUpdate();
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user