feat: 学时按历史统计时在首页说明差异

This commit is contained in:
Nixevol
2026-11-19 02:15:52 +08:00
parent 82d907fe58
commit 28f424f2d3
2 changed files with 21 additions and 1 deletions
+5
View File
@@ -18,6 +18,7 @@ interface HomeSummary {
total_hours: string; total_hours: string;
total_score: string; total_score: string;
points: string | number | null; points: string | number | null;
hours_source: "api" | "history";
limited?: boolean; limited?: boolean;
} }
@@ -158,6 +159,8 @@ function withMinutes(value: string) {
return `${value} 分钟`; return `${value} 分钟`;
} }
const historyHoursNote = "由于Euniv学时统计缺陷/统计延后,本系统已开启采用当月学习历史统计本月学时,可能会导致本系统中显示的本月学时与Euniv官方网站不一样。";
const facts = computed(() => { const facts = computed(() => {
const current = summary.value; const current = summary.value;
return [ return [
@@ -187,6 +190,7 @@ function asSummary(value: unknown): HomeSummary | null {
total_hours: String(text("total_hours") ?? ""), total_hours: String(text("total_hours") ?? ""),
total_score: String(text("total_score") ?? ""), total_score: String(text("total_score") ?? ""),
points: typeof row.points === "number" || typeof row.points === "string" ? row.points : null, points: typeof row.points === "number" || typeof row.points === "string" ? row.points : null,
hours_source: row.hours_source === "history" ? "history" : "api",
limited: row.limited === true, limited: row.limited === true,
}; };
} }
@@ -990,6 +994,7 @@ onUnmounted(() => {
<div class="spin" role="status" aria-label="正在获取"></div> <div class="spin" role="status" aria-label="正在获取"></div>
</div> </div>
</div> </div>
<p v-if="summary?.hours_source === 'history'" class="hours-source-note">{{ historyHoursNote }}</p>
<n-tooltip placement="bottom"> <n-tooltip placement="bottom">
<template #trigger> <template #trigger>
<n-button <n-button
+16 -1
View File
@@ -587,6 +587,7 @@ select {
.home-top { .home-top {
display: flex; display: flex;
flex-wrap: wrap;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
gap: 12px; gap: 12px;
@@ -594,7 +595,16 @@ select {
.home-top-main { .home-top-main {
min-width: 0; min-width: 0;
flex: 1; flex: 0 1 auto;
}
.hours-source-note {
flex: 1 1 240px;
margin: 2px 0 0;
color: var(--muted);
font-size: 12px;
line-height: 1.55;
text-align: right;
} }
.home-refresh.n-button { .home-refresh.n-button {
@@ -1433,6 +1443,11 @@ select {
grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-columns: repeat(3, minmax(0, 1fr));
} }
.hours-source-note {
flex-basis: 100%;
text-align: left;
}
.history-facts { .history-facts {
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
} }