testGBP/examples/gcp-meta-json.ts

259 lines
7.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { WidgetLibType } from '../types/widgetLibTypes'
/**
* 控件库配置示例
*/
const BillWidgetLib: WidgetLibType = {
name: 'GCBPWebCommonWidgets',
packageName: '@gcbp/web-common-widgets',
label: '业务中台Web端通用控件库',
description: '业务中台Web端通用控件库描述',
workspace: 'gcbp',
groups: [
{
type: 'prop',
name: 'basic',
label: '基础',
visiableLabel: true
},
{
type: 'prop',
name: 'advanced',
label: '高级',
visiableLabel: true
},
{
type: 'event',
name: 'handler',
label: '事件',
visiableLabel: false
}
],
widgets: {
action: [
{
name: 'GcdpDemoAction',
exposePath: './action/GcdpDemoAction',
label: '打开弹窗',
icon: 'el-icon-add',
category: 'action',
matchCores: null,
matchViews: null,
description: '打开一个弹窗页面',
props: [
{
name: 'modalId',
label: '弹窗控件标识',
required: true,
type: 'string',
editorType: 'string',
defaultValue: '',
group: 'basic',
description: '输入弹窗控件标识,绑定想要打开的弹窗。'
}
],
parentName: 'CommonAction'
}
],
basic: [
{
name: 'GcdpTag',
exposePath: './basic/GcdpTag',
label: '标签',
description: '基于GCP Design开发的基础标签',
icon: 'iconfont gcbp-ide-biaoqian',
category: 'basic',
matchCores: null,
matchViews: null,
props: [
{
name: 'text',
defaultValue: '标签',
label: '文本',
type: 'string',
editorType: 'string',
description: '标签文本',
group: 'basic'
},
{
name: 'type',
label: '类型',
required: false,
type: 'string',
defaultValue: 'normal',
editorType: 'enum',
editorOptions: [
{ name: 'normal', label: '默认' },
{ name: 'info', label: '提示' },
{ name: 'danger', label: '危险' },
{ name: 'warning', label: '警告' },
{ name: 'success', label: '成功' }
],
group: 'basic',
description: '标签的类型'
},
{
name: 'size',
label: '尺寸',
required: false,
type: 'string',
defaultValue: 'small',
editorType: 'enum',
editorOptions: [
{ name: 'mini', label: '超小型' },
{ name: 'small', label: '小型(默认)' },
{ name: 'medium', label: '中等' },
{ name: 'large', label: '大型' }
],
group: 'basic',
description: '标签的尺寸'
},
{
name: 'disabled',
label: '禁用',
description: '设置是否禁用',
type: 'boolean',
group: 'basic',
editorType: 'bool',
defaultValue: false
},
{
name: 'closable',
label: '是否可关闭',
description: '设置是否可关闭',
type: 'boolean',
group: 'basic',
editorType: 'bool',
defaultValue: false
},
{
name: 'eventHandlersMap',
label: '事件',
required: false,
type: 'object',
editorType: 'events',
editorOptions: [
{
name: 'click',
label: '当点击时',
params: [],
description: '当用户点击按钮时触发的事件'
}
],
defaultValue: {},
group: 'handler',
description: ''
}
]
}
],
layout: [],
form: [
{
name: 'GcdpSelectRegionalEditor',
exposePath: './form/GcdpSelectRegionalEditor',
label: '省市区选择',
description: '省市区级联下拉选择控件',
icon: 'iconfont gcbp-ide-xialadanxuan',
category: 'form',
matchCores: null,
matchViews: null,
props: [
{
name: 'prop',
label: '字段',
description: '绑定字段的名称',
type: 'string',
group: 'basic',
editorType: 'field',
editorOptions: {
notUsedDataSource: true
}
},
{
name: 'label',
label: '标题',
defaultValue: '省市区',
type: 'string',
description: '控件的标题',
group: 'basic',
editorType: 'string'
},
{
name: 'col',
label: '所占列数',
description: '设置元素所占列数默认占2列',
defaultValue: 2,
type: 'number',
group: 'basic',
editorType: 'number'
},
{
name: 'dataSource',
label: '数据源',
description: '下拉选项的数据源配置',
type: 'object',
group: 'dataSource',
editorType: 'dataSource'
},
{
name: 'lazy',
label: '懒加载',
description: '是否开启懒加载',
type: 'boolean',
defaultValue: true,
group: 'dataSource',
editorType: 'bool',
editorOptions: {
type: 'switch'
}
},
{
name: 'eventHandlersMap',
label: '事件',
required: false,
type: 'object',
editorType: 'events',
editorOptions: [
{
name: 'load',
label: '加载下级数据时',
params: [
{
name: 'node',
label: '节点数据',
description: '当前节点数据'
},
{
name: 'resolve',
label: '设置数据',
description: '设置数据函数'
}
],
description: '加载下级数据时触发'
}
],
defaultValue: {},
group: 'handler',
description: ''
}
]
}
],
advanced: [
{
name: 'GcdpFormTableColumn',
exposePath: './advanced/GcdpFormTableColumn',
label: '表格列',
description: '支持清空表头所有筛选的表格列',
icon: 'iconfont gcbp-ide-zhage',
category: 'advanced',
matchCores: null,
matchViews: null,
parentName: 'FormTableColumn'
}
],
chart: []
}
}