From eb093a5189789c80cae1e78f9b6a82f4797ebef7 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 11 Dec 2025 18:49:03 +0800 Subject: [PATCH] =?UTF-8?q?perf(StrategyAnalysisCard):=20=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E4=BC=98=E5=8C=96=E4=B8=8E=E9=BB=91=E9=87=91=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 渲染优化: React.memo, useMemo, 样式常量提取 - 子组件拆分: EmptyState, ContentItem - 黑金 UI: 金色标题、白色内容文字、空状态金色虚线边框 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/StrategyAnalysisCard.tsx | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/components/StrategyAnalysisCard.tsx b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/components/StrategyAnalysisCard.tsx index e01ed7dc..ab61cecf 100644 --- a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/components/StrategyAnalysisCard.tsx +++ b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/components/StrategyAnalysisCard.tsx @@ -25,8 +25,6 @@ import type { Strategy } from '../types'; // 样式常量 - 避免每次渲染创建新对象 const CARD_STYLES = { bg: 'transparent', - border: '1px solid', - borderColor: 'yellow.600', shadow: 'md', } as const; @@ -48,6 +46,7 @@ const GRID_RESPONSIVE_COLSPAN = { base: 2, md: 1 } as const; interface StrategyAnalysisCardProps { strategy: Strategy; + cardBg?: string; } // 空状态组件 - 独立 memo 避免重复渲染 @@ -74,15 +73,13 @@ interface ContentItemProps { } const ContentItem = memo(({ title, content }) => ( - + {title} - - - {content} - - + + {content} + )); @@ -101,27 +98,29 @@ const StrategyAnalysisCard: React.FC = memo( - 战略分析 + 战略分析 {!hasData ? ( ) : ( - - - - - - - - + + + + + + + + + + )}