# MES-UI 搬迁任务列表

> 从旧项目 `D:\code\company\SCTMES_MES_V5\vue-app` 搬迁至本项目 `d:\code\mes\mes-ui`

## 搬迁规则

| 规则 | 说明 |
|------|------|
| 目录结构 | 按 `后台Webman界面截图对照表.md` 中的 一级→二级→三级 模块层级创建 |
| 页面视图 | `src/views/{一级}/{二级}/{三级}/index.vue` |
| API 接口 | `src/api/{一级}/{二级}.js` |
| Vuex Store | `src/store/modules/{一级}/{二级}.js` |
| 路由 | `src/router/modules/{一级}.js`，汇总到 `routes.js` |
| 组件 | 公用组件放 `src/components/`，模块内组件放 `views` 下的 `components/` |
| 表格 | 搬迁时统一替换为 `page-table` 或 `sct-table` + `sct-toolbar`（见 [重构方案](./SCT基础表格重构设计.md)），不再使用旧的 `sct-base-table` |
| 代码审查 | 搬迁前检查旧代码中的不合理处（见下方「代码审查与改进清单」），搬迁时一并修复 |

---

## 预览：前置准备

| ID | 任务 | 源文件 | 目标位置 | 状态 |
|----|------|--------|----------|:----:|
| P0 | 创建目标目录结构（所有一级/二级/三级空文件夹） | — | `src/views/` | ⬜ |
| P1 | 迁移公共服务层（axios 实例、工具函数等） | `src/api/service.js` `src/api/tools.js` `src/api/index.js` `src/libs/` | `src/api/` `src/libs/` | ⬜ |
| P2 | 迁移登录页面、首页、404/刷新/重定向等系统通用页面 | `src/views/system_settings/system_monitoring/system/` `src/views/system_settings/home_page/` | `src/views/system-settings/` | ⬜ |
| P3 | 迁移路由入口和 routes.js 汇总 | `src/router/index.js` `src/router/routes.js` | `src/router/` | ⬜ |
| P4 | 迁移全局 Store（d2admin） | `src/store/modules/d2admin/` | `src/store/modules/d2admin/` | ⬜ |
| P5 | 迁移布局组件（header-aside）及菜单配置 | `src/layout/` `src/menu/` | `src/layout/` `src/menu/` | ⬜ |
| P6 | 迁移第三方依赖（main.js 中的插件、组件注册） | `src/main.js` `src/App.vue` `src/plugin/` | `src/main.js` `src/App.vue` `src/plugin/` | ⬜ |
| P7 | 迁移本地化文件（i18n） | `src/locales/` `src/i18n.js` | `src/locales/` `src/i18n.js` | ⬜ |
| P8 | 迁移全局设置 | `src/setting.js` `.env` 系列 | `src/setting.js` `.env` 系列 | ⬜ |
| P9 | 移植旧项目专用组件（form、sct-ace 等） | `src/components/battery/` `src/components/calculation/` `src/components/device-monitor/` `src/components/dm-print/` `src/components/form/` `src/components/menu-tree/` `src/components/sct-ace/` `src/components/sct-ace-editor/` `src/components/OCR/` | `src/components/` | ⬜ |
| P10 | 迁移旧项目 public 目录下的静态资源 | `public/` | `public/` | ⬜ |
| P11 | 迁移旧项目 assets 资源 | `src/assets/` | `src/assets/` | ⬜ |

---

## 一、系统设置 (System Administration)

> 目标目录根：`src/views/system-settings/`

### 1.1 用户管理 (User Management)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| S1 | 角色 (Role) | `system_settings/user_management/role/` | `system_settings/user_management/role.js` | `sctmesadmin/modules/role.js` | `system-settings/user-management/role/` | ⬜ |
| S2 | 用户 (User) | `system_settings/user_management/user/` | `system_settings/user_management/user.js` | `sctmesadmin/modules/user.js` | `system-settings/user-management/user/` | ⬜ |

### 1.2 菜单管理 (Menu Management)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| S3 | 菜单配置 | `system_settings/menu_configuration/menu/` | `system_settings/menu_configuration/menu.js` | `system-settings/menu-management/menu-configuration/` | ⬜ |

