fix: 修复 formulaControl 由于 name 干扰导致赋值不符合预期问题

This commit is contained in:
2betop 2023-05-10 20:46:13 +08:00
parent 6437ac4269
commit 760f4eddfc
2 changed files with 4 additions and 12 deletions

View File

@ -402,9 +402,11 @@ export default class FormulaControl extends React.Component<
let curRendererSchema: any = null; let curRendererSchema: any = null;
if (rendererSchema) { if (rendererSchema) {
curRendererSchema = Object.assign({}, rendererSchema, data, { curRendererSchema = Object.assign({}, rendererSchema, {
type: rendererSchema.type ?? data.type, 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 {formulaPickerOpen, variables, variableMode} = this.state;
// 自身字段
const selfName = this.props?.data?.name;
// 判断是否含有公式表达式 // 判断是否含有公式表达式
const isExpr = isExpression(value); const isExpr = isExpression(value);

View File

@ -1159,13 +1159,6 @@ setSchemaTpl('nav-badge', {
setSchemaTpl('nav-default-active', { setSchemaTpl('nav-default-active', {
type: 'ae-nav-default-active' type: 'ae-nav-default-active'
}); });
// 暂未使用
setSchemaTpl('formulaControl', (schema: object = {}) => {
return {
type: 'ae-formulaControl',
...schema
};
});
/** /**
* *