fix(plugin-workflow): fix repeat field component (#6067)

This commit is contained in:
Junyi 2025-01-15 16:59:58 +08:00 committed by GitHub
parent 5bdada4c1f
commit 6906d87375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,12 @@ function CommonRepeatField({ value, onChange }) {
return (
<InputNumber
value={value / option.value}
onChange={(v) => onChange(v * option.value)}
onChange={(v) => {
if (!v) {
return;
}
onChange(v * option.value);
}}
min={1}
addonBefore={t('Every')}
addonAfter={t(option.unitText)}
@ -71,9 +76,9 @@ export function RepeatField({ value = null, onChange }) {
onChange('0 * * * * *');
return;
}
onChange(v);
onChange(typeof typeValue === 'number' ? Math.round((value / typeValue) * v) : v);
},
[onChange],
[onChange, typeValue, value],
);
return (