fix(amis-editor): chart支持宽高可视化配置

This commit is contained in:
wibetter 2023-08-16 19:16:33 +08:00
parent 2d65369964
commit e7b1be00ab
2 changed files with 32 additions and 12 deletions

View File

@ -252,7 +252,6 @@ export class ChartPlugin extends BasePlugin {
visibleOn: 'data.api.url', visibleOn: 'data.api.url',
pipeIn: defaultValue(true) pipeIn: defaultValue(true)
}), }),
{ {
name: 'interval', name: 'interval',
label: tipedLabel( label: tipedLabel(
@ -265,6 +264,15 @@ export class ChartPlugin extends BasePlugin {
visibleOn: 'data.api.url', visibleOn: 'data.api.url',
unitOptions: ['ms'] unitOptions: ['ms']
}, },
getSchemaTpl('expressionFormulaControl', {
evalMode: false,
label: tipedLabel(
'跟踪表达式',
'如果这个表达式的值有变化时会更新图表,当 config 中用了数据映射时有用'
),
name: 'trackExpression',
placeholder: '\\${xxx}'
}),
{ {
name: 'config', name: 'config',
asFormItem: true, asFormItem: true,
@ -303,15 +311,6 @@ export class ChartPlugin extends BasePlugin {
'默认为追加模式,新的配置会跟旧的配置合并,如果勾选将直接完全覆盖' '默认为追加模式,新的配置会跟旧的配置合并,如果勾选将直接完全覆盖'
), ),
name: 'replaceChartOption' name: 'replaceChartOption'
}),
getSchemaTpl('expressionFormulaControl', {
evalMode: false,
label: tipedLabel(
'跟踪表达式',
'如果这个表达式的值有变化时会更新图表,当 config 中用了数据映射时有用'
),
name: 'trackExpression',
placeholder: '\\${xxx}'
}) })
] ]
}, },
@ -354,6 +353,27 @@ export class ChartPlugin extends BasePlugin {
{ {
title: '外观', title: '外观',
body: getSchemaTpl('collapseGroup', [ body: getSchemaTpl('collapseGroup', [
{
title: '宽高设置',
body: [
getSchemaTpl('style:widthHeight', {
widthSchema: {
label: tipedLabel(
'宽度',
'默认宽度为父容器宽度,值单位默认为 px也支持百分比等单位 100%'
),
pipeIn: defaultValue('100%')
},
heightSchema: {
label: tipedLabel(
'高度',
'默认高度为300px值单位默认为 px也支持百分比等单位 100%'
),
pipeIn: defaultValue('300px')
}
})
]
},
...getSchemaTpl('theme:common', {exclude: ['layout']}) ...getSchemaTpl('theme:common', {exclude: ['layout']})
]) ])
}, },

View File

@ -94,12 +94,12 @@ export interface ChartSchema extends BaseSchema {
/** /**
* *
*/ */
width?: number; width?: number | string;
/** /**
* *
*/ */
height?: number; height?: number | string;
/** /**
* *