### 1.3 系统助手 (System Utilities)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| S4 | 操作日志 | `system_settings/system_assistant/operate_log/` | `system_settings/system_assistant/operate_log.js` | `system-settings/system-utilities/operation-logs/` | ⬜ |
| S5 | 接口日志 | `system_settings/system_assistant/interface_log/` | `system_settings/system_assistant/interface_log.js` | `system-settings/system-utilities/api-logs/` | ⬜ |

### 1.4 系统监控 (System Monitoring)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| S6 | 监控设置 | `system_settings/system_monitoring/setting/` | `system_settings/system_monitor/setting.js` | `system-settings/system-monitoring/monitoring-configuration/` | ⬜ |

### 1.5 系统设置 - 路由汇总

| ID | 任务 | 源文件 | 目标位置 | 状态 |
|----|------|--------|----------|:----:|
| S7 | 系统设置路由 | `router/system_settings/system.js` | `router/modules/system-settings.js` | ⬜ |

---

## 二、生产配置 (Production Master Data)

> 目标目录根：`src/views/production-configuration/`

### 2.1 工厂模型 (Factory Model)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| P1 | 产线设置 | `production_configuration/factory_model/factory_line/` | 需从路由确认 | `sctmesadmin/modules/line.js` | `production-configuration/factory-model/production-line/` | ⬜ |
| P2 | 工厂区域 | `production_configuration/factory_model/factory_area/` | 需从路由确认 | `sctmesadmin/modules/area.js` | `production-configuration/factory-model/factory-area/` | ⬜ |

### 2.2 工艺模型 (Process Model)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| P3 | 工艺流程类别 | `production_configuration/technology_model/technology_flow_category/` | 需从路由确认 | `sctmesadmin/modules/technology_category.js` | `production-configuration/process-model/process-category/` | ⬜ |
| P4 | 工序单元 | 需确认 | `production_configuration/workerman/workermanSet.js` | `sctmesadmin/modules/steps.js` | `production-configuration/process-model/process-step/` | ⬜ |
| P5 | 工艺流程 | `production_configuration/technology_model/technology_flow/` | 需从路由确认 | `sctmesadmin/modules/technologyflow.js` | `production-configuration/process-model/process-routing/` | ⬜ |

### 2.3 产品管理 (Product Management)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| P6 | 产品列表 | `production_configuration/product_model/battery_model/` | 需从路由确认 | `sctmesadmin/modules/product_battery.js` | `production-configuration/product-management/product-list/` | ⬜ |
| P7 | 不良管理 | `production_configuration/product_model/product_ng_info/` | 需从路由确认 | `sctmesadmin/modules/product_ng_info.js` | `production-configuration/product-management/defect-management/` | ⬜ |

### 2.4 物料模型 (Material Model)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| P8 | 物料类别列表 | `production_configuration/matetial_model/matetial_category/` | `warehouse/basic/material_category.js` | `sctmesadmin/modules/material_category.js` | `production-configuration/material-model/material-category/` | ⬜ |
| P9 | 物料信息管理 | `production_configuration/matetial_model/matetial_management/` | `warehouse/basic/material.js` | — | `production-configuration/material-model/material-master/` | ⬜ |
| P10 | BOM物料清单 | `production_configuration/matetial_model/bom/` | `production_configuration/matetial_model/bom.js` | — | `production-configuration/material-model/bom/` | ⬜ |
| P11 | 计量单位 | `production_configuration/matetial_model/unit/` | `production_configuration/matetial_model/unit.js` | `sctmesadmin/modules/unit.js` | `production-configuration/material-model/unit-of-measure/` | ⬜ |

### 2.5 SPC采集模型 (SPC Configuration)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| P12 | SPC采集配置 | `production_configuration/spc_configuration/binding_scada_node/` | 需从路由确认 | `production-configuration/spc-configuration/spc-data-collection/` | ⬜ |

