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}优先级 + + {/* 元信息 */}