fix(名字): 比赛成绩、全班情况、看板、题单、统计里的名字不再用真名,一律和排行榜一样显示 ks241XXX;导出成绩去掉姓名列
Deploy / deploy (push) Canceled after 0s

两个写法不同的 UserName 合成 shared/components/UserName.vue 一个。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-10 06:44:42 +08:00
1 parent 2bb74652a0
commit 0cee4ef779
10 files changed
+44 -88

No files matched your search

@@ -6,6 +6,7 @@ import { SubmissionStatus } from "utils/constants"
import { parseTime } from "utils/functions"
import StatusPill from "oj/submission/components/StatusPill.vue"
import { useTone } from "oj/submission/composables/tone"
import UserName from "shared/components/UserName.vue"
import AttemptSquares from "./AttemptSquares.vue"
/**
@@ -42,7 +43,6 @@ function isPending(result: number) {
interface Student {
username: string
name: string
/** 题号 → 这道题上的每一次,从早到晚 */
byProblem: Map<string, Attempt[]>
total: number
@@ -63,7 +63,6 @@ const students = computed<Student[]>(() => {
}
return {
username: row.username,
name: row.realName || row.username,
byProblem,
total: row.submissions.length,
accepted: row.submissions.filter((item) => isAc(item.result)).length,
@@ -76,7 +75,6 @@ const students = computed<Student[]>(() => {
if (seen.has(row.username)) continue
list.push({
username: row.username,
name: row.realName || row.username,
byProblem: new Map(),
total: 0,
accepted: 0,
@@ -168,7 +166,7 @@ const problemStudents = computed(() => {
(a, b) =>
rank(a) - rank(b) ||
b.items.length - a.items.length ||
a.student.name.localeCompare(b.student.name, "zh-CN"),
a.student.username.localeCompare(b.student.username, "zh-CN"),
)
})
@@ -188,7 +186,7 @@ const allStudents = computed(() => {
(a, b) =>
rank(a) - rank(b) ||
b.student.total - a.student.total ||
a.student.name.localeCompare(b.student.name, "zh-CN"),
a.student.username.localeCompare(b.student.username, "zh-CN"),
)
})
@@ -326,7 +324,7 @@ function pct(done: number, total: number) {
</div>
<div class="rows">
<div v-for="row in problemStudents" :key="row.student.username" class="row">
<span class="c-name name" :title="row.student.username">{{ row.student.name }}</span>
<UserName :username="row.student.username" class="c-name" />
<span class="c-last">
<StatusPill v-if="row.items.length" :result="row.items.at(-1)!.result" />
<b v-else class="none" :style="{ color: tone('error').color }">没交</b>
@@ -369,7 +367,7 @@ function pct(done: number, total: number) {
:width="12"
/>
</span>
<span class="c-name name" :title="row.student.username">{{ row.student.name }}</span>
<UserName :username="row.student.username" class="c-name" />
<span
class="c-done done"
:style="{
@@ -691,13 +689,6 @@ function pct(done: number, total: number) {
white-space: nowrap;
}
.name {
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.done {
font-weight: 600;
font-variant-numeric: tabular-nums;
@@ -21,6 +21,7 @@ import { FLOWCHART_CRITERIA_ORDER } from "utils/constants"
import { useTone } from "oj/submission/composables/tone"
import RingChart from "./RingChart.vue"
import StatItem from "./StatItem.vue"
import UserName from "shared/components/UserName.vue"
ChartJS.register(
ArcElement,
@@ -198,14 +199,12 @@ onUnmounted(() => cloud?.destroy())
const people = computed(() => [
...props.data.dataUnaccepted.map((row) => ({
username: row.username,
name: row.realName,
grade: null as string | null,
score: null as number | null,
count: 0,
})),
...props.data.people.map((row) => ({
username: row.username,
name: row.realName,
grade: row.bestGrade,
score: row.bestScore,
count: row.count,
@@ -290,7 +289,7 @@ function gradeStyle(grade: string | null) {
<div v-if="data.peopleTruncated" class="muted">人太多,只列了成绩靠后的 500 位</div>
<div class="people-list">
<div v-for="row in people" :key="row.username" class="person">
<b class="p-name" :title="row.username">{{ row.name }}</b>
<UserName :username="row.username" class="p-name" />
<span class="grade-pill" :style="gradeStyle(row.grade)">
{{ row.grade ? `${row.grade} 级 ${row.score ?? 0} 分` : "没交" }}
</span>
@@ -421,11 +420,8 @@ function gradeStyle(grade: string | null) {
}
.p-name {
width: 80px;
width: 110px;
flex: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.grade-pill {