### 2.6 班组模型 (Team Model)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| P13 | 班组管理 | `system_settings/organization/production_team_manage/` | 需从路由确认 | `sctmesadmin/modules/production_team_manage.js` | `production-configuration/team-model/team-management/` | ⬜ |
| P14 | 班次管理 | `system_settings/organization/production_shift_management/` | 需从路由确认 | — | `production-configuration/team-model/shift-management/` | ⬜ |
| P15 | 排班日历 | `system_settings/organization/production_shift_calender/` | 需从路由确认 | — | `production-configuration/team-model/scheduling-calendar/` | ⬜ |

### 2.7 生产配置 - 路由汇总

| ID | 任务 | 源文件 | 目标位置 | 状态 |
|----|------|--------|----------|:----:|
| P16 | 生产配置路由 | `router/production_configuration/index.js` | `router/modules/production-configuration.js` | ⬜ |

---

## 三、设备模型 (Equipment Management)

> 目标目录根：`src/views/equipment-management/`

### 3.1 设备类别 (Equipment Category)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| E1 | 设备类别 | `production_configuration/device_model/device_category/` | 需从路由确认 | `sctmesadmin/modules/device_category.js` | `equipment-management/equipment-category/` | ⬜ |

### 3.2 设备信息 (Equipment Info)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| E2 | 设备信息 | `production_configuration/device_model/device_management/` | 需从路由确认 | `sctmesadmin/modules/device.js` | `equipment-management/equipment-info/` | ⬜ |

### 3.3 设备点检 (Inspection Management)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| E3 | 设备点检项目 | `device_management/device_check/device_check_items/` | 需从路由确认 | `sctmesadmin/modules/device_check_items.js` | `equipment-management/inspection-management/inspection-items/` | ⬜ |
| E4 | 设备点检记录 | `device_management/device_check/device_check_record/` | 需从路由确认 | — | `equipment-management/inspection-management/inspection-records/` | ⬜ |
| E5 | 设备点检日志 | `device_management/device_check/device_check_items_log/` | 需从路由确认 | — | `equipment-management/inspection-management/inspection-logs/` | ⬜ |

### 3.4 设备保养 (Maintenance Management)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| E6 | 设备保养项目 | `device_management/device_maintain/device_maintain_items/` | 需从路由确认 | `sctmesadmin/modules/device_maintain_items.js` | `equipment-management/maintenance-management/maintenance-items/` | ⬜ |
| E7 | 设备保养详情 | `device_management/device_maintain/device_maintain_items_details/` | 需从路由确认 | — | `equipment-management/maintenance-management/maintenance-details/` | ⬜ |
| E8 | 设备保养日志 | `device_management/device_maintain/device_maintain_items_log/` | 需从路由确认 | — | `equipment-management/maintenance-management/maintenance-logs/` | ⬜ |

### 3.5 设备维修 (Repair Management)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| E9 | 设备维修管理 | `device_management/device_repair/device_repair_management/` | 需从路由确认 | `equipment-management/repair-management/repair-management/` | ⬜ |
| E10 | 设备维修日志 | `device_management/device_repair/device_repair_log/` | 需从路由确认 | `equipment-management/repair-management/repair-logs/` | ⬜ |

### 3.6 设备损耗品 (Consumables Management)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| E11 | 设备损耗品类别 | `device_management/device_consumables/device_consumables_category/` | 需从路由确认 | `sctmesadmin/modules/device_consumables_category.js` | `equipment-management/consumables/consumables-category/` | ⬜ |
| E12 | 设备损耗品项目 | `device_management/device_consumables/device_consumables_items/` | 需从路由确认 | `sctmesadmin/modules/device_consumables_items.js` | `equipment-management/consumables/consumables-items/` | ⬜ |
| E13 | 设备损耗品寿命管理 | 需确认 | 需从路由确认 | `sctmesadmin/modules/device_consumables_lifetime_management.js` | `equipment-management/consumables/consumables-lifecycle/` | ⬜ |
| E14 | 设备损耗品更换日志 | `device_management/device_consumables/device_consumables_replace_log/` | 需从路由确认 | — | `equipment-management/consumables/replacement-logs/` | ⬜ |

### 3.7 设备模型 - 路由汇总

