fix(test): B-11 test run sample datetime 改 Long 时间戳 + radio 字段支持

- 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
This commit is contained in:
ssw committed 2026-06-27 13:03:09 +08:00
1 parent 760f758b54
commit 45de8ab8e1
1 file changed
+11 -1
+11 -1
View File
@@ -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