From f48890bc9269e84ce1e401f0b442e5e664ebc48c Mon Sep 17 00:00:00 2001 From: Kinplemelon Date: Mon, 16 Dec 2024 17:31:18 +0800 Subject: [PATCH] refactor(action): handle tablestore action data before submit --- src/hooks/Rule/useDataHandler.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks/Rule/useDataHandler.ts b/src/hooks/Rule/useDataHandler.ts index cecc5cf3a..39b2a587f 100644 --- a/src/hooks/Rule/useDataHandler.ts +++ b/src/hooks/Rule/useDataHandler.ts @@ -272,10 +272,13 @@ export const useActionDataHandler = (): { if (Array.isArray(fieldArr)) { data.parameters.fields = fieldArr.map((item) => { const ret = item + ;['value', 'isint', 'isbinary'].forEach((key) => { + if (/^(true|false)$/i.test(item[key])) { + ret[key] = /^true/i.test(item[key]) + } + }) if (NUM_REG.test(item.value)) { ret.value = Number(item.value) - } else if (/^(true|false)$/i.test(item.value)) { - ret.value = /^true/i.test(item.value) } return ret })