Files
Excelbuilder/Agents/v5-只导出当前选中设备及其变量.md
2026-06-01 17:55:16 +08:00

36 lines
1.6 KiB
Markdown
Raw Permalink 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.
# v5只导出当前选中设备及其变量
## Summary
- 将“生成 Excel”从导出全部设备改为只导出左侧当前选中的设备。
- Excel 仍只包含两个 Sheet。
- `设备类型对应表` 只生成当前选中设备这一行。
- `MES_基本变量原始数据` 只生成当前选中设备对应的基本变量原始数据。
## Key Changes
- 导出数据范围:
- 新增一个“按设备构造导出数据”的工具逻辑。
- 该工具从完整 `tableData.devices` 中找到当前选中设备,只保留这一台设备及其 `variables`
- 页面导出行为:
- `handleExport()` 必须检查 `selectedDevice` 是否存在。
- 如果未选择设备,提示“请先选择要导出的设备”并阻止导出。
- 校验范围:
- 点击“生成 Excel”时只校验当前选中设备及其变量。
- Excel 内容:
- `设备类型对应表` 行数为表头 + 当前选中设备 1 行。
- `MES_基本变量原始数据` 行数为表头 + 当前设备变量行。
## Test Plan
- 选择 ST04 后点击生成 Excel
- `设备类型对应表` 只有 ST04 一条设备数据。
- `MES_基本变量原始数据` 只有 ST04 对应变量。
- 选择 ST05 后点击生成 Excel
- Excel 中不出现 ST04 数据。
- 未选择设备时点击生成 Excel
- 页面提示先选择设备。
- 不下载 Excel。
## Assumptions
- 页面仍维护所有设备和变量,只是 Excel 导出范围改成当前选中设备。
- “校验”按钮可以继续用于检查全量配置。
- 文件名仍保持 `SignalTable_CZ.xlsx`