From a9cb60a12b83d0d7317e5c7adb3fc84dadac75d0 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Mon, 29 Dec 2025 10:53:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20EPS=E5=9B=BE=E4=BE=8B=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=BB=BF=E8=89=B2=20&=20=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=BC=96=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ForecastReport/constants.ts: epsAvg 颜色从灰色改为绿色 #10B981 - AnnouncementsPanel.tsx: 添加 formatInfoType 函数处理原始编码格式 - 当 info_type 包含 || 分隔符时显示"公告"而非原始编码 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/AnnouncementsPanel.tsx | 15 +++++++++++++-- .../components/ForecastReport/constants.ts | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/views/Company/components/CompanyOverview/BasicInfoTab/components/AnnouncementsPanel.tsx b/src/views/Company/components/CompanyOverview/BasicInfoTab/components/AnnouncementsPanel.tsx index 7807bba7..5ad4ff83 100644 --- a/src/views/Company/components/CompanyOverview/BasicInfoTab/components/AnnouncementsPanel.tsx +++ b/src/views/Company/components/CompanyOverview/BasicInfoTab/components/AnnouncementsPanel.tsx @@ -29,6 +29,17 @@ import { THEME } from "../config"; import { formatDate } from "../utils"; import LoadingState from "./LoadingState"; +/** + * 格式化公告类型 + * 如果是编码格式(包含||),则显示"公告" + */ +const formatInfoType = (infoType: string | undefined): string => { + if (!infoType) return "公告"; + // 如果包含编码分隔符,说明是原始编码,显示默认文字 + if (infoType.includes("||")) return "公告"; + return infoType; +}; + interface AnnouncementsPanelProps { stockCode: string; /** SubTabContainer 传递的激活状态,控制是否加载数据 */ @@ -74,7 +85,7 @@ const AnnouncementsPanel: React.FC = ({ stockCode, isAc - {announcement.info_type || "公告"} + {formatInfoType(announcement.info_type)} {formatDate(announcement.announce_date)} @@ -119,7 +130,7 @@ const AnnouncementsPanel: React.FC = ({ stockCode, isAc {selectedAnnouncement?.title} - {selectedAnnouncement?.info_type || "公告"} + {formatInfoType(selectedAnnouncement?.info_type)} {formatDate(selectedAnnouncement?.announce_date)} diff --git a/src/views/Company/components/ForecastReport/constants.ts b/src/views/Company/components/ForecastReport/constants.ts index 59a11889..4c55ca5d 100644 --- a/src/views/Company/components/ForecastReport/constants.ts +++ b/src/views/Company/components/ForecastReport/constants.ts @@ -22,7 +22,7 @@ export const CHART_COLORS = { profit: '#F6AD55', // 利润 - 橙金色 growth: '#10B981', // 增长率 - 翠绿色 eps: '#DAA520', // EPS - 金菊色 - epsAvg: '#A0AEC0', // EPS行业平均 - 亮灰色(提高对比度) + epsAvg: '#10B981', // EPS行业平均 - 绿色(与增长率一致) pe: '#D4AF37', // PE - 金色 peg: '#38B2AC', // PEG - 青色(优化对比度) };