From 7987d9a08576a280e602497c895ffa2c186f3b3b Mon Sep 17 00:00:00 2001 From: sheng <905537351@qq.com> Date: Mon, 22 Jun 2026 16:33:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=8F=8D=E5=90=91=E8=BF=BD?= =?UTF-8?q?=E6=BA=AF=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增数据中台反向追溯 V2 页面 - 新增反向追溯查询导出接口、旧路径路由和中英文文案 - 更新迁移任务列表并补充人工功能测试清单 --- docs/功能测试-反向追溯.md | 36 ++ docs/迁移任务列表.md | 6 +- .../data-platform/traceability/backward.js | 27 ++ src/locales/en.json | 38 ++ src/locales/zh-chs.json | 38 ++ src/router/modules/data-platform.js | 6 + .../traceability/backward/index.vue | 335 ++++++++++++++++++ 7 files changed, 483 insertions(+), 3 deletions(-) create mode 100644 docs/功能测试-反向追溯.md create mode 100644 src/api/data-platform/traceability/backward.js create mode 100644 src/views/data-platform/traceability/backward/index.vue diff --git a/docs/功能测试-反向追溯.md b/docs/功能测试-反向追溯.md new file mode 100644 index 00000000..d59c9cdc --- /dev/null +++ b/docs/功能测试-反向追溯.md @@ -0,0 +1,36 @@ +# 功能测试 - 反向追溯 + +> 模块:数据中台 / 基础追溯 / 反向追溯 (Backward Traceability) +> 路由:`/data_middleground/basic_traceability/reverse_direction_traceability` + +## 测试前置条件 + +- 测试账号具备访问“反向追溯”的菜单权限。 +- 准备至少 2 个电池条码: + - 一个存在完整反向追溯关系图的电池条码。 + - 一个不存在追溯数据或数据为空的电池条码。 +- 后端接口 `data_middleground/basic_traceability/reverse_direction_traceability/get_data` 和 `export_tree` 可正常访问。 + +## 测试任务列表 + +| 序号 | 测试项 | 操作步骤 | 预期结果 | +|---:|---|---|---| +| 1 | 页面入口 | 从菜单进入“反向追溯”,或直接访问 `/data_middleground/basic_traceability/reverse_direction_traceability` | 页面正常打开,显示电池条码输入框、查询、导出、重置按钮和空态区域 | +| 2 | 空输入查询 | 不输入电池条码,点击“查询” | 页面提示请输入电池条码,不发起有效查询 | +| 3 | 有效条码查询 | 输入存在追溯数据的电池条码,点击“查询” | 页面展示追溯节点树,节点包含物料名称、编码、批次、工序、时间、设备等信息 | +| 4 | 无数据条码查询 | 输入不存在追溯数据的电池条码,点击“查询” | 页面保持空态或显示无节点,不出现脚本错误 | +| 5 | 横向/纵向切换 | 查询出数据后,切换“横向图谱”和“纵向图谱” | 追溯节点展示方向切换,页面不丢失数据 | +| 6 | 物料编码定位 | 查询出数据后,输入某个节点的物料编码,点击定位确认 | 匹配节点高亮并滚动到可视区域 | +| 7 | 物料批次定位 | 输入某个节点的物料批次,点击定位确认 | 匹配节点高亮并滚动到可视区域 | +| 8 | 工序单元定位 | 输入某个制成品节点的工序单元编码,点击定位确认 | 匹配节点高亮并滚动到可视区域;不存在时提示未找到匹配节点 | +| 9 | 导出前校验 | 未输入电池条码时点击“导出” | 页面提示请输入电池条码 | +| 10 | 查询前导出 | 输入电池条码但未查询出追溯树,点击“导出” | 页面提示请先查询追溯数据后再导出 | +| 11 | 正常导出 | 查询出追溯树后点击“导出” | 调用导出接口,浏览器开始下载或打开导出文件 | +| 12 | 重置功能 | 查询出追溯树后点击“重置” | 输入框、追溯树、定位输入和高亮状态全部清空 | +| 13 | 国际化检查 | 切换中英文语言后重新进入页面 | 页面按钮、节点字段和提示文案随语言切换显示 | + +## 回归关注点 + +- 接口返回 `relation_graph.nodes` 或 `relation_graph.lines` 为空时页面不能报错。 +- 导出接口参数中的 `tree_list` 应为当前追溯树节点数组 JSON。 +- 路由参数携带 `battery_id` 时,页面应能自动查询对应追溯数据。 diff --git a/docs/迁移任务列表.md b/docs/迁移任务列表.md index bafe9c90..9904ca7f 100644 --- a/docs/迁移任务列表.md +++ b/docs/迁移任务列表.md @@ -3,8 +3,8 @@ > 根据 `后台Webman界面截图对照表.md` 生成。状态以当前 V2 项目中已落地的页面目录为准。 - 总功能数:79 -- 已迁移:27 -- 未迁移:52 +- 已迁移:28 +- 未迁移:51 | 状态 | 一级模块 | 二级模块 | 三级模块 | 功能说明 | V2 目标路径 | |:---:|---|---|---|---|---| @@ -79,7 +79,7 @@ | ⬜ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | NPChart (NP Chart) | | 待确认 | | ⬜ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | CChart (C Chart) | | 待确认 | | ⬜ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | UChart (U Chart) | | 待确认 | -| ⬜ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 反向追溯 (Backward Traceability) | | 待确认 | +| ✅ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 反向追溯 (Backward Traceability) | 反向追溯 | `src/views/data-platform/traceability/backward/` | | ⬜ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 正向追溯 (Forward Traceability) | | 待确认 | | ⬜ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 电池曲线 (Battery Curve) | | 待确认 | | ⬜ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 托盘追溯 (Tray Traceability) | | 待确认 | diff --git a/src/api/data-platform/traceability/backward.js b/src/api/data-platform/traceability/backward.js new file mode 100644 index 00000000..d39eb1c4 --- /dev/null +++ b/src/api/data-platform/traceability/backward.js @@ -0,0 +1,27 @@ +import { request } from '@/api/_service' + +const BASE = 'data_middleground/basic_traceability/reverse_direction_traceability/' + +function apiParams (method, data = {}) { + return { + method, + platform: 'background', + ...data + } +} + +export function getBackwardTraceabilityData (data) { + return request({ + url: BASE + 'get_data', + method: 'get', + params: apiParams('data_middleground_basic_traceability_reverse_direction_traceability_get_data', data) + }) +} + +export function exportBackwardTraceabilityTree (data) { + return request({ + url: BASE + 'export_tree', + method: 'post', + data: apiParams('data_middleground_basic_traceability_reverse_direction_traceability_export_tree', data) + }) +} diff --git a/src/locales/en.json b/src/locales/en.json index 021a65d6..bb4b43bb 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1187,6 +1187,44 @@ "accumulated_detail": "{device_name} ({device_code}): 10 Cumulative Error Details", "workstation_detail": "Workstation [{device_name}] Channel Error Details" } + }, + "data_platform": { + "traceability": { + "backward": { + "query": "Search", + "reset": "Reset", + "export": "Export", + "battery_id": "Battery Barcode", + "enter_battery_id": "Enter battery barcode", + "view_type": "Graph Layout", + "horizontal": "Horizontal", + "vertical": "Vertical", + "position": "Locate", + "enter_item_code": "Enter material code", + "enter_item_batch": "Enter material batch", + "enter_work_unit": "Enter process unit", + "item_name": "Material Name", + "item_code": "Material Code", + "item_batch": "Material Batch", + "work_unit": "Process Unit", + "work_unit_name": "Process Unit Name", + "process_code": "Process Code", + "operator": "Material Handler", + "start_time": "Feeding Time", + "finish_time": "Completion Time", + "confirm_position": "Confirm Location", + "reverse": "Reverse Traceability", + "center": "Center", + "inspection_person": "Inspector", + "inspection_time": "Inspection Time", + "quality_person": "Quality Reviewer", + "quality_time": "Quality Review Time", + "device_name": "Device Name", + "device_code": "Device Code", + "node_not_found": "No matching node found", + "query_before_export": "Query traceability data before export" + } + } } }, "__MENU_TEMP_BEGIN__": "===== 以下为临时菜单翻译,后续统一删除 =====", diff --git a/src/locales/zh-chs.json b/src/locales/zh-chs.json index 1b2bf083..4761d119 100644 --- a/src/locales/zh-chs.json +++ b/src/locales/zh-chs.json @@ -1187,6 +1187,44 @@ "accumulated_detail": "{device_name}({device_code}) 10次累计通道异常详情", "workstation_detail": "【{device_name}】工作站设备通道异常详情" } + }, + "data_platform": { + "traceability": { + "backward": { + "query": "查询", + "reset": "重置", + "export": "导出", + "battery_id": "电池条码", + "enter_battery_id": "请输入电池条码", + "view_type": "图谱形态", + "horizontal": "横向图谱", + "vertical": "纵向图谱", + "position": "定位", + "enter_item_code": "请输入物料编码", + "enter_item_batch": "请输入物料批次", + "enter_work_unit": "请输入工序单元", + "item_name": "物料名称", + "item_code": "物料编码", + "item_batch": "物料批次", + "work_unit": "工序单元", + "work_unit_name": "工序单元名称", + "process_code": "工序编码", + "operator": "卸料人", + "start_time": "投料时间", + "finish_time": "完成时间", + "confirm_position": "定位确认", + "reverse": "反向追溯", + "center": "中心", + "inspection_person": "点检人员", + "inspection_time": "点检时间", + "quality_person": "品质确认人员", + "quality_time": "品质确认时间", + "device_name": "设备名称", + "device_code": "设备编码", + "node_not_found": "未找到匹配节点", + "query_before_export": "请先查询追溯数据后再导出" + } + } } }, "__MENU_TEMP_BEGIN__": "===== 以下为临时菜单翻译,后续统一删除 =====", diff --git a/src/router/modules/data-platform.js b/src/router/modules/data-platform.js index 1723742e..85b4a438 100644 --- a/src/router/modules/data-platform.js +++ b/src/router/modules/data-platform.js @@ -13,6 +13,12 @@ export default { name: `${pre}index`, meta: { ...meta, title: '数据中台', root: '/data_middleground' }, component: _import('system/function/module-index') + }, + { + path: 'basic_traceability/reverse_direction_traceability', + name: `${pre}basic_traceability-reverse_direction_traceability`, + meta: { ...meta, cache: true, title: '反向追溯' }, + component: _import('data-platform/traceability/backward') } ])('data_middleground-') } diff --git a/src/views/data-platform/traceability/backward/index.vue b/src/views/data-platform/traceability/backward/index.vue new file mode 100644 index 00000000..081ef76d --- /dev/null +++ b/src/views/data-platform/traceability/backward/index.vue @@ -0,0 +1,335 @@ + + + + +