diff --git a/src/commands/test/run.ts b/src/commands/test/run.ts index 26370c8..a94806f 100644 --- a/src/commands/test/run.ts +++ b/src/commands/test/run.ts @@ -281,7 +281,10 @@ function buildSampleData(fields: Array<{ __vModel__?: string; __config__?: { jnp continue } if (['datePicker', 'timePicker'].includes(key)) { - sample[vmodel] = new Date().toISOString().slice(0, 10) + // 2026-06-27 B-11 fix: 后端 OnlineSwapDataUtils.java:447 期望 Long.parseLong(value) + // 旧实现填 ISO 字符串 "2026-06-27" → 后端 NumberFormatException → 400 "System abnormality" + // 改填 Date.now() (Long 时间戳) 与 web datePicker 控件默认值一致 + sample[vmodel] = Date.now() continue } if (key === 'select') { @@ -289,6 +292,13 @@ function buildSampleData(fields: Array<{ __vModel__?: string; __config__?: { jnp sample[vmodel] = opts[0]?.value || '1' continue } + // 2026-06-27 B-11 fix: radio/switch/checkbox 也填 options[0].value (select 同源) + // 之前 tds_connector radio f_status 没填 → 后端 "状态Field cannot be empty" + if (key === 'radio' || key === 'switch' || key === 'checkbox') { + const opts = cfg.options || [] + sample[vmodel] = opts[0]?.value || '1' + continue + } if (key === 'userSelect' || key === 'organizeSelect' || key === 'posSelect') { sample[vmodel] = '1' continue