From ad184e1b8276322d8540a76c50a459eac1f49136 Mon Sep 17 00:00:00 2001 From: shangfangjian Date: Mon, 21 Sep 2026 00:48:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9A=E4=BD=8D=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=97=A0=E5=8F=8D=E5=BA=94=20+=20=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scrollIntoView 改用 requestAnimationFrame 确保 DOM 已更新 - 滚动位置改为 block: 'start',更可靠 - 高亮增加背景色变化(bg-press-wash/40),更明显 - 高亮持续时间延长至 5 秒 Co-Authored-By: new-provider/LongCat-2.0 <> ) --- frontend/src/admin/pages/DataCompleteness.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/admin/pages/DataCompleteness.tsx b/frontend/src/admin/pages/DataCompleteness.tsx index a601698..46aa2fb 100644 --- a/frontend/src/admin/pages/DataCompleteness.tsx +++ b/frontend/src/admin/pages/DataCompleteness.tsx @@ -75,9 +75,15 @@ export default function DataCompletenessPage() { // 点击问题项 → 滚动到对应联赛卡片并高亮 const scrollToLeague = useCallback((code: string) => { setHighlightedLeague(code) - leagueRefs.current[code]?.scrollIntoView({ behavior: 'smooth', block: 'center' }) - // 3秒后移除高亮 - setTimeout(() => setHighlightedLeague(null), 3000) + // 使用 requestAnimationFrame 确保 DOM 已更新 + requestAnimationFrame(() => { + const el = leagueRefs.current[code] + if (el) { + el.scrollIntoView({ behavior: 'smooth', block: 'start' }) + } + }) + // 5秒后移除高亮 + setTimeout(() => setHighlightedLeague(null), 5000) }, []) return ( @@ -167,7 +173,7 @@ export default function DataCompletenessPage() {
{ leagueRefs.current[league.code] = el }} - className={`transition-all duration-500 ${isHighlighted ? 'ring-2 ring-press scale-[1.01]' : ''}`} + className={`transition-all duration-500 ${isHighlighted ? 'ring-2 ring-press bg-press-wash/40 scale-[1.01]' : ''}`} >