Merge branch 'feat-4-toolbar-subform' into feat-optimize-5

This commit is contained in:
jiatianqi 2022-08-11 19:31:42 +08:00
commit ecc7d58eed

View File

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