| ID | 任务 | 源文件 | 目标位置 | 状态 |
|----|------|--------|----------|:----:|
| E15 | 设备模型路由 | `router/device_management/device.js` | `router/modules/equipment-management.js` | ⬜ |

---

## 四、计划与生产 (Planning & Production)

> 目标目录根：`src/views/planning-production/`

### 4.1 生产批次管理 (Batch Management)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| B1 | 批次列表 | `planning_production/production_batch_management/batch/` | `data_dashboards/produce/batch.js` | `sctmesadmin/modules/batch.js` | `planning-production/batch-management/batch-list/` | ⬜ |
| B2 | 批次托盘 | `planning_production/production_batch_management/batch_tray/` | 需从路由确认 | — | `planning-production/batch-management/tray-tracking/` | ⬜ |
| B3 | 生产批次不良报表 | `planning_production/production_batch_management/bad/` | 需从路由确认 | — | `planning-production/batch-management/batch-defect-report/` | ⬜ |

### 4.2 预警中心 (Alert Center)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| B4 | 预警中心 | 需确认（可能在 pannel/index） | `planning_production/pannel/index.js` | `planning-production/alert-center/` | ⬜ |

### 4.3 生产监控 (Production Monitoring)

| ID | 三级模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|---------|---------|--------|----------|-----------|:----:|
| B5 | 物料监控 | `planning_production/produce/monitor/wareroom/ic/` 或 WIP | `data_dashboards/produce/material/wip.js` | — | `planning-production/production-monitoring/material-monitoring/` | ⬜ |
| B6 | 电池复投管理 | 需确认 | `data_dashboards/produce/battery/replace.js` | — | `planning-production/production-monitoring/rework-management/` | ⬜ |
| B7 | 托盘管理 | `planning_production/produce/monitor/tray_manage/` | `data_dashboards/produce/tray/list.js` `planning_production/produce/tray_manage.js` | — | `planning-production/production-monitoring/tray-management/` | ⬜ |
| B8 | 托盘登录 | `planning_production/produce/monitor/tray_login/` | `planning_production/battery/login.js` `planning_production/produce/tray_login.js` | — | `planning-production/production-monitoring/tray-registration/` | ⬜ |
| B9 | 设备监控 | `planning_production/produce/monitor/device/` | `data_dashboards/produce/report/device.js` | — | `planning-production/production-monitoring/equipment-monitoring/` | ⬜ |
| B10 | 电池工序管理 | `planning_production/produce/monitor/batch_battery/` 等 | `planning_production/produce/batch_battery.js` | `sctmesadmin/modules/batch_battery.js` | `planning-production/production-monitoring/process-execution/` | ⬜ |

### 4.4 计划与生产 - 路由汇总

| ID | 任务 | 源文件 | 目标位置 | 状态 |
|----|------|--------|----------|:----:|
| B11 | 计划与生产路由 | `router/planning_production/index.js` | `router/modules/planning-production.js` | ⬜ |

---

## 五、质量管理 (Quality Management)

> 目标目录根：`src/views/quality-management/`

### 5.1 过程控制 (Process Control)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| Q1 | 检验类别管理 | `quality_control/first_inspection/category/` | `quality_control/xqc/inspection_category.js` | `quality-management/process-control/inspection-type/` | ⬜ |
| Q2 | 首巡检项目配置 | `quality_control/first_inspection/setting/` | 需从路由确认 | `quality-management/process-control/first-article-inspection-config/` | ⬜ |
| Q3 | 首巡检录入 | `quality_control/first_inspection/input/` | 需从路由确认 | `quality-management/process-control/first-article-inspection-records/` | ⬜ |
| Q4 | 首巡检报表 | `quality_control/first_inspection/report/` | 需从路由确认 | `quality-management/process-control/first-article-inspection-reports/` | ⬜ |

