fix:amis-saas-5534 更改默认值会触发其他公式值变更

Change-Id: I332b8f53762f0dcaa02f80082f36b3a2cf6e0cc1
This commit is contained in:
jiatianqi 2022-09-01 15:45:25 +08:00
parent e57483435c
commit 094917aad4
2 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,9 @@
], ],
"lint-staged": { "lint-staged": {
"{src,scss,examples}/**/**/*.{js,jsx,ts,tsx,scss,json}": [ "{src,scss,examples}/**/**/*.{js,jsx,ts,tsx,scss,json}": [
"prettier --write", "prettier --write"
],
"{src,scss,examples}/**/**/*.{scss}": [
"stylelint" "stylelint"
] ]
}, },

View File

@ -288,7 +288,7 @@ export default class FormulaControl extends React.Component<
if (rendererSchema) { if (rendererSchema) {
curRendererSchema = Object.assign({}, rendererSchema, data, { curRendererSchema = Object.assign({}, rendererSchema, data, {
type: rendererSchema.type ?? data.type, type: rendererSchema.type ?? data.type,
value: this.props.value ?? rendererSchema.value ?? data.value value: this.props.value ?? rendererSchema.value
}); });
// 默认要剔除的字段 // 默认要剔除的字段
@ -349,7 +349,8 @@ export default class FormulaControl extends React.Component<
// 设置统一的占位提示 // 设置统一的占位提示
if (curRendererSchema.type === 'select') { if (curRendererSchema.type === 'select') {
curRendererSchema.placeholder = '请选择默认值'; curRendererSchema.placeholder = '请选择默认值';
curRendererSchema.inputClassName= 'ae-editor-FormulaControl-select-style' curRendererSchema.inputClassName =
'ae-editor-FormulaControl-select-style';
} else { } else {
curRendererSchema.placeholder = '请输入静态默认值'; curRendererSchema.placeholder = '请输入静态默认值';
} }