style(名字): 名字列按去掉 ks 前缀后的长度收窄,不再留一大块空
Deploy / deploy (push) Canceled after 0s

原来的定宽是按 ks2312李鑫楠 定的(110~170px),现在名字最长 4 个字(在读的班 423 人里 5 人)。
只放名字的列收到 80px 左右;混着几个班、名字后面还有班号的(全部提交、全服 / 年级排名、
卡点分析没选班时)108px,最宽的「翁鑫叶炫 2312」95px 也放得下。改了提交列表、排名赛道和周榜、
比赛排名和成绩、题单全班情况、数据统计、后台自学情况和卡点分析、请假名单

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-11-02 23:51:28 +08:00
1 parent dbb265b02f
commit 959c326bc9
14 files changed
+46 -22

No files matched your search

+3 -2
View File
@@ -267,8 +267,9 @@ function exportGrades() {
const success = computed(() => tone('success'))
const danger = computed(() => tone('error'))
const warning = computed(() => tone('warning'))
const liveColumns = computed(() => `130px 48px repeat(${problems.value.length}, minmax(70px, 96px)) 90px 1fr`)
const gradeColumns = computed(() => `24px 124px 40px 36px repeat(${problems.value.length}, 50px)`)
// 名字列只放名字,最长 4 个字(2026-11 去掉 ks 前缀之前是按 ks2312李鑫楠 定的宽)
const liveColumns = computed(() => `88px 48px repeat(${problems.value.length}, minmax(70px, 96px)) 90px 1fr`)
const gradeColumns = computed(() => `24px 88px 40px 36px repeat(${problems.value.length}, 50px)`)
</script>
<template>
+2 -1
View File
@@ -91,7 +91,8 @@ const narrow = useMediaQuery('(max-width: 640px)')
const columns = computed(() => {
const move = running.value ? '36px ' : ''
const count = problems.value.length
return narrow.value ? `28px ${move}112px 36px 70px repeat(${count}, 52px)` : `40px ${move}170px 48px 80px repeat(${count}, 64px)`
// 名字列:名字最长 4 个字(2026-11 去掉 ks 前缀之前是按 ks2312李鑫楠 定的宽)
return narrow.value ? `28px ${move}76px 36px 70px repeat(${count}, 52px)` : `40px ${move}96px 48px 80px repeat(${count}, 64px)`
})
</script>
@@ -51,7 +51,8 @@ const average = computed(() => (joined.value.length ? joined.value.reduce((sum,
const finished = computed(() => joined.value.filter((s) => data.value && s.completedCount >= data.value.totalCount).length)
const beforeCount = computed(() => joined.value.reduce((sum, s) => sum + s.cells.filter((cell) => cell.solvedBefore).length, 0))
const columns = computed(() => `22px 110px 44px repeat(${data.value?.problems.length ?? 1}, minmax(72px, 1fr))`)
// 名字列最长 4 个字(2026-11 去掉 ks 前缀之前是按 ks2312李鑫楠 定的宽)
const columns = computed(() => `22px 80px 44px repeat(${data.value?.problems.length ?? 1}, minmax(72px, 1fr))`)
function cellLink(username: string, problemId: string) {
return `/submission?username=${encodeURIComponent(username)}&problem=${encodeURIComponent(problemId)}`
@@ -212,8 +212,8 @@ function onMenu(key: string, row: RankRow) {
<div class="lane">
<span class="rank">{{ item.row.solved ? item.row.rank : '—' }}</span>
<RankAvatar :username="item.row.user.username" :avatar="item.row.avatar" :size="20" :me="item.row.user.id === meId" />
<button class="who" @click="emit('open', item.row.user.username)">
<UserName :username="item.row.user.username" :class-name="showClass ? item.row.className : null" />
<button class="who" :class="{ 'with-class': showClass }" @click="emit('open', item.row.user.username)">
<UserName :username="item.row.user.username" :class-name="showClass ? item.row.className : null" short-class />
</button>
<span class="bar-box" :style="{ background: palette.track }">
<span class="bar" :style="{ width: width(item.row), background: barColor(item.row) }" />
@@ -343,6 +343,10 @@ function onMenu(key: string, row: RankRow) {
min-width: 0;
}
.who.with-class {
width: 108px;
}
.prow .who {
width: auto;
min-width: 0;
@@ -428,8 +432,9 @@ function onMenu(key: string, row: RankRow) {
font-weight: 700;
}
/* 名字最长 4 个字;本年级 / 全服的榜名字后面还有班号(2026-11 之前是 126px,放的是 ks2312李鑫楠) */
.who {
width: 126px;
width: 80px;
flex-shrink: 0;
padding: 0;
border: 0;
+2 -1
View File
@@ -84,8 +84,9 @@ const scale = computed(() => top.value[0]?.solved || 1)
color: v-bind('theme.textColor2');
}
/* 本班的周榜,只写名字(最长 4 个字;2026-11 之前放的是 ks2312李鑫楠) */
.who {
width: 120px;
width: 80px;
flex-shrink: 0;
padding: 0;
border: 0;
@@ -583,8 +583,9 @@ function pct(done: number, total: number) {
display: flex;
color: v-bind('theme.textColor3');
}
/* 名字最长 4 个字(2026-11 去掉 ks 前缀之前是按 ks2312李鑫楠 定的宽) */
.c-name {
width: 110px;
width: 80px;
flex: none;
}
.c-last {
@@ -418,8 +418,9 @@ function gradeStyle(grade: string | null) {
font-size: var(--oj-fs-sec);
}
/* 名字最长 4 个字(2026-11 去掉 ks 前缀之前是按 ks2312李鑫楠 定的宽) */
.p-name {
width: 110px;
width: 80px;
flex: none;
}
+11 -3
View File
@@ -756,7 +756,9 @@ function dayBreak(index: number) {
<div class="row" :class="{ on: row.id === selectedId && !isMobile, 'two-line': twoLine }" :data-row-id="row.id" @click="rowClicked(row)">
<template v-if="!twoLine">
<span class="c-time">{{ submissionClockText(row.createTime) }}</span>
<span class="c-user"><UserName :username="row.username" :class-name="mixedClasses ? row.className : null" short-class /></span>
<span class="c-user" :class="{ 'with-class': mixedClasses }"
><UserName :username="row.username" :class-name="mixedClasses ? row.className : null" short-class
/></span>
<span class="c-problem" :title="`${row.problemDisplayId} ${row.problemTitle}`">
<span class="pid">{{ row.problemDisplayId }}</span> {{ row.problemTitle }}
</span>
@@ -786,7 +788,7 @@ function dayBreak(index: number) {
<div class="row" :class="{ on: row.id === selectedId && !isMobile, 'two-line': twoLine }" :data-row-id="row.id" @click="rowClicked(row)">
<template v-if="!twoLine">
<span class="c-time">{{ submissionClockText(row.createTime) }}</span>
<span class="c-user">
<span class="c-user" :class="{ 'with-class': mixedClasses }">
<UserName :username="row.username" :class-name="mixedClasses ? row.className : null" short-class :muted="othersRow(row)" />
</span>
<span class="c-problem" :title="`${row.problemDisplayId} ${row.problemTitle}`">
@@ -1356,13 +1358,19 @@ function dayBreak(index: number) {
border-bottom: 1px solid v-bind('theme.dividerColor');
}
/* 名字最长 4 个字(在读的班 423 人里 5 人),2026-11 去掉 ks 前缀之前是 116px(ks2312李鑫楠)。
混着几个班时名字后面还有班号(李鑫楠 2312) */
.c-user {
width: 116px;
width: 80px;
flex: none;
display: flex;
overflow: hidden;
}
.c-user.with-class {
width: 108px;
}
.c-problem {
flex: 1 1 0;
min-width: 0;
@@ -106,7 +106,7 @@ function save() {
.leave-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
gap: 10px 8px;
}