feat: 学时按历史统计时在首页说明差异
This commit is contained in:
@@ -18,6 +18,7 @@ interface HomeSummary {
|
||||
total_hours: string;
|
||||
total_score: string;
|
||||
points: string | number | null;
|
||||
hours_source: "api" | "history";
|
||||
limited?: boolean;
|
||||
}
|
||||
|
||||
@@ -158,6 +159,8 @@ function withMinutes(value: string) {
|
||||
return `${value} 分钟`;
|
||||
}
|
||||
|
||||
const historyHoursNote = "由于Euniv学时统计缺陷/统计延后,本系统已开启采用当月学习历史统计本月学时,可能会导致本系统中显示的本月学时与Euniv官方网站不一样。";
|
||||
|
||||
const facts = computed(() => {
|
||||
const current = summary.value;
|
||||
return [
|
||||
@@ -187,6 +190,7 @@ function asSummary(value: unknown): HomeSummary | null {
|
||||
total_hours: String(text("total_hours") ?? ""),
|
||||
total_score: String(text("total_score") ?? ""),
|
||||
points: typeof row.points === "number" || typeof row.points === "string" ? row.points : null,
|
||||
hours_source: row.hours_source === "history" ? "history" : "api",
|
||||
limited: row.limited === true,
|
||||
};
|
||||
}
|
||||
@@ -990,6 +994,7 @@ onUnmounted(() => {
|
||||
<div class="spin" role="status" aria-label="正在获取"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="summary?.hours_source === 'history'" class="hours-source-note">{{ historyHoursNote }}</p>
|
||||
<n-tooltip placement="bottom">
|
||||
<template #trigger>
|
||||
<n-button
|
||||
|
||||
+16
-1
@@ -587,6 +587,7 @@ select {
|
||||
|
||||
.home-top {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
@@ -594,7 +595,16 @@ select {
|
||||
|
||||
.home-top-main {
|
||||
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 {
|
||||
@@ -1433,6 +1443,11 @@ select {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.hours-source-note {
|
||||
flex-basis: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.history-facts {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user