fix(assessment): academic year selector derived correct year from term (was breaking range filter)

This commit is contained in:
root
2026-10-17 16:13:41 +08:00
parent 595be0d928
commit 3d2d064920
16 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ export function AssessmentPage() {
<h2 className="text-[15px] font-semibold text-ink-1">综合测评(按学年自动计算)</h2>
<div className="flex flex-wrap items-center gap-2">
<Select className="w-[190px]" value={year} onChange={e => setYear(e.target.value)}
options={[...Array.from(new Set((gradesQ.data?.semesters ?? []).map(x => x.term.slice(0, 7)))).map(y => ({ value: y, label: gradeLabel(y, profile.eduStart) })), { value: 'all', label: '全部学年' }]} />
options={[...Array.from(new Set((gradesQ.data?.semesters ?? []).map(x => x.term.split('-').slice(0, 2).join('-')))).map(y => ({ value: y, label: gradeLabel(y, profile.eduStart) })), { value: 'all', label: '全部学年' }]} />
<Button variant="secondary" onClick={exportWord}><Download size={13} /> 导出材料</Button>
<Button variant="secondary" onClick={() => setInitOpen(true)}><RotateCcw size={13} /> 初始化</Button>
<Button variant="primary" onClick={() => window.print()}><Printer size={13} /> 打印</Button>