diff --git a/packages/amis-editor/package.json b/packages/amis-editor/package.json index 9f3206861..ae9ec7d98 100644 --- a/packages/amis-editor/package.json +++ b/packages/amis-editor/package.json @@ -1,6 +1,6 @@ { "name": "amis-editor", - "version": "5.2.0-beta.9", + "version": "5.2.0-beta.16", "description": "amis 可视化编辑器", "main": "lib/index.js", "module": "esm/index.js", diff --git a/packages/amis-editor/src/plugin/Form/InputFile.tsx b/packages/amis-editor/src/plugin/Form/InputFile.tsx index 52281a3de..c1837243f 100644 --- a/packages/amis-editor/src/plugin/Form/InputFile.tsx +++ b/packages/amis-editor/src/plugin/Form/InputFile.tsx @@ -345,7 +345,12 @@ export class FileControlPlugin extends BasePlugin { getSchemaTpl('remark'), getSchemaTpl('labelRemark'), getSchemaTpl('description'), - getSchemaTpl('autoFillApi') + getSchemaTpl('autoFillApi', { + visibleOn: '!this.autoFill || this.autoFill.api' + }), + getSchemaTpl('autoFill', { + visibleOn: '!this.autoFill || !this.autoFill.api' + }) ] }, getSchemaTpl('status', {isFormItem: true}), diff --git a/packages/amis-editor/src/renderer/FormulaControl.tsx b/packages/amis-editor/src/renderer/FormulaControl.tsx index 552e2ecc3..e7190b270 100644 --- a/packages/amis-editor/src/renderer/FormulaControl.tsx +++ b/packages/amis-editor/src/renderer/FormulaControl.tsx @@ -24,7 +24,7 @@ import type { VariableItem, FuncGroup } from 'amis-ui/lib/components/formula/Editor'; -import type {FormControlProps} from 'amis-core'; +import {FormControlProps, dataMapping} 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;