diff --git a/packages/amis-editor/src/renderer/FormulaControl.tsx b/packages/amis-editor/src/renderer/FormulaControl.tsx index 4152e35c8..92bb59215 100644 --- a/packages/amis-editor/src/renderer/FormulaControl.tsx +++ b/packages/amis-editor/src/renderer/FormulaControl.tsx @@ -402,9 +402,11 @@ export default class FormulaControl extends React.Component< let curRendererSchema: any = null; if (rendererSchema) { - curRendererSchema = Object.assign({}, rendererSchema, data, { + curRendererSchema = Object.assign({}, rendererSchema, { type: rendererSchema.type ?? data.type, - name: rendererSchema.name ?? data.name ?? 'value' + // 目前表单项 wrapControl 还必须依赖一个 name + // 所以这里先随便取个名字,这里渲染的时候应该是 value 控制,而不是关联 name + name: 'FORMULA_CONTROL_PLACEHOLDER' }); // 默认要剔除的字段 @@ -521,9 +523,6 @@ export default class FormulaControl extends React.Component< const {formulaPickerOpen, variables, variableMode} = this.state; - // 自身字段 - const selfName = this.props?.data?.name; - // 判断是否含有公式表达式 const isExpr = isExpression(value); diff --git a/packages/amis-editor/src/tpl/common.tsx b/packages/amis-editor/src/tpl/common.tsx index e85514e4b..e21f52c3d 100644 --- a/packages/amis-editor/src/tpl/common.tsx +++ b/packages/amis-editor/src/tpl/common.tsx @@ -1159,13 +1159,6 @@ setSchemaTpl('nav-badge', { setSchemaTpl('nav-default-active', { type: 'ae-nav-default-active' }); -// 暂未使用 -setSchemaTpl('formulaControl', (schema: object = {}) => { - return { - type: 'ae-formulaControl', - ...schema - }; -}); /** * 日期范围快捷键组件