| 13 | import {generateId} from '../util'; |
| 14 | |
| 15 | export class OperationPlugin extends BasePlugin { |
| 16 | static id = 'OperationPlugin'; |
| 17 | // 关联渲染器名字 |
| 18 | rendererName = 'operation'; |
| 19 | $schema = '/schemas/OperationSchema.json'; |
| 20 | |
| 21 | // 组件名称 |
| 22 | name = '操作栏'; |
| 23 | isBaseComponent = true; |
| 24 | description = '操作栏,用于表格。'; |
| 25 | tags = ['展示']; |
| 26 | icon = ''; |
| 27 | scaffold = { |
| 28 | type: 'operation', |
| 29 | label: '操作', |
| 30 | buttons: [ |
| 31 | { |
| 32 | label: '按钮', |
| 33 | type: 'button', |
| 34 | id: generateId() |
| 35 | } |
| 36 | ] |
| 37 | }; |
| 38 | previewSchema = { |
| 39 | type: 'tpl', |
| 40 | tpl: '操作栏' |
| 41 | }; |
| 42 | |
| 43 | regions: Array<RegionConfig> = [ |
| 44 | { |
| 45 | key: 'buttons', |
| 46 | label: '按钮集', |
| 47 | renderMethod: 'render', |
| 48 | insertPosition: 'inner', |
| 49 | preferTag: '按钮' |
| 50 | } |
| 51 | ]; |
| 52 | |
| 53 | panelTitle = '操作栏'; |
| 54 | panelBodyCreator = (context: BaseEventContext) => { |
| 55 | return getSchemaTpl('tabs', [ |
| 56 | { |
| 57 | title: '外观', |
| 58 | body: [ |
| 59 | getSchemaTpl('className', { |
| 60 | name: 'innerClassName' |
| 61 | }) |
| 62 | ] |
| 63 | } |
| 64 | ]); |
| 65 | }; |
| 66 | |
| 67 | buildSubRenderers( |
| 68 | context: RendererEventContext, |
| 69 | renderers: Array<SubRendererInfo> |
| 70 | ): BasicSubRenderInfo | Array<BasicSubRenderInfo> | void { |
| 71 | if ( |
| 72 | context && |
nothing calls this directly
no test coverage detected