Files
dacli/tests/integration/drift
sswandClaude 9e21fea692 feat(form): R17 P1 启发式扩展 — AI 4 限制闭环 (jxcj M1 实战驱动)
P1-1 vm-to-jnpfKey 启发式 (form/_form_repair.ts):
- 新增 VM_RULES 6 条 + mapVmToJnpfKey 函数
- 优先级: vm 启发式 > label 启发式 (客观 > 主观)
- 修 AI 控件类型错选:
  - datetime + timePicker → datePicker (jxcj f_start_time)
  - text + 富文本 label → editor (jxcj f_introduction)
  - int + dict + 状态字段 → radio (jxcj f_state)
  - int + 数字字段名 → inputNumber
  - decimal → inputNumber
  - varchar(>500) + 长文本 → textarea

P1-2 upload 控件不标 required (form/_smart_props.ts):
- 新增 SKIP_REQUIRED_JNPFKEYS 白名单 (12 jnpfKey)
- 白名单: uploadImg/uploadFile/editor/relationForm/popupTable/
  popupSelect/autoComplete/sign/rate/colorPicker/link/iframe
- 即使 label 含"必" 也不标 required (jxcj f_wechat_qrcode 修复)
- 返回值加 skipped 字段 (log 跳过计数)

P1-3 category 关键词匹配 (form/create.ts):
- autoDeriveCategoryFromBusinessType 优先用 appCode + formName 关键词
- 例: jxcj + "数据要素" / "大赛" → 找 businessType 字典匹配
- fallback: AI 推理 → items[0]
- 解决跨 appCode 默认"车辆管理" 问题

vitest (tests/integration/drift/round17-fix-batch5.spec.ts):
- 13 fixture 全部 PASS (P0 wire-up + P1-1/2/3 + TS 编译基线)
- 累计 vitest: 70 → 83 (+13)

drift (docs/drift/2026-07-15-round17-plan.md):
- R17 全部完成 (P0+P1+P2 部分)
- 累计 21 项修复, AI 4 限制闭环

验证:
- TS compile: 49 errors (baseline) == 49 errors after (0 新错) ✅
- jxcj M1 对照: f_competition_id (R17 P0) / f_start_time (R17 P1-1) /
  f_wechat_qrcode (R17 P1-2) / category 默认"车辆管理" (R17 P1-3) 全部修复

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
2026-07-15 16:41:09 +08:00
..