From e031b3858e1e4ec0cc864a1bfd1ca6cf0435acb8 Mon Sep 17 00:00:00 2001 From: nxxy335 Date: Thu, 10 Sep 2026 10:55:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E6=95=B0=E6=8D=AE=E9=AB=98?= =?UTF-8?q?=E4=BA=AE=E6=AF=8F=2030=20=E7=A7=92=E8=87=AA=E5=8A=A8=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增独立定时器 startHlAutoClear:每 hlAutoClearSec(默认30)秒扫描一次, 若仍有高亮则清空并重新渲染表格与计数徽标;无高亮时不打扰。 - 既保留'比闪一下停留更久'的可见性,又避免绿色底纹长期堆积失去重点。 - 清除按钮 tooltip 同步说明'每 30 秒自动清除一次'。 - 与手动清除(#btnClearHl)、切换项目重置高亮互不冲突。 --- assets/app.js | 19 ++++++++++++++++++- index.php | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/assets/app.js b/assets/app.js index 67f79c8..13da16e 100644 --- a/assets/app.js +++ b/assets/app.js @@ -25,7 +25,9 @@ connFail: 0, historyDisplay: 'click', // click=点击成员弹窗查看历史;inline=成绩明细内全部展开 exportSort: 'time', // time=按提交时间;sid=按学号 - highlight: new Set(), // 出现过新提交/新数据的学号,绿色底纹常亮直到清除 + highlight: new Set(), // 出现过新提交/新数据的学号,绿色底纹 + hlTimer: null, // 自动清除高亮的定时器 + hlAutoClearSec: 30, // 新数据高亮每隔多少秒自动清除一次 }; /* ---------------- 本地存储 ---------------- */ @@ -703,6 +705,20 @@ state.timer = setInterval(() => refresh(true), sec * 1000); } + /* ---------------- 新数据高亮自动清除 ---------------- */ + // 绿色高亮用于标记"有更新的成员",停留更易察觉(不再只闪一下), + // 但长时间堆积会失去重点——故每 hlAutoClearSec 秒自动清除一次。 + function startHlAutoClear() { + if (state.hlTimer) clearInterval(state.hlTimer); + const sec = state.hlAutoClearSec || 30; + state.hlTimer = setInterval(() => { + if (state.highlight.size === 0) return; // 无高亮时不打扰 + state.highlight = new Set(); + renderTable(); + renderHlBadge(); + }, sec * 1000); + } + /* ---------------- 全屏 ---------------- */ function toggleFullscreen() { const el = document.documentElement; @@ -1135,6 +1151,7 @@ // 启动:主界面在 PHP 端已做会话校验(未登录会跳到 login.php),此处直接加载数据 schedule(); + startHlAutoClear(); // 新数据高亮每 30s 自动清除一次 loadProjects(); // 4) 读取展示偏好(历史成绩展示方式 / 导出排序),避免必须打开设置弹窗才生效 diff --git a/index.php b/index.php index 2040c49..3123b03 100644 --- a/index.php +++ b/index.php @@ -109,7 +109,7 @@ $rosterCount = Roster::count();

成绩明细

- + 最后更新:—