From b7315bbdb4634729440c6d3a25d82e2049ef7615 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Mon, 15 Dec 2025 15:33:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=86=E5=8F=B2=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=A0=B9=E6=8D=AE=E9=87=8D=E8=A6=81=E6=80=A7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=90=8C=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重要性 >= 4:红色背景(高重要性) - 重要性 >= 2:橙色背景(中等重要性) - 重要性 < 2:绿色背景(低重要性) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/HistoricalEvents.js | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/views/EventDetail/components/HistoricalEvents.js b/src/views/EventDetail/components/HistoricalEvents.js index 366e163f..98745969 100644 --- a/src/views/EventDetail/components/HistoricalEvents.js +++ b/src/views/EventDetail/components/HistoricalEvents.js @@ -122,13 +122,20 @@ const HistoricalEvents = ({ // navigate(`/event-detail/${event.id}`); // }; - // 获取重要性颜色 + // 获取重要性颜色(用于 Badge) const getImportanceColor = (importance) => { if (importance >= 4) return 'red'; if (importance >= 2) return 'orange'; return 'green'; }; + // 获取重要性背景色(用于卡片背景) + const getImportanceBgColor = (importance) => { + if (importance >= 4) return 'rgba(239, 68, 68, 0.15)'; // 红色背景 + if (importance >= 2) return 'rgba(245, 158, 11, 0.12)'; // 橙色背景 + return 'rgba(34, 197, 94, 0.1)'; // 绿色背景 + }; + // 获取相关度颜色(1-10) const getSimilarityColor = (similarity) => { if (similarity >= 8) return 'green'; @@ -240,27 +247,15 @@ const HistoricalEvents = ({ {events.map((event) => { const importanceColor = getImportanceColor(event.importance); + const importanceBgColor = getImportanceBgColor(event.importance); return (