实现4套农业产业组合的供应链可视化大屏,通过浏览器地址路由参数切换不同组合,每套组合内支持产业切换,提供直观的数据展示和供应链网络可视化,集成到现有项目的home页面中,为农业企业决策者提供全面的产业数据洞察。
架构更新:从8个独立大屏改为4套组合大屏:
SupplyChainDashboard组件,通过路由参数动态加载不同组合数据/supply-chain/grain-oil、/supply-chain/seed-fruit等Story 005.001: ✅ 粮食-油脂组合大屏实现
Story 005.002: ✅ 统一数据Context和路由架构
/supply-chain/grain-oil、/supply-chain/seed-fruit、/supply-chain/livestock-aquaculture、/supply-chain/fresh-food-saltStory 005.003: ✅ 统一SupplyChainDashboard组件
Story 005.004: ✅ 种业-果蔬组合数据集成
Story 005.005: ✅ 畜牧-水产组合数据集成(通过组件复用完成)
Story 005.006: ✅ 鲜食-泛盐组合数据集成(通过组件复用完成)
Story 005.007: 数据集成和API对接
src/client/home/pages/SupplyChainDashboards/SupplyChainDashboard.tsx - 统一入口组件,根据路由参数动态加载数据SupplyChainContext.tsx - 统一数据Context(扩展自ThemeContext)GrainOilDashboard.tsx - 粮食-油脂组合(可重构为数据配置)/supply-chain/grain-oil - 粮食-油脂组合/supply-chain/seed-fruit - 种业-果蔬组合/supply-chain/livestock-aquaculture - 畜牧-水产组合/supply-chain/fresh-food-salt - 鲜食-泛盐组合src/client/home/pages/SupplyChainDashboards/components/目录结构:
components/
├── icons/
│ ├── IndustryIcon.tsx # 统一产业图标组件
│ └── index.ts
├── layout/
│ ├── SupplyChainBackground.tsx # 背景组件
│ ├── BackgroundGrid.tsx # 网格背景
│ ├── HeaderBar.tsx # 标题栏
│ ├── Navigation.tsx # 导航组件
│ └── index.ts
├── text/
│ ├── SupplyChainText.tsx # 统一文本组件
│ └── index.ts
├── map/
│ ├── SupplyChainNetwork.tsx # 供应链网络
│ ├── IndustryChainPoint.tsx # 产业链定位点
│ ├── BasePoint.tsx # 基地定位点
│ ├── MapBorder.tsx # 地图边框
│ └── index.ts
├── data/
│ ├── DataCard.tsx # 数据卡片
│ ├── PopupInfoBox.tsx # 弹出信息框
│ ├── KeyMetricsPanel.tsx # 关键指标面板
│ └── index.ts
└── index.ts
IndustryIcon - 产业图标组件,支持8个产业类型配置property1?: "粮食" | "油脂" | "种业" | "果蔬" | "畜牧" | "水产" | "鲜食" | "泛盐"SupplyChainText - 统一文本组件propValue?: "24px" | "26px" | "34px" - 字号propValue1?: "特粗" - 字重propValue2?: "左对齐" | "右对齐" | "居中对齐" - 对齐方式VerticalNavigation - 左侧垂直导航栏property1?: "上" | "下" - 导航位置状态activeTab - 当前激活的产业onTabChange - 切换回调SupplyChainNetwork - 供应链连接线网络IndustryChainPoint - 产业链定位点(带蓝色光晕)BasePoint - 基地定位点(带产业图标)MapBorder - 地图边框组件DataCard - 数据卡片(带渐变背景的数字展示)PopupInfoBox - 弹出信息框(带箭头指示器)KeyMetricsPanel - 关键指标面板SupplyChainModal - 完整弹出层组件(基于Figma-JSX设计,支持主题色动态切换)HeaderBar - 顶部标题栏背景BackgroundGrid - 底部网格背景SupplyChainBackground - 供应链专用界面背景数据结构:
// 组合类型定义
type DashboardType = 'grain-oil' | 'seed-fruit' | 'livestock-aquaculture' | 'fresh-food-salt';
interface SupplyChainData {
// 组合名称
name: string;
// 支持的产业
industries: IndustryType[];
// 定位点数据
mapPoints: Record<IndustryType, LocationPoint[]>;
// 关键指标数据
keyMetrics: Record<IndustryType, MetricData[]>;
// 供应链网络数据
supplyChainNetwork: Record<IndustryType, SupplyChainNetwork>;
// 弹出框数据
popupData: Record<IndustryType, PopupData[]>;
}
interface SupplyChainContextType {
// 当前组合类型
currentDashboard: DashboardType;
// 当前产业
currentIndustry: IndustryType;
// 主题色
themeColor: string;
// 当前组合数据
currentData: SupplyChainData | null;
// 设置方法
setDashboard: (dashboard: DashboardType) => void;
setIndustry: (industry: IndustryType) => void;
}
SupplyChainMap.tsx - ✅ 已修改为使用动态定位点数据KeyMetrics.tsx - ✅ 已修改为使用动态关键指标数据PopupInfoBox.tsx - ✅ 已修改为使用动态弹出框数据,并实现双款式支持useSupplyChain() hook获取动态数据数据获取模式:
const { currentData, currentIndustry } = useSupplyChain();
const mapPoints = currentData?.mapPoints[currentIndustry] || [];
const keyMetrics = currentData?.keyMetrics[currentIndustry] || [];
const popupData = currentData?.popupData[currentIndustry] || [];
/supply-chain/grain-oil等)public/supply-chain/ 目录下wget 直接从Figma提供的图片URL下载file 命令验证文件是PNG还是SVG格式/supply-chain/{图片文件名} 引用基于Figma设计文档分析,需要实现以下核心组件体系:
IndustryIcon - 支持8个产业类型的可配置图标SupplyChainText - 支持多种字号、字重、对齐方式的统一文本VerticalNavigation - 左侧垂直导航栏,支持位置状态切换SupplyChainNetwork - 供应链连接线网络(包含17条连接线)IndustryChainPoint - 产业链定位点(蓝色光晕效果)BasePoint - 基地定位点(产业图标展示)MapBorder - 地图边框装饰DataCard - 带渐变背景的数字展示卡片PopupInfoBox - 带箭头指示器的信息展示框KeyMetricsPanel - 关键指标展示区域SupplyChainBackground - 供应链专用界面背景BackgroundGrid - 底部网格背景装饰HeaderBar - 顶部标题栏背景| Date | Version | Description | Author |
|---|---|---|---|
| 2025-11-06 | 1.0 | 初始史诗创建 | Bob (SM) |
| 2025-11-06 | 1.1 | 基于最新Figma设计更新,产业数量从4个扩展到8个 | Bob (SM) |
| 2025-11-15 | 1.2 | Story 005.001粮食大屏实现完成,更新验收标准和完成状态 | Claude |
| 2025-11-15 | 1.3 | 架构重构:从8个独立大屏改为4套组合大屏,添加路由参数和统一数据Context | Claude |
| 2025-11-15 | 1.4 | 架构优化:采用统一入口组件,通过路由参数动态加载数据 | Claude |
| 2025-11-16 | 1.5 | 核心架构完成:Story 005.002和005.003实现完成,统一数据Context和动态路由架构已就绪 | Claude |
| 2025-11-16 | 1.6 | 组件数据流问题识别:发现SupplyChainMap和KeyMetrics组件使用硬编码数据,需要修改为动态Context数据 | Claude |
| 2025-11-16 | 1.7 | 重大发现:故事005.005和005.006已通过组件复用架构完成,所有4套组合数据已在SupplyChainContext中完整实现 | Claude |
| 2025-11-16 | 1.8 | 弹出层主题色集成:基于Figma-JSX文档创建SupplyChainModal组件,实现完整弹出层样式和动态主题色切换 | Claude |