Files
n8n_Demo/.serena/memories/order-class-naming-convention.md
Yep_Q b50d700a2e feat: 添加交通物流、智能制造、智能开发终端模拟并优化食品订单班
主要更新:
- 新增3个订单班终端模拟数据 (交通物流、智能制造、智能开发)
- 交通物流: 图片重命名(9张UUID图片→描述性中文名)
- 智能制造: 图片重命名(7张UUID图片→描述性中文名)
- 食品订单班: 完成React应用架构和设计系统
- 新增4个Serena记忆文档 (终端模拟开发指南、订单班命名规范等)
- 优化模态框和工作流页面交互逻辑

文件变更:
- 新增: transportation.ts, intelligentManufacturing.ts, developer.ts
- 新增: 食品订单班完整React应用 (Vite + TypeScript + Tailwind)
- 修改: RequirementModal.tsx, ResultModal.tsx, WorkflowPageV4.tsx
- 图片: 交通物流9张 + 智能制造7张重命名为中文描述性名称
2025-10-02 20:29:01 +08:00

67 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 订单班命名规范和映射表
## 命名统一原则
所有订单班的命名必须在以下三个地方保持一致:
1. **orderClasses.json** 中的 `id` 字段
2. **simulationMap** 中的 key
3. **终端模拟文件名**和**导出函数名**
## 当前订单班中英文映射表
| 中文名称 | 英文ID | 文件名 | 导出函数名 | 状态 |
|---------|--------|--------|-----------|------|
| 食品 | `food` | `food.ts` | `foodSimulation` | ✅ 已实现 |
| 文旅 | `wenlu` | `wenlu.ts` | `wenluSimulation` | ✅ 已实现 |
| 智能制造 | `manufacturing` | `intelligentManufacturing.ts` | `intelligentManufacturingSimulation` | ✅ 已实现 |
| 智能开发 | `developer` | - | - | ⏸️ 未实现 |
| 财经商贸 | `finance` | - | - | ⏸️ 未实现 |
| 视觉设计 | `visual` | `visualDesign.ts` | `visualSimulation` | ✅ 已实现 |
| 大健康 | `health` | `health.ts` | `healthSimulation` | ✅ 已实现 |
| 交通物流 | `transportation` | `transportation.ts` | `transportationSimulation` | ✅ 已实现 |
| 能源 | `energy` | `energy.ts` | `energySimulation` | ✅ 已实现 |
| 化工 | `chemical` | - | - | ⏸️ 未实现 |
| 环保 | `environmental` | - | - | ⏸️ 未实现 |
| 土木 | `civil` | `civilEngineering.ts` | `civilEngineeringSimulation` | ✅ 已实现 |
## 最近修改记录 (2025-10-02)
### 交通物流订单班统一命名
**问题**:
- orderClasses.json 中 ID 为 `transportation`
- simulationMap 中 key 为 `logistics`
- 导致点击"交通物流"模版无法触发终端模拟
**解决方案**:
1. 重命名文件:`logistics.ts``transportation.ts`
2. 更新函数名:`logisticsSimulation()``transportationSimulation()`
3. 更新变量名:`logisticsAgents``transportationAgents`
4. 更新 orderClassId`'logistics'``'transportation'`
5. 更新 index.ts 导入语句和 simulationMap 注册
### 智能制造订单班ID修正
**问题**: orderClasses.json 中 ID 为 `manufacture`,但 simulationMap 中为 `manufacturing`
**解决方案**: 修改 orderClasses.json 中的 ID`"manufacture"``"manufacturing"`
## 关键文件位置
- **订单班配置**: `/web_frontend/exhibition-demo/src/data/orderClasses.json`
- **模拟数据映射**: `/web_frontend/exhibition-demo/src/data/terminalSimulations/index.ts`
- **各订单班模拟数据**: `/web_frontend/exhibition-demo/src/data/terminalSimulations/*.ts`
## 添加新订单班的流程
1.`orderClasses.json` 中添加订单班配置,设定统一的 `id`
2. 创建 `/terminalSimulations/{id}.ts` 文件
3. 导出函数命名为 `{id}Simulation`
4.`index.ts` 中导入并注册到 `simulationMap`
5. 确保 orderClassId 与配置文件中的 id 一致
## 注意事项
- ⚠️ **切勿使用不同的命名**orderClasses.json 的 ID 必须与 simulationMap 的 key 完全一致
- ⚠️ **函数命名规范**:导出函数应命名为 `{id}Simulation`,如 `transportationSimulation`
- ⚠️ **变量命名规范**Agent 数组应命名为 `{id}Agents`,如 `transportationAgents`
-**ID 使用英文单词**:优先使用完整、直观的英文单词,如 `transportation` 而不是 `logistics`