fix: InputFormula组件allowInput属性未透传问题 (#9123)

This commit is contained in:
RUNZE LU 2023-12-14 11:19:28 +08:00 committed by GitHub
parent 6dd0101f7a
commit 5738007a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,33 +105,6 @@ const FormulaInput: React.FC<FormulaInputProps> = props => {
['onChange']
);
const FormulaCmpt = ({value}: {value: string}) => {
return (
<ResultBox
className={cx(`FormulaPicker-input-variable`)}
allowInput={false}
value={pipInValue(value)}
result={
value == null
? void 0
: FormulaEditor.highlightValue(value, variables!, evalMode)
}
itemRender={(item: any) => {
return (
<div
className={cx('FormulaPicker-ResultBox')}
dangerouslySetInnerHTML={{__html: item.html}}
/>
);
}}
onResultChange={noop}
onChange={pipOutValue}
onClear={() => pipOutValue(undefined)}
clearable={true}
/>
);
};
let cmptValue = pipInValue(value ?? inputSettings.defaultValue);
/** 数据来源可能是从 query中下发的CRUD查询表头导致数字或者布尔值被转为 string 格式,这里预处理一下 */
@ -177,7 +150,7 @@ const FormulaInput: React.FC<FormulaInputProps> = props => {
return (
<ResultBox
className={cx(`FormulaPicker-input-variable`)}
allowInput={false}
allowInput={allowInput}
value={resultValue}
result={
resultValue == null