fix(client): fix variable input value type (#4955)

This commit is contained in:
Junyi 2024-07-27 22:11:49 +08:00 committed by GitHub
parent e4fcf69e45
commit 7bc6746f0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,10 +123,10 @@ function getTypedConstantOption(type: string, types: true | string[], fieldNames
Object.keys(item).reduce( Object.keys(item).reduce(
(result, key) => (result, key) =>
fieldNames[key] in item fieldNames[key] in item
? result ? Object.assign(result, {
: Object.assign(result, {
[fieldNames[key]]: item[key], [fieldNames[key]]: item[key],
}), })
: result,
item, item,
), ),
); );
@ -397,9 +397,9 @@ export function Input(props: VariableInputProps) {
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{children && isFieldValue ? ( {children && isFieldValue ? (
children children
) : ( ) : ConstantComponent ? (
<ConstantComponent role="button" aria-label="variable-constant" value={value} onChange={onChange} /> <ConstantComponent role="button" aria-label="variable-constant" value={value} onChange={onChange} />
)} ) : null}
</div> </div>
)} )}
<Cascader <Cascader