From 2d03c88f433913adef3515cc4ab6c331a98ada97 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Tue, 16 Dec 2025 20:37:29 +0800 Subject: [PATCH] =?UTF-8?q?style(DynamicTracking):=20=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E9=BB=91=E9=87=91=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - NewsEventsTab: 添加黑金主题配色系统 - ForecastPanel: 业绩预告面板黑金样式 - NewsPanel: 切换 blackGold 主题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../CompanyOverview/NewsEventsTab.js | 211 ++++++++++++++---- .../components/ForecastPanel.js | 110 +++++++-- .../DynamicTracking/components/NewsPanel.js | 2 +- 3 files changed, 249 insertions(+), 74 deletions(-) diff --git a/src/views/Company/components/CompanyOverview/NewsEventsTab.js b/src/views/Company/components/CompanyOverview/NewsEventsTab.js index a4122a7d..e66f7d34 100644 --- a/src/views/Company/components/CompanyOverview/NewsEventsTab.js +++ b/src/views/Company/components/CompanyOverview/NewsEventsTab.js @@ -36,6 +36,58 @@ import { FaChevronRight, } from "react-icons/fa"; +// 黑金主题配色 +const THEME_PRESETS = { + blackGold: { + bg: "#0A0E17", + cardBg: "#1A1F2E", + cardHoverBg: "#212633", + cardBorder: "rgba(212, 175, 55, 0.2)", + cardHoverBorder: "#D4AF37", + textPrimary: "#E8E9ED", + textSecondary: "#A0A4B8", + textMuted: "#6B7280", + gold: "#D4AF37", + goldLight: "#FFD54F", + inputBg: "#151922", + inputBorder: "#2D3748", + buttonBg: "#D4AF37", + buttonText: "#0A0E17", + buttonHoverBg: "#FFD54F", + badgeS: { bg: "rgba(255, 195, 0, 0.2)", color: "#FFD54F" }, + badgeA: { bg: "rgba(249, 115, 22, 0.2)", color: "#FB923C" }, + badgeB: { bg: "rgba(59, 130, 246, 0.2)", color: "#60A5FA" }, + badgeC: { bg: "rgba(107, 114, 128, 0.2)", color: "#9CA3AF" }, + tagBg: "rgba(212, 175, 55, 0.15)", + tagColor: "#D4AF37", + spinnerColor: "#D4AF37", + }, + default: { + bg: "white", + cardBg: "white", + cardHoverBg: "gray.50", + cardBorder: "gray.200", + cardHoverBorder: "blue.300", + textPrimary: "gray.800", + textSecondary: "gray.600", + textMuted: "gray.500", + gold: "blue.500", + goldLight: "blue.400", + inputBg: "white", + inputBorder: "gray.200", + buttonBg: "blue.500", + buttonText: "white", + buttonHoverBg: "blue.600", + badgeS: { bg: "red.100", color: "red.600" }, + badgeA: { bg: "orange.100", color: "orange.600" }, + badgeB: { bg: "yellow.100", color: "yellow.600" }, + badgeC: { bg: "green.100", color: "green.600" }, + tagBg: "cyan.50", + tagColor: "cyan.600", + spinnerColor: "blue.500", + }, +}; + /** * 新闻动态 Tab 组件 * @@ -48,6 +100,7 @@ import { * - onSearch: 搜索提交回调 () => void * - onPageChange: 分页回调 (page) => void * - cardBg: 卡片背景色 + * - themePreset: 主题预设 'blackGold' | 'default' */ const NewsEventsTab = ({ newsEvents = [], @@ -65,7 +118,11 @@ const NewsEventsTab = ({ onSearch, onPageChange, cardBg, + themePreset = "default", }) => { + // 获取主题配色 + const theme = THEME_PRESETS[themePreset] || THEME_PRESETS.default; + const isBlackGold = themePreset === "blackGold"; // 事件类型图标映射 const getEventTypeIcon = (eventType) => { const iconMap = { @@ -80,15 +137,25 @@ const NewsEventsTab = ({ return iconMap[eventType] || FaNewspaper; }; - // 重要性颜色映射 - const getImportanceColor = (importance) => { + // 重要性颜色映射 - 根据主题返回不同配色 + const getImportanceBadgeStyle = (importance) => { + if (isBlackGold) { + const styles = { + S: theme.badgeS, + A: theme.badgeA, + B: theme.badgeB, + C: theme.badgeC, + }; + return styles[importance] || { bg: "rgba(107, 114, 128, 0.2)", color: "#9CA3AF" }; + } + // 默认主题使用 colorScheme const colorMap = { S: "red", A: "orange", B: "yellow", C: "green", }; - return colorMap[importance] || "gray"; + return { colorScheme: colorMap[importance] || "gray" }; }; // 处理搜索输入 @@ -129,19 +196,26 @@ const NewsEventsTab = ({ // 如果开始页大于1,显示省略号 if (startPage > 1) { pageButtons.push( - + ... ); } for (let i = startPage; i <= endPage; i++) { + const isActive = i === currentPage; pageButtons.push(