修复任务详情字段过滤契约

This commit is contained in:
andy
2026-07-13 08:50:06 +08:00
parent 890565d43f
commit b05001e481
7 changed files with 36 additions and 4 deletions

View File

@@ -242,6 +242,8 @@ Content-Type: application/json
后端已按 `docs/project/requirements/M002-task-field-control-contract-v1.md` 返回字段控件契约 V1。前端接入时注意
- 任务详情 `fields[]` 已新增 `control_type``edit_scope``write_target``options_source``raw_readonly``control_hint`
- 任务详情 `fields[]` 是后端按当前任务生效规则过滤后的字段集合,不是完整字段矩阵;前端不得自行补齐后端未返回的字段,也不要依赖固定 `fields.length`
- 未出现在 `fields[]` 的字段表示当前任务不展示、不校验、不提交。例如 `new_group_block` 不返回 FIT 专属 `case_keys.confirmation_number`,也不返回 Allotment 专属 `extracted_fields.child_room_items[]`;无附件时可以不返回 `attachments`
- 前端应优先按 `control_type` 渲染字段;旧 `input_editable``select_editable``date_picker``number_input``file_display``table_editable` 只作为兼容兜底。
- `raw_readonly=true``edit_scope=never/system_only``write_target=none` 的字段不能展示普通编辑控件。
- `source_message`、邮件正文、附件引用、raw evidence、`event_type``source_event_index`、关系索引、`route_code``result_type``task_type``task_subtype``manual_review.reason_code` 等字段必须只读。

View File

@@ -473,6 +473,8 @@ GET /api/reservation/tasks/{taskId}
已完成的 `fields[]` 字段:
返回口径:`fields[]` 是后端按当前任务生效规则过滤后的字段集合,不是完整字段矩阵。后端已经应用 `visible``result_type``task_type``task_subtype``display_condition`;未返回字段对当前任务视为不展示、不校验、不提交,前端不要自行补齐,也不要依赖固定字段数量。
| 字段 | 说明 |
| --- | --- |
| `row_number` | 字段矩阵行号。 |
@@ -643,6 +645,7 @@ Content-Type: application/json
中文说明:
- 如果前端只做“按后端字段直接渲染”,现有 `fields[]` 可以支撑第一版表单展示;本轮已经扩展 `ReservationTaskFieldResult`,避免前端维护第二套字段矩阵。
- `fields[]` 已是当前任务生效字段集合,前端不能把导入 Excel 或历史矩阵里的其他字段自行合成到页面上;例如 Group Block 不应补出 FIT 专属 Confirmation No. 输入框。
- `result_type``task_type``task_subtype``default_value_source` 当前从后端字段矩阵定义透出。
- 如果后端已有更细的字段来源或适用场景元数据,可后续再扩展 `field_source``applicable_scenario`,不作为本轮 P0 阻塞项。
- 前端默认不需要为 `GET /api/reservation/orders``GET /api/reservation/tasks``GET /api/reservation/orders/{orderId}` 自动拼 `hotel_id`;如已接入酒店选择器,可以传当前选中酒店,后端会校验访问权限。当前 `GET /api/reservation/tasks/{taskId}` 以及任务写操作 Controller 不接收 `hotel_id`;第一版先按 ID 定位,后续多酒店隔离 / 权限方案统一补齐。