mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 11:58:10 +08:00
Merge pull request #9948 from wibetter/master
fix(amis-editor): input-number步长配置功能优化,实时同步当前小数位数配置
This commit is contained in:
commit
0a266a042a
@ -23,6 +23,7 @@ import {isAlive} from 'mobx-state-tree';
|
||||
import {reaction} from 'mobx';
|
||||
import {resolveVariableAndFilter} from './utils/tpl-builtin';
|
||||
import {buildStyle} from './utils/style';
|
||||
import {isExpression} from './utils/formula';
|
||||
import {StatusScopedProps} from './StatusScoped';
|
||||
import {evalExpression, filter} from './utils/tpl';
|
||||
|
||||
@ -491,7 +492,7 @@ export class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
|
||||
// 自动解析变量模式,主要是方便直接引入第三方组件库,无需为了支持变量封装一层
|
||||
if (renderer.autoVar) {
|
||||
for (const key of Object.keys(schema)) {
|
||||
if (typeof props[key] === 'string') {
|
||||
if (typeof props[key] === 'string' && isExpression(props[key])) {
|
||||
props[key] = resolveVariableAndFilter(
|
||||
props[key],
|
||||
props.data,
|
||||
|
@ -208,15 +208,15 @@ export class NumberControlPlugin extends BasePlugin {
|
||||
label: '最大值',
|
||||
valueType: 'number'
|
||||
}),
|
||||
|
||||
{
|
||||
type: 'input-number',
|
||||
name: 'step',
|
||||
label: '步长',
|
||||
min: 0,
|
||||
value: 1
|
||||
value: 1,
|
||||
precision: '${precision}',
|
||||
strictMode: false
|
||||
},
|
||||
|
||||
{
|
||||
type: 'input-number',
|
||||
name: 'precision',
|
||||
|
@ -121,30 +121,33 @@ export class BreadcrumbField extends React.Component<BreadcrumbProps, object> {
|
||||
data,
|
||||
'| raw'
|
||||
) as Array<BreadcrumbItemSchema>);
|
||||
crumbItems = crumbItems.map(item => {
|
||||
if (item.label) {
|
||||
item.label = filter(item.label, data);
|
||||
}
|
||||
if (item.href) {
|
||||
item.href = resolveVariableAndFilter(item.href, data, '| raw');
|
||||
}
|
||||
if (item.dropdown) {
|
||||
item.dropdown = item.dropdown.map(dropdownItem => {
|
||||
if (dropdownItem.label) {
|
||||
dropdownItem.label = filter(dropdownItem.label, data);
|
||||
}
|
||||
if (dropdownItem.href) {
|
||||
dropdownItem.href = resolveVariableAndFilter(
|
||||
dropdownItem.href,
|
||||
data,
|
||||
'| raw'
|
||||
);
|
||||
}
|
||||
return dropdownItem;
|
||||
});
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
if (crumbItems) {
|
||||
crumbItems = crumbItems.map(item => {
|
||||
if (item.label) {
|
||||
item.label = filter(item.label, data);
|
||||
}
|
||||
if (item.href) {
|
||||
item.href = resolveVariableAndFilter(item.href, data, '| raw');
|
||||
}
|
||||
if (item.dropdown) {
|
||||
item.dropdown = item.dropdown.map(dropdownItem => {
|
||||
if (dropdownItem.label) {
|
||||
dropdownItem.label = filter(dropdownItem.label, data);
|
||||
}
|
||||
if (dropdownItem.href) {
|
||||
dropdownItem.href = resolveVariableAndFilter(
|
||||
dropdownItem.href,
|
||||
data,
|
||||
'| raw'
|
||||
);
|
||||
}
|
||||
return dropdownItem;
|
||||
});
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<Breadcrumb
|
||||
|
Loading…
Reference in New Issue
Block a user