### 5.2 检验控制 (Inspection Management)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| Q5 | 检验单管理 | `quality_control/xqc/inspection_order_manage/` | `quality_control/xqc/inspection_order_manage.js` | `quality-management/inspection-control/inspection-orders/` | ⬜ |
| Q6 | 检验标准 | `quality_control/xqc/inspection_standard/` | `quality_control/xqc/inspection_standard.js` | `quality-management/inspection-control/inspection-standards/` | ⬜ |
| Q7 | 接收质量限 (AQL) | `quality_control/xqc/aql_config/` `quality_control/xqc/aql_sample/` | `quality_control/xqc/aql_config.js` `quality_control/xqc/aql_sample.js` | `quality-management/inspection-control/aql-standards/` | ⬜ |
| Q8 | 检测方案维护 | `quality_control/xqc/inspection_plan/` | `quality_control/xqc/inspection_plan.js` | `quality-management/inspection-control/inspection-plans/` | ⬜ |
| Q9 | 检验项目 | `quality_control/xqc/inspection_item/` | `quality_control/xqc/inspection_item.js` | `quality-management/inspection-control/inspection-items/` | ⬜ |
| Q10 | 抽样方案配置 | `quality_control/xqc/sampling_plan/` | `quality_control/xqc/sampling_plan.js` | `quality-management/inspection-control/sampling-plans/` | ⬜ |

### 5.3 SPC统计过程控制 (SPC Control)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| Q11 | SPC渲染条件配置 | `spc/manage/` | `spc/index.js` | `quality-management/spc-control/spc-configuration/` | ⬜ |

### 5.4 SPC计量型报表 (SPC Variable Charts)

| ID | 图表 | 源 views | 目标 views | 状态 |
|----|------|---------|----------|:----:|
| Q12 | XBar-R | `spc/spc_chart/xbar-r/` | `quality-management/spc-variable-charts/xbar-r/` | ⬜ |
| Q13 | XBar-S | `spc/spc_chart/xbar-s/` | `quality-management/spc-variable-charts/xbar-s/` | ⬜ |
| Q14 | I-MR | `spc/spc_chart/i-mr/` | `quality-management/spc-variable-charts/i-mr/` | ⬜ |
| Q15 | Levey-Jennings | `spc/spc_chart/levey-jennings/` | `quality-management/spc-variable-charts/levey-jennings/` | ⬜ |
| Q16 | EWMA | `spc/spc_chart/ewma/` | `quality-management/spc-variable-charts/ewma/` | ⬜ |
| Q17 | CUSUM | `spc/spc_chart/cusum/` | `quality-management/spc-variable-charts/cusum/` | ⬜ |
| Q18 | MA | `spc/spc_chart/ma/` | `quality-management/spc-variable-charts/ma/` | ⬜ |
| Q19 | MAMR | `spc/spc_chart/mamr/` | `quality-management/spc-variable-charts/mamr/` | ⬜ |
| Q20 | MAMS | `spc/spc_chart/mams/` | `quality-management/spc-variable-charts/mams/` | ⬜ |
| Q21 | CPK | `spc/spc_chart/Cpk/` | `quality-management/spc-variable-charts/cpk/` | ⬜ |

### 5.5 SPC计数型报表 (SPC Attribute Charts)

| ID | 图表 | 源 views | 目标 views | 状态 |
|----|------|---------|----------|:----:|
| Q22 | DPMO | `spc/spc_chart/dpmo/` | `quality-management/spc-attribute-charts/dpmo/` | ⬜ |
| Q23 | PChart | `spc/spc_chart/p-chart/` | `quality-management/spc-attribute-charts/p-chart/` | ⬜ |
| Q24 | NPChart | `spc/spc_chart/np-chart/` | `quality-management/spc-attribute-charts/np-chart/` | ⬜ |
| Q25 | CChart | `spc/spc_chart/c-chart/` | `quality-management/spc-attribute-charts/c-chart/` | ⬜ |
| Q26 | UChart | `spc/spc_chart/u-chart/` | `quality-management/spc-attribute-charts/u-chart/` | ⬜ |

### 5.6 质量管理 - 路由汇总

| ID | 任务 | 源文件 | 目标位置 | 状态 |
|----|------|--------|----------|:----:|
| Q27 | 质量管理路由 | `router/quality_control/quality.js` | `router/modules/quality-management.js` | ⬜ |
| Q28 | SPC路由 | `router/spc/index.js` | 合并到 `router/modules/quality-management.js` | ⬜ |

