优化:amis-saas-5350 [Feature] 「组件配置」组件 - button-toolbar 按钮工具栏

Change-Id: I7b8465c30ee3baa0bda541c34c48d3a9f0a50ad3
This commit is contained in:
yangdianhua 2022-07-26 18:58:43 +08:00
parent 1f46f56772
commit ab6ecaa1fd

View File

@ -59,58 +59,90 @@ export class ButtonToolbarControlPlugin extends BasePlugin {
panelTitle = '工具栏';
panelJustify = true;
panelBodyCreator = (context: BaseEventContext) => {
return formItemControl(
return getSchemaTpl('tabs', [
{
common: {
replace: true,
body: [
getSchemaTpl('formItemName', {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('remark'),
getSchemaTpl('labelRemark'),
getSchemaTpl('description')
]
},
option: {
title: '按钮管理',
replace: true,
body: [
title: '属性',
body: [
getSchemaTpl('collapseGroup', [
{
name: 'buttons',
type: 'combo',
label: '',
multiple: true,
addable: true,
minLength: 1,
draggable: true,
draggableTip: '',
editable: false,
visibleOn: 'this.buttons && this.buttons.length',
items: [
{
type: 'tpl',
inline: false,
tpl:
'<span class="label label-default"><% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><i class="<%= data.icon %>"/><% }%><% } %></span>'
}
],
addButtonText: '新增按钮',
scaffold: {
type: 'button',
label: '按钮'
}
}
]
},
event: {
hidden: false
}
title: '基本',
body: [
getSchemaTpl('formItemName', {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('valueFormula', {
rendererSchema: {
type: 'input-text'
}
}),
getSchemaTpl('labelRemark'),
getSchemaTpl('remark'),
getSchemaTpl('description'),
getSchemaTpl('combo-container', {
type: 'combo',
label: '按钮管理',
name: 'buttons',
mode: 'normal',
multiple: true,
addable: true,
minLength: 1,
draggable: true,
editable: false,
items: [
{
type: 'tpl',
inline: false,
className: 'p-t-xs',
tpl: '<span class="label label-default"><% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><i class="<%= data.icon %>"/><% }%><% } %></span>'
}
],
addButtonText: '新增按钮',
scaffold: {
type: 'button',
label: '按钮'
}
}),
]
},
getSchemaTpl('status', {
isFormItem: true,
})
]),
]
},
context
);
{
title: '外观',
body: [
getSchemaTpl('collapseGroup', [
{
title: '基本',
body: [
getSchemaTpl('formItemMode'),
getSchemaTpl('horizontal', {
label: '',
visibleOn:
'data.mode == "horizontal" && data.label !== false && data.horizontal'
}),
]
},
getSchemaTpl('style:classNames', {
isFormItem: true,
schema: [
getSchemaTpl('className', {
label: '描述',
name: 'descriptionClassName',
visibleOn: "this.description"
})
]
}),
])
]
}
]);
};
}