feat(班级下拉): 全站的班级下拉按年级分组,新年级在上,组里按班号排
Deploy / deploy (push) Canceled after 0s

登录框、提交列表、数据统计、排名、课堂看板、题单班级视图、班级 PK 七处统一走
groupClassOptions。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-10 12:54:26 +08:00
1 parent 1e441411a5
commit 367cfc9d5d
6 files changed
+71 -59

No files matched your search

+3 -7
View File
@@ -9,7 +9,7 @@ import type {
} from "@oj2/contract"
import { useThemeVars } from "naive-ui"
import { clearMood, getClassBattle, getRankBoard, getWeeklyChampions, setRankHidden } from "oj/api"
import { classLabel } from "oj/submission/utils"
import { classLabel, groupClassOptions } from "oj/submission/utils"
import UserName from "shared/components/UserName.vue"
import { useBreakpoints } from "shared/composables/breakpoints"
import { useConfigStore } from "shared/store/config"
@@ -261,12 +261,8 @@ const minis = computed<MiniRank[]>(() => {
const teacherClassOptions = computed(() => {
const list = configStore.config?.classList ?? []
const all =
teacherClass.value && !list.includes(teacherClass.value) ? [teacherClass.value, ...list] : list
return [
{ label: "全部", value: "" },
...all.map((name) => ({ label: classLabel(name), value: name })),
]
const all = teacherClass.value ? [teacherClass.value, ...list] : list
return [{ label: "全部", value: "" }, ...groupClassOptions(all)]
})
const myBattle = computed(() => battle.value.find((item) => item.className === classContext.value))