---

## 六、数据中台 (Data Platform)

> 目标目录根：`src/views/data-platform/`

### 6.1 基础追溯 (Traceability)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| D1 | 反向追溯 | `data_middleground/basic_traceability/reverse_direction_traceability/` 或正向追溯 | `data_dashboards/produce/traceability/battery.js` | `data-platform/traceability/backward/` | ⬜ |
| D2 | 正向追溯 | `data_middleground/basic_traceability/` 下确认 | `data_dashboards/produce/traceability/bom_batch.js` | `data-platform/traceability/forward/` | ⬜ |
| D3 | 电池曲线 | `planning_production/produce/traceability/curve/` | `data_dashboards/produce/traceability/curve.js` | `data-platform/traceability/battery-curve/` | ⬜ |
| D4 | 托盘追溯 | `planning_production/produce/traceability/tray/` | `data_dashboards/produce/traceability/tray.js` | `data-platform/traceability/tray/` | ⬜ |
| D5 | 电池追溯 | `planning_production/produce/traceability/battery/` | `data_dashboards/produce/traceability/battery.js` | `data-platform/traceability/battery/` | ⬜ |

### 6.2 生产报表 (Production Reports)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| D6 | 设备履历报表 | `planning_production/produce/report/battery/` 或设备报告 | `data_dashboards/produce/report/all_report.js` `data_dashboards/produce/report/device.js` | `data-platform/production-reports/equipment-history/` | ⬜ |
| D7 | 电池详情报表 | `planning_production/produce/report/battery_details_report/` 或电池报告 | `data_dashboards/produce/report/battery.js` | `data-platform/production-reports/battery-detail/` | ⬜ |

### 6.3 相关性分析 (Correlation Analysis)

| ID | 三级模块 | 源 views | 源 api | 目标 views | 状态 |
|----|---------|---------|--------|----------|:----:|
| D8 | 鹰眼 (Hawkeye) | `data_middleground/eagle_eyes/` | `data_middle_office/eagle_eyes/index.js` | `data-platform/correlation-analysis/hawkeye/` | ⬜ |

### 6.4 数据中台 - 路由汇总

| ID | 任务 | 源文件 | 目标位置 | 状态 |
|----|------|--------|----------|:----:|
| D9 | 数据中台路由 | `router/data_middleground/index.js` | `router/modules/data-platform.js` | ⬜ |

---

## 七、仓储管理 (Warehouse)

> 目标目录根：`src/views/warehouse/`

| ID | 模块 | 源 views | 源 api | 源 store | 目标 views | 状态 |
|----|------|---------|--------|----------|-----------|:----:|
| W1 | 仓库设置（业务类型/单据类型/仓库/库区/库位/货架） | `warehouse/setting/` | `warehouse/setting/` | `warehouse/modules/` | `warehouse/settings/` | ⬜ |
| W2 | 基础数据（客户/物料类别/物料/供应商/领料单） | `warehouse/basic/` | `warehouse/basic/` | `warehouse/modules/` | `warehouse/basic/` | ⬜ |
| W3 | ERP接口（接口/采购订单/产品出库/发送日志） | `warehouse/erp/` | `warehouse/erp/` | — | `warehouse/erp/` | ⬜ |
| W4 | 收货管理（采购入库/打印/来料检验/上架等） | `warehouse/receiving_management/` | `warehouse/receiving_management/` | — | `warehouse/receiving/` | ⬜ |
| W5 | 发货管理（出库/委外出库等） | `warehouse/shipping_management/` | 需确认 | — | `warehouse/shipping/` | ⬜ |
| W6 | 库存管理（库存/冻结/锁定/操作日志） | `warehouse/stock_management/` | `warehouse/stock_management/` | — | `warehouse/stock/` | ⬜ |
| W7 | 作业管理（库存移动/盘点） | `warehouse/working/` | `warehouse/working/` | — | `warehouse/operations/` | ⬜ |
| W8 | 仓储路由 | `router/warehouse/index.js` | — | — | `router/modules/warehouse.js` | ⬜ |

