From f0d30244d2f7e89e6b1fa4c284f620bd0beeaa25 Mon Sep 17 00:00:00 2001
From: zdl <3489966805@qq.com>
Date: Fri, 24 Oct 2025 12:25:23 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=87=8D=E8=A6=81?=
=?UTF-8?q?=E6=80=A7=E7=AD=89=E7=BA=A7=E8=AF=B4=E6=98=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Community/components/EventList.js | 96 +++++++++++----------
1 file changed, 49 insertions(+), 47 deletions(-)
diff --git a/src/views/Community/components/EventList.js b/src/views/Community/components/EventList.js
index 7d13ff7c..fbdaf461 100644
--- a/src/views/Community/components/EventList.js
+++ b/src/views/Community/components/EventList.js
@@ -55,6 +55,7 @@ import moment from 'moment';
import { logger } from '../../../utils/logger';
import { getApiBase } from '../../../utils/apiConfig';
import { useEventNotifications } from '../../../hooks/useEventNotifications';
+import { getImportanceConfig, getAllImportanceLevels } from '../../../constants/importanceLevels';
// ========== 工具函数定义在组件外部 ==========
// 涨跌颜色配置(中国A股配色:红涨绿跌)- 分档次显示
@@ -115,45 +116,7 @@ const getPriceChangeBorderColor = (value) => {
return 'gray.300';
};
-// 重要性等级配置 - 金融配色方案
-const importanceLevels = {
- 'S': {
- color: 'purple.600',
- bgColor: 'purple.50',
- borderColor: 'purple.200',
- icon: WarningIcon,
- label: '极高',
- dotBg: 'purple.500',
- },
- 'A': {
- color: 'red.600',
- bgColor: 'red.50',
- borderColor: 'red.200',
- icon: WarningTwoIcon,
- label: '高',
- dotBg: 'red.500',
- },
- 'B': {
- color: 'orange.600',
- bgColor: 'orange.50',
- borderColor: 'orange.200',
- icon: InfoIcon,
- label: '中',
- dotBg: 'orange.500',
- },
- 'C': {
- color: 'green.600',
- bgColor: 'green.50',
- borderColor: 'green.200',
- icon: CheckCircleIcon,
- label: '低',
- dotBg: 'green.500',
- }
-};
-
-const getImportanceConfig = (importance) => {
- return importanceLevels[importance] || importanceLevels['C'];
-};
+// 重要性等级配置已移至 src/constants/importanceLevels.js
// 自定义的涨跌箭头组件(修复颜色问题)
const PriceArrow = ({ value }) => {
@@ -558,15 +521,54 @@ const EventList = ({ events, pagination, onPageChange, onEventClick, onViewDetai
{event.title}
-
+
+ 重要性等级说明
+
+
+ {getAllImportanceLevels().map((level) => (
+
+
+
+ {level.level}级
+ {level.description}
+
+
+ ))}
+
+ }
+ placement="left"
+ hasArrow
+ bg="white"
+ color="gray.800"
+ fontSize="md"
+ p={3}
+ borderRadius="lg"
+ borderWidth="1px"
+ borderColor="gray.200"
+ boxShadow="lg"
>
- {importance.label}优先级
-
+
+
+ {importance.label}优先级
+
+
{/* 元信息 */}