From 93cd2e9c759aad79fc99682867d374f1c8081a0f Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 26 Jun 2026 17:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E8=80=81=E5=B8=88=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9F=A5=E8=AF=A2=E7=BB=93=E6=9E=9C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=8A=98=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app/static/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/app/static/app.js b/app/app/static/app.js index 7bd6101..fb9020e 100644 --- a/app/app/static/app.js +++ b/app/app/static/app.js @@ -123,6 +123,13 @@ function groupRecordsByTeacher(records) { }); } +function initializeTeacherGroupCollapse(records) { + const groups = groupRecordsByTeacher(records); + collapsedTeacherGroups = groups.length > 1 + ? new Set(groups.map((group) => group.teacher)) + : new Set(); +} + function getDisplayRecord(row) { return correctedRecords.get(row._recordKey) || row; } @@ -811,6 +818,9 @@ async function queryRecords(query, options = {}) { _recordIndex: currentRecordPage.offset + index, _recordKey: makeRecordKey(row, currentRecordPage.offset + index), })); + if (options.reset !== false) { + initializeTeacherGroupCollapse(currentRecords); + } recordRows.innerHTML = renderGroupedRecords(currentRecords); } catch (error) { recordRows.innerHTML = `查询失败:${escapeHtml(error.message)}`;