feat: align with upstream 1.5.9.9

This commit is contained in:
2026-09-12 18:21:11 +08:00
commit 34f0679117
805 changed files with 376275 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// 学段权重权威定义(与 server/utils/grade-class-core.ts 保持一致;前端唯一引用源)
export const GRADE_ORDER = {
初一: 1,
初二: 2,
初三: 3,
高一: 4,
高二: 5,
高三: 6,
大一: 7,
大二: 8,
大三: 9,
大四: 10,
教师: 99,
教职工: 99
}
export const smartSort = (a, b) => {
const weightA = GRADE_ORDER[a]
const weightB = GRADE_ORDER[b]
if (weightA !== undefined && weightB !== undefined) return weightA - weightB
if (weightA !== undefined) return -1
if (weightB !== undefined) return 1
return a.localeCompare(b, 'zh-CN', { numeric: true })
}