mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix: ConditionBuilder从 query 中获取初始值时值类型错误问题
This commit is contained in:
parent
3c87ba1e8b
commit
f1e1c12732
@ -132,7 +132,16 @@ const FormulaInput: React.FC<FormulaInputProps> = props => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const cmptValue = pipInValue(value ?? inputSettings.defaultValue);
|
let cmptValue = pipInValue(value ?? inputSettings.defaultValue);
|
||||||
|
|
||||||
|
/** 数据来源可能是从 query中下发的(CRUD查询表头),导致数字或者布尔值被转为 string 格式,这里预处理一下 */
|
||||||
|
if (schemaType === 'number') {
|
||||||
|
cmptValue = isNaN(+cmptValue) ? cmptValue : +cmptValue;
|
||||||
|
} else if (schemaType === 'boolean') {
|
||||||
|
cmptValue =
|
||||||
|
cmptValue === 'true' ? true : cmptValue === 'false' ? false : cmptValue;
|
||||||
|
}
|
||||||
|
|
||||||
const targetVariable =
|
const targetVariable =
|
||||||
variables && cmptValue != null && typeof cmptValue === 'string'
|
variables && cmptValue != null && typeof cmptValue === 'string'
|
||||||
? findTree(variables, item => {
|
? findTree(variables, item => {
|
||||||
|
Loading…
Reference in New Issue
Block a user