---

## 八、SCADA管理（保留旧模块，不在主文档中）

> 目标目录根：`src/views/scada-management/`

| ID | 模块 | 源 views | 源 api | 目标 views | 状态 |
|----|------|---------|--------|----------|:----:|
| SC1 | 车间管理（配置/点位） | `scada_manage/workshop_manage/` | `scada_manage/workshop_manage/` | `scada-management/workshop/` | ⬜ |
| SC2 | 基础配置（SCADA配置/查询/节点映射/EMS） | `scada_manage/basic_configuration/` | `modules/scada.configure.api.js` | `scada-management/basic-config/` | ⬜ |
| SC3 | 边缘服务器（配置/监控/日志） | `scada_manage/lecpserver/` `scada_manage/EdgeProcessorsManage/` | `modules/edgeServer.api.js` | `scada-management/edge-server/` | ⬜ |
| SC4 | 设备采集监控 | `scada_manage/device_gather/` | `scada_manage/huankong_management/` | `scada-management/device-gather/` | ⬜ |
| SC5 | SCADA路由 | `router/scada_management/scada.js` | — | `router/modules/scada-management.js` | ⬜ |

---

## 代码审查与改进清单

> 在搬迁过程中，逐项检查旧代码中的不合理之处，搬迁时一并修复。每个问题标注 **发现时间** 和 **处理状态**。

### 🔴 严重问题（必须修复）

| # | 问题描述 | 影响范围 | 改进方案 | 状态 |
|---|---------|---------|---------|:--:|
| CR01 | **拼写错误遍布路由和目录名**：`matetial`→应为`material`，`freezeunfreeze`→`freeze-unfreeze`，出现 23+ 处 | `router/production_configuration/index.js`<br>`views/production_configuration/matetial_model/` | 搬迁时统一修正为正确拼写，路由 path 也一并修正 | ⬜ |
| CR02 | **生产代码残留 `console.log`**：285+ 处 `console.log/warn/error` 分布在 100+ 个文件中 | `src/views/` 几乎所有模块 | 移除所有调试用 `console.log`，仅保留关键 `console.error` 并使用统一日志工具 `util.log` | ⬜ |
| CR03 | **重复/拷贝目录残留**：`scada_query copy/` 显式拷贝备份目录 | `views/scada_manage/basic_configuration/scada_query copy/` | 删除该拷贝目录，如需要保留则合并到正式目录 | ⬜ |

### 🟡 中等问题（建议修复）

| # | 问题描述 | 影响范围 | 改进方案 | 状态 |
|---|---------|---------|---------|:--:|
| CR04 | **API 注入模式混乱**：旧模式用 `require.context` 动态注入（`api/modules/*.api.js`），新模式用直接 `import`（`api/system_settings/`），两套并存 | `api/index.js` + `api/modules/` | 统一为直接 `import` 模式，移除 `require.context` 动态注入和 `api/modules/` 目录 | ⬜ |
| CR05 | **`let` 滥用**：API 文件中大量 `let url = urls + 'xxx'`，URL 拼接后从不重新赋值 | `api/` 下所有文件 | 全部改为 `const` | ⬜ |
| CR06 | **Store 初始化直接用 `localStorage` 无容错**：`JSON.parse(localStorage.getItem('roleData'))` 放在 state 声明顶层，解析失败会导致模块加载崩溃 | `store/modules/sctmesadmin/modules/role.js` 等 36 个模块 | 改为在 getter 或 action 中惰性读取，并用 try-catch 包裹 `JSON.parse` | ⬜ |
| CR07 | **每个 API 函数都手动传 `method` 和 `platform` 参数**，冗余且容易遗漏 | `api/` 下 80+ 文件 | 在 `request` 公共层统一注入 `platform: 'background'`；`method` 参数通过约定 url 自动映射 | ⬜ |
| CR08 | **axios 拦截器 `switch-case` 冗长**：响应拦截器整段 switch-case 映射 HTTP 状态码到错误消息 | `api/service.js` | 改用 Map 结构 | error.message = statusMessages[status] \|\| error.message，更简洁 | ⬜ |
| CR09 | **路由文件命名不一致**：有 `system.js`、`device.js`、`scada.js`、`index.js` 混用 | `router/` 所有文件 | 统一为 `index.js`，按文件夹区分模块 | ⬜ |
| CR10 | **`system_Assistant` 大小写不一致**：路由 path 中是 `system_Assistant`（大写A），目录名是 `system_assistant`（小写a） | `router/system_settings/system.js` | 统一为 `system-assistant`（kebab-case） | ⬜ |
| CR11 | **Store 模块 `namespaced: true` 命名不规范**：部分模块路径很深 `sctmesadmin/modules/xxx`，难以维护 | `store/modules/sctmesadmin/` | 按功能打平为 `store/modules/{功能名}.js`，去掉多余嵌套 | ⬜ |

