Merge pull request #40 from ProjectCampus-CH/dev

小修
This commit is contained in:
MKStoler 2024-12-04 16:02:06 +08:00 committed by GitHub
commit c8b14f8896
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 52 additions and 45 deletions

View File

@ -87,4 +87,4 @@ body:
description: 回顾您的回答
options:
- label: 我认为上述的描述已经足以详细,以允许开发人员能复现该问题。如果我的 issue 没有按照上述的要求填写,可能会被无条件关闭。
required: true
required: true

View File

@ -4,6 +4,7 @@ on:
push:
branches:
- master
- dev
jobs:
build:

View File

@ -1,17 +1,17 @@
on:
push:
branches:
- master
push:
branches:
- master
jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
permissions:
contents: write
pull-requests: write
steps:
- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
permissions:
contents: write
pull-requests: write
steps:
- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -24,12 +24,11 @@
一款显示当前时间与考试详细信息的看板类软件
| 下载 | [Releases](https://github.com/ProjectCampus-CH/dsz-exam-showboard-next/releases) | [Actions](https://github.com/ProjectCampus-CH/dsz-exam-showboard-next/actions) |
| - | - | - |
| ---- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
</div>
> [!tip]
> **本软件使用 `Vue` + `TypeScript` + `JavaScript` 制作,使用 `Node.js` + `Electron` 完善系统级功能并打包。**
> [!tip] > **本软件使用 `Vue` + `TypeScript` + `JavaScript` 制作,使用 `Node.js` + `Electron` 完善系统级功能并打包。**
## 功能
@ -74,7 +73,7 @@
> [!tip]
>
> `message``room` 为选填
>
>
> 如果有两个以"/"分隔的科目可以自动转化为双行显示
- 打开软件,进入起始页面,点击 `打开配置` 按钮,选择配置文件
@ -87,9 +86,9 @@
>
> 可以在 `Raw 文件` 前加上镜像源,如
>
>```
>https://github.moeyy.xyz/https://raw.githubusercontent.com/{owner}/{repo}/refs/heads/main/exam_config.json
>```
> ```
> https://github.moeyy.xyz/https://raw.githubusercontent.com/{owner}/{repo}/refs/heads/main/exam_config.json
> ```
- 点击`请求配置`加载配置文件并进入看板(下次可直接点击`直接进入看板`加载上次配置文件)
@ -111,10 +110,9 @@
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
> [!Caution]
>
>
> **必须使用 Yarn 包管理。Node 版本要求为20。**
### 工程构建
#### 配置
@ -202,7 +200,6 @@ $ yarn build:linux
## Stars 历史
<div align="center">
[![Star 历史](https://starchart.cc/ProjectCampus-CH/dsz-exam-showboard-next.svg?variant=adaptive)](https://starchart.cc/ProjectCampus-CH/dsz-exam-showboard-next/stargazers)

View File

@ -1,6 +1,6 @@
{
"name": "examshowboard",
"version": "1.2.0",
"version": "1.2.2",
"description": "电子考试展示板",
"main": "./out/main/index.js",
"author": "Hello8693&MKStoler <hello8693@hello8693.xyz>",

View File

@ -14,7 +14,7 @@
<template #item="{ item }">
<tr :style="{ lineHeight: item.name.includes('/') ? '2.5rem' : '2.0rem' }">
<td v-if="item.showDate" class="text-h5 date-column" :rowspan="item.rowspan">
{{ item.date }}<br>{{ item.period }}
{{ item.date }}<br />{{ item.period }}
</td>
<td class="text-h5 subject-column">
<div v-if="item.name.includes('/')">
@ -80,9 +80,10 @@ const groupedExams = computed(() => {
let currentDate = '';
let currentPeriod = '';
sortedExams.value.forEach((exam, index) => {
const examDate = new Date(exam.start)
.toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' })
.replace('/', '月') + '日';
const examDate =
new Date(exam.start)
.toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' })
.replace('/', '月') + '日';
const period = formatPeriod(exam.start);
const showDate = examDate !== currentDate || period !== currentPeriod;
if (showDate) {
@ -92,8 +93,9 @@ const groupedExams = computed(() => {
(e) =>
new Date(e.start)
.toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' })
.replace('/', '月') + '日' === currentDate &&
formatPeriod(e.start) === currentPeriod
.replace('/', '月') +
'日' ===
currentDate && formatPeriod(e.start) === currentPeriod
).length;
grouped.push({ ...exam, date: examDate, period, showDate, rowspan });
} else {
@ -201,4 +203,4 @@ onMounted(() => {
.status-column {
width: 60px;
}
</style>
</style>

View File

@ -10,9 +10,11 @@
<div class="text-h5 line-item">
考试状态: <span :class="statusColor">{{ statusText }}</span>
</div>
<div v-if="showCountdown" class="text-h5 text--info line-item">开考倒计时: {{ countdown }}</div>
<div v-if="showCountdown" class="text-h5 text--info line-item">
开考倒计时: {{ countdown }}
</div>
<div v-if="showRemainingTime" :class="['text-h5', remainingTimeColorClass, 'line-item']">
考试剩余时间: {{ remainingTime }}
剩余时间: {{ remainingTime }}
</div>
</v-card-text>
</v-card>
@ -53,7 +55,7 @@ const statusColor = computed(() => {
});
const statusText = computed(() => {
if (!props.exam) return '考试已结束';
if (!props.exam) return '全部考试已结束';
const start = new Date(props.exam.start);
const end = new Date(props.exam.end);
@ -110,7 +112,9 @@ const remainingTimeColorClass = computed(() => {
const end = new Date(props.exam.end);
const fifteenMinutesBeforeEnd = new Date(end.getTime() - 15 * 60 * 1000);
return now.value >= fifteenMinutesBeforeEnd && now.value < end ? 'text--warning' : 'text--default';
return now.value >= fifteenMinutesBeforeEnd && now.value < end
? 'text--warning'
: 'text--default';
});
// Update the current time every second
@ -166,4 +170,4 @@ updateNow();
.text-center {
text-align: center;
}
</style>
</style>

View File

@ -11,9 +11,13 @@
<p class="text-lg">本软件旨在为考生提供便捷的考试信息查看体验</p>
<p class="text-lg developer">
开发者
<a href="https://github.com/hello8693DSZ" target="_blank" class="developer-name">Hello8963</a>
<a href="https://github.com/hello8693DSZ" target="_blank" class="developer-name"
>Hello8963</a
>
<span> </span>
<a href="https://github.com/MKStoler4096" target="_blank" class="developer-name">Mkstoler4096</a>
<a href="https://github.com/MKStoler4096" target="_blank" class="developer-name"
>Mkstoler4096</a
>
</p>
<v-btn
href="https://github.com/ProjectCampus-CH/dsz-exam-showboard-next"
@ -82,4 +86,4 @@
.developer-name:hover {
text-decoration: underline;
}
</style>
</style>

View File

@ -78,7 +78,7 @@ onUnmounted(() => {
}
.medium-title {
font-size: 2.0em;
font-size: 2em;
color: gray;
text-align: left;
}
@ -87,5 +87,4 @@ onUnmounted(() => {
font-size: 3em;
text-align: right;
}
</style>
</style>

View File

@ -6,7 +6,7 @@ export const useProfileStore = defineStore('app', {
examName: '考试名称',
appHeader: '考试看板',
message: '考试提醒信息',
room: '考场号',
room: ' ',
examInfos: []
}),
persist: true