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 (