登录框、提交列表、数据统计、排名、课堂看板、题单班级视图、班级 PK 七处统一走 groupClassOptions。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1e441411a5
commit
367cfc9d5d
6 files changed
+71
-59
No files matched your search
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { getClassBoard, setClassLesson } from "oj/api"
|
||||
import { groupClassOptions } from "oj/submission/utils"
|
||||
import UserName from "shared/components/UserName.vue"
|
||||
import { useLeaveStudents } from "shared/composables/leaveStudents"
|
||||
import { useCollabStore } from "shared/store/collab"
|
||||
@@ -49,17 +50,9 @@ const languageOptions = LESSON_LANGUAGES.map((value) => ({
|
||||
}))
|
||||
const saving = ref(false)
|
||||
|
||||
function classLabel(name: string) {
|
||||
return /^\d{3,}$/.test(name) ? `${name.slice(0, 2)}计算机${name.slice(2)}班` : name
|
||||
}
|
||||
|
||||
const classOptions = computed(() => {
|
||||
const list = configStore.config?.classList ?? []
|
||||
const names =
|
||||
board.value?.className && !list.includes(board.value.className)
|
||||
? [board.value.className, ...list]
|
||||
: list
|
||||
return names.map((name) => ({ label: classLabel(name), value: name }))
|
||||
return groupClassOptions(board.value?.className ? [board.value.className, ...list] : list)
|
||||
})
|
||||
|
||||
async function load() {
|
||||
|
||||
Reference in new issue
Block a user