fix: 修复日期类控件自动将 value 默认值运算并设置上的问题

Change-Id: Ie1393474a59455b991e09bfc3a84f574b6cdbff9
This commit is contained in:
2betop 2022-08-01 16:47:17 +08:00
parent 177b417f99
commit 94f5cb05c6

View File

@ -13,7 +13,7 @@ import isString from 'lodash/isString';
import isEqual from 'lodash/isEqual';
import omit from 'lodash/omit';
import cx from 'classnames';
import {FormItem, Button, InputBox, Icon, render, ResultBox} from 'amis';
import {FormItem, Button, InputBox, Icon, ResultBox} from 'amis';
import {FormulaExec, isExpression} from 'amis';
import {PickerContainer} from 'amis';
import {FormulaEditor} from 'amis-ui/lib/components/formula/Editor';
@ -321,7 +321,8 @@ export default class FormulaControl extends React.Component<
'suffix',
'unitOptions',
'keyboard',
'kilobitSeparator'
'kilobitSeparator',
'value'
];
// 当前组件要剔除的字段
@ -356,6 +357,7 @@ export default class FormulaControl extends React.Component<
// 设置popOverContainer
curRendererSchema.popOverContainer = window.document.body;
}
return curRendererSchema;
}
@ -390,6 +392,7 @@ export default class FormulaControl extends React.Component<
rendererWrapper,
manager,
useExternalFormData = false,
render,
...rest
} = this.props;
@ -445,21 +448,17 @@ export default class FormulaControl extends React.Component<
rendererWrapper ? 'border-wrapper' : ''
)}
>
{render(
this.filterCustomRendererProps(rendererSchema),
{
data: useExternalFormData
? {
...this.props.data
}
: {},
onChange: this.handleSimpleInputChange,
manager: manager
},
{
...(manager?.env || {})
}
)}
{render('left', this.filterCustomRendererProps(rendererSchema), {
inputOnly: true,
value: value,
data: useExternalFormData
? {
...this.props.data
}
: {},
onChange: this.handleSimpleInputChange,
manager: manager
})}
</div>
)}
{!simple && isExpr && (