Files
CalibratorLauncher/procedures/README_MOCK_DATA.md
2026-01-02 19:20:35 +09:00

97 lines
2.4 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.

# Mock Procedures 数据说明
## 文件位置
`procedures/mock_procedures.json`
## 数据结构
```json
{
"mockProcedures": [
{
"id": "规程ID",
"name": "规程名称",
"version": "版本号",
"description": "规程描述",
"taskGroups": [
{
"id": "任务组ID",
"name": "任务组名称",
"steps": [
{
"id": "步骤ID",
"type": "步骤类型",
"content": "步骤内容",
"status": "步骤状态",
"tableRefs": ["表格引用ID"],
"highlightFields": ["高亮字段ID"]
}
]
}
],
"tables": [
{
"id": "表格ID",
"name": "表格名称",
"description": "表格描述(可选)",
"columns": [
{
"id": "字段ID",
"name": "字段名称",
"type": "字段类型",
"unit": "单位(可选)",
"isRequired": false,
"isHighlighted": false
}
]
}
],
"totalSteps": 总步骤数(可选,会自动计算),
"completedSteps": 已完成步骤数(可选,会自动计算)
}
]
}
```
## 枚举值说明
### 步骤类型 (type)
- `Manual`: 手动步骤
- `Automatic`: 自动步骤
### 步骤状态 (status)
- `Pending`: 待执行
- `InProgress`: 执行中
- `Confirmed`: 已确认(手动)
- `Passed`: 已通过
- `Failed`: 未通过
- `Skipped`: 已跳过
### 字段类型 (type)
- `text`: 文本
- `numeric`: 数值
- `boolean`: 布尔值
## 使用说明
1. **添加新的 Mock 规程**:在 `mockProcedures` 数组中添加新对象
2. **修改现有规程**:直接编辑对应的 JSON 对象
3. **删除规程**:从数组中移除对应的对象
## 注意事项
- JSON 中的特殊字符(如 `<`, `>`, `&`, `"`, `'`)会被正确处理,无需转义
- 多行文本使用 `\n` 表示换行
- 如果不提供 `totalSteps``completedSteps`,系统会自动计算
- `tableRefs``highlightFields` 是可选字段
## 当前 Mock 数据
1. **LONG_NAME_TEST**: 超长名称测试
2. **NO_VERSION**: 无版本号测试
3. **SPECIAL_CHAR_<>{}[]**: 特殊字符测试
4. **EMPTY_DESC**: 空描述测试
5. **LONG_DESC**: 超长描述测试23个步骤3个任务组
6. **TEST-2024-12-31_V1.0**: 日期戳测试
7. **MULTILINE**: 多行文本测试