### 🟢 建议优化（可选）

| # | 问题描述 | 影响范围 | 改进方案 | 状态 |
|---|---------|---------|---------|:--:|
| CR12 | **页面组件 `PageHeader/PageMain` 内联模式冗余**：绝大多数页面都是 `index.vue` + `components/PageHeader/index.vue` + `components/PageMain/index.vue` 三层结构，PageHeader 大多只传几个 props | 所有 views | 评估是否可将简单的 PageHeader/PageMain 合并为单文件组件，减少目录嵌套 | ⬜ |
| CR13 | **`Promise.resolve(...)` 包裹 sync 数据**：Store actions 中 `return Promise.resolve(res.data)` 在 `async` 函数里是多余的 | `store/modules/` 所有 actions | 直接 `return res.data`，`async` 函数自动包装返回值 | ⬜ |
| CR14 | **国际化键名硬编码**：大量组件中 `$t('xxx')` 的 key 没有类型约束，容易拼错 | 所有 Vue 组件 | 搬迁后统一整理 i18n key，考虑用常量池管理 | ⬜ |
| CR15 | **公共组件未按功能分组**：`components/` 下散落 `battery/`、`calculation/`、`tray/`、`technology/` 等多个业务组件与通用组件混放 | `src/components/` | 业务组件迁入对应模块 views 的 `components/`，公共组件保留并文档化 | ⬜ |
| CR16 | **`sct-base-table` 组件架构臃肿**：215 行代码包含致命 bug（引入 yargs）、60% 死代码、buttonList/columns 在 100+ 页面中重复定义 | `components/sct-base-table/` 及所有引用页面 | 📄 详见 [SCT基础表格重构设计](./SCT基础表格重构设计.md)：拆分为 7 个小组件 + 5 个 composable 函数，消除重复，迁移与搬迁同步进行 | ⬜ |

### 📄 专项重构方案

| 文档 | 说明 |
|------|------|
| [SCT基础表格重构设计](./SCT基础表格重构设计.md) | 组合式重构：拆组件+composable，消除 buttonList/columns 手动定义，覆盖 100+ 页面 |

---

## 搬迁统计

| 一级模块 | 三级页面数 | 路由文件 | API文件 | Store模块 | 已完成 |
|---------|-----------|---------|---------|----------|:----:|
| 系统设置 | 6 | 1 | 5 | 2 | 0/13 |
| 生产配置 | 15 | 1 | ~10 | 12 | 0/37 |
| 设备模型 | 14 | 1 | ~10 | 7 | 0/31 |
| 计划与生产 | 10 | 1 | ~8 | 3 | 0/21 |
| 质量管理 | 26 | 2 | ~15 | 0 | 0/43 |
| 数据中台 | 8 | 1 | ~8 | 0 | 0/17 |
| 仓储管理 | 25+ | 1 | ~20 | 11 | 0/56 |
| SCADA管理 | 10+ | 1 | ~6 | 0 | 0/16 |
| 前置准备 | — | 2 | — | 1 | 0/11 |
| **合计** | **114+** | **11** | **82+** | **36** | **0/245** |

---

## 搬迁流程说明

每条 ID 任务完成后，将状态从 ⬜ 改为 ✅，并在下方补充日期和备注。

示例：
```
| S1 | 角色 (Role) | `...` | `...` | `...` | ✅ |
```
