diff --git a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/types.ts b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/types.ts index 631ced8e..07b864ac 100644 --- a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/types.ts +++ b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/types.ts @@ -8,7 +8,10 @@ export interface FormatUtils { formatCurrency: (value: number | null | undefined) => string; - formatBusinessRevenue: (value: number | null | undefined, unit?: string) => string; + formatBusinessRevenue: ( + value: number | null | undefined, + unit?: string + ) => string; formatPercentage: (value: number | null | undefined) => string; } @@ -186,7 +189,7 @@ export interface ValueChainData { // ==================== 相关公司类型 ==================== export interface RelatedCompanyRelationship { - role: 'source' | 'target'; + role: "source" | "target"; connected_node: string; } @@ -205,7 +208,7 @@ export interface RelatedCompany { // ==================== 关键因素类型 ==================== -export type ImpactDirection = 'positive' | 'negative' | 'neutral' | 'mixed'; +export type ImpactDirection = "positive" | "negative" | "neutral" | "mixed"; export interface KeyFactor { factor_name: string; @@ -297,7 +300,11 @@ export interface IndustryRankData { // ==================== 主组件 Props 类型 ==================== /** Tab 类型 */ -export type DeepAnalysisTabKey = 'strategy' | 'business' | 'valueChain' | 'development'; +export type DeepAnalysisTabKey = + | "strategy" + | "business" + | "valueChain" + | "development"; export interface DeepAnalysisTabProps { comprehensiveData?: ComprehensiveData; @@ -353,12 +360,23 @@ export interface RadarIndicator { } export interface RadarChartOption { - tooltip: { trigger: string }; + tooltip: { + trigger: string; + backgroundColor?: string; + borderColor?: string; + textStyle?: { color: string }; + }; radar: { indicator: RadarIndicator[]; shape: string; splitNumber: number; - name: { textStyle: { color: string; fontSize: number } }; + name: { + textStyle: { + color: string; + fontSize: number; + fontWeight?: string; + }; + }; splitLine: { lineStyle: { color: string[] } }; splitArea: { show: boolean; areaStyle: { color: string[] } }; axisLine: { lineStyle: { color: string } }; @@ -373,7 +391,12 @@ export interface RadarChartOption { symbolSize: number; lineStyle: { width: number; color: string }; areaStyle: { color: string }; - label: { show: boolean; formatter: (params: { value: number }) => number; color: string; fontSize: number }; + label: { + show: boolean; + formatter: (params: { value: number }) => number; + color: string; + fontSize: number; + }; }>; }>; } diff --git a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/utils/chartOptions.ts b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/utils/chartOptions.ts index 7164cc30..cc549507 100644 --- a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/utils/chartOptions.ts +++ b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/utils/chartOptions.ts @@ -9,7 +9,7 @@ import type { ValueChainData, RadarChartOption, SankeyChartOption, -} from '../types'; +} from "../types"; /** * 生成竞争力雷达图配置 @@ -23,14 +23,14 @@ export const getRadarChartOption = ( const scores = comprehensiveData.competitive_position.scores; const indicators = [ - { name: '市场地位', max: 100 }, - { name: '技术实力', max: 100 }, - { name: '品牌价值', max: 100 }, - { name: '运营效率', max: 100 }, - { name: '财务健康', max: 100 }, - { name: '创新能力', max: 100 }, - { name: '风险控制', max: 100 }, - { name: '成长潜力', max: 100 }, + { name: "市场地位", max: 100 }, + { name: "技术实力", max: 100 }, + { name: "品牌价值", max: 100 }, + { name: "运营效率", max: 100 }, + { name: "财务健康", max: 100 }, + { name: "创新能力", max: 100 }, + { name: "风险控制", max: 100 }, + { name: "成长潜力", max: 100 }, ]; const data = [ @@ -44,40 +44,71 @@ export const getRadarChartOption = ( scores.growth || 0, ]; + // 黑金主题配色 + const THEME = { + gold: "#F4D03F", + goldLight: "rgba(212, 175, 55, 0.6)", + goldDim: "rgba(212, 175, 55, 0.3)", + blue: "#3182ce", + blueArea: "rgba(49, 130, 206, 0.3)", + }; + return { - tooltip: { trigger: 'item' }, + tooltip: { + trigger: "item", + backgroundColor: "rgba(30, 30, 35, 0.95)", + borderColor: THEME.goldDim, + textStyle: { color: "#fff" }, + }, radar: { indicator: indicators, - shape: 'polygon', + shape: "polygon", splitNumber: 4, - name: { textStyle: { color: '#666', fontSize: 12 } }, - splitLine: { - lineStyle: { color: ['#e8e8e8', '#e0e0e0', '#d0d0d0', '#c0c0c0'] }, + // 指标名称 - 使用金色确保在深色背景上清晰可见 + name: { + textStyle: { + color: THEME.gold, + fontSize: 12, + fontWeight: "bold", + }, }, + // 分割线 - 金色系 + splitLine: { + lineStyle: { + color: [ + THEME.goldDim, + "rgba(212, 175, 55, 0.2)", + "rgba(212, 175, 55, 0.15)", + "rgba(212, 175, 55, 0.1)", + ], + }, + }, + // 分割区域 - 深色透明 splitArea: { show: true, areaStyle: { - color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'], + color: ["rgba(30, 30, 35, 0.6)", "rgba(40, 40, 45, 0.4)"], }, }, - axisLine: { lineStyle: { color: '#ddd' } }, + // 轴线 - 金色 + axisLine: { lineStyle: { color: THEME.goldDim } }, }, series: [ { - name: '竞争力评分', - type: 'radar', + name: "竞争力评分", + type: "radar", data: [ { value: data, - name: '当前评分', - symbol: 'circle', + name: "当前评分", + symbol: "circle", symbolSize: 5, - lineStyle: { width: 2, color: '#3182ce' }, - areaStyle: { color: 'rgba(49, 130, 206, 0.3)' }, + lineStyle: { width: 2, color: THEME.blue }, + areaStyle: { color: THEME.blueArea }, label: { show: true, formatter: (params: { value: number }) => params.value, - color: '#3182ce', + color: THEME.gold, fontSize: 10, }, }, @@ -117,22 +148,22 @@ export const getSankeyChartOption = ( links.push({ source: flow.source.node_name, target: flow.target.node_name, - value: parseFloat(flow.flow_metrics?.flow_ratio || '1') || 1, - lineStyle: { color: 'source', opacity: 0.6 }, + value: parseFloat(flow.flow_metrics?.flow_ratio || "1") || 1, + lineStyle: { color: "source", opacity: 0.6 }, }); }); return { - tooltip: { trigger: 'item', triggerOn: 'mousemove' }, + tooltip: { trigger: "item", triggerOn: "mousemove" }, series: [ { - type: 'sankey', - layout: 'none', - emphasis: { focus: 'adjacency' }, + type: "sankey", + layout: "none", + emphasis: { focus: "adjacency" }, data: Array.from(nodes).map((name) => ({ name })), links: links, - lineStyle: { color: 'gradient', curveness: 0.5 }, - label: { color: '#333', fontSize: 10 }, + lineStyle: { color: "gradient", curveness: 0.5 }, + label: { color: "#333", fontSize: 10 }, }, ], };