mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 20:48:49 +08:00
fix:variables支持获取上下文数据
Change-Id: I7693263220b866ce8721ebcb146758dff3b25ede
This commit is contained in:
parent
29bd6b5e91
commit
6f3833cbc5
@ -24,7 +24,7 @@ import type {
|
||||
VariableItem,
|
||||
FuncGroup
|
||||
} from 'amis-ui/lib/components/formula/Editor';
|
||||
import type {FormControlProps} from 'amis-core';
|
||||
import {dataMapping, FormControlProps} from 'amis-core';
|
||||
import type {BaseEventContext} from 'amis-editor-core';
|
||||
import {EditorManager} from 'amis-editor-core';
|
||||
|
||||
@ -159,6 +159,13 @@ export default class FormulaControl extends React.Component<
|
||||
return [];
|
||||
}
|
||||
|
||||
if (
|
||||
variables &&
|
||||
variables.some((item: any) => isExpression(item.children))
|
||||
) {
|
||||
variables = dataMapping(variables, this.props.data);
|
||||
}
|
||||
|
||||
const {context, evalMode} = this.props;
|
||||
// 自身字段
|
||||
const field = this.props?.data?.name;
|
||||
|
Loading…
Reference in New Issue
Block a user