From 45de8ab8e1614f8ba34ecbf007192b9f3bb3fb11 Mon Sep 17 00:00:00 2001 From: ssw Date: Sat, 27 Jun 2026 13:03:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(test):=20B-11=20test=20run=20sample=20datet?= =?UTF-8?q?ime=20=E6=94=B9=20Long=20=E6=97=B6=E9=97=B4=E6=88=B3=20+=20radi?= =?UTF-8?q?o=20=E5=AD=97=E6=AE=B5=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - datePicker/timePicker: new Date().toISOString() → Date.now() (与后端 OnlineSwapDataUtils.java:447 Long.parseLong 契约) - radio/switch/checkbox: 补 options[0].value 处理 (tds_connector radio f_status 缺失 → 400) - 验证: tds_connector (840534119812169733) test run 1/2 → 2/2 PASS --- src/commands/test/run.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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