diff --git a/packages/amis-editor/src/plugin/Form/ButtonToolbar.tsx b/packages/amis-editor/src/plugin/Form/ButtonToolbar.tsx index 03483b56c..5ccf27e06 100644 --- a/packages/amis-editor/src/plugin/Form/ButtonToolbar.tsx +++ b/packages/amis-editor/src/plugin/Form/ButtonToolbar.tsx @@ -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: - '<% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><% }%><% } %>' - } - ], - 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: '<% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><% }%><% } %>' + } + ], + 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" + }) + ] + }), + ]) + ] + } + ]); }; }