UNPKG

@ywfe/materials-design

Version:
182 lines (179 loc) 4.81 kB
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types'; import { hideProp } from '../_utils'; import { IPublicTypeSnippetMore } from '../_base'; const YwExportMeta: IPublicTypeComponentMetadata = { componentName: 'YwExport', title: '导出功能', docUrl: '', screenshot: '', devMode: 'proCode', group: '基础组件', category: '页面模块', npm: { package: '@ywfe/materials-design', version: '0.1.0', exportName: 'YwExport', main: 'src/index.tsx', destructuring: true, subName: '', }, configure: { props: [ { title: { label: '组件唯一标识', tip: '_flag | 组件唯一标识', }, condition: hideProp, name: '_flag', description: '组件唯一标识', setter: { componentName: 'StringSetter', isRequired: true, initialValue: '', }, }, { title: { label: '按钮文字', tip: 'btnText | 按钮文字', }, name: 'btnText', description: '按钮文字', supportVariable: false, setter: { componentName: 'StringSetter', initialValue: '按钮', props: { placeholder: '请输入', }, }, }, { title: { label: '按钮类型', tip: 'btnType | 按钮类型', }, supportVariable: false, name: 'btnType', description: '按钮类型', defaultValue: 'default', setter: { componentName: 'SelectSetter', props: { options: [ { label: '主按钮', value: 'primary', }, { label: '次按钮', value: 'default', }, { label: '虚线按钮', value: 'dashed', }, { label: '链接按钮', value: 'link', }, { label: '文本按钮', value: 'text', }, { label: '自定义按钮', value: '', }, ], }, initialValue: 'primary', }, }, { title: { label: '创建导出任务函数', tip: 'exportFun | 创建导出任务函数', }, name: 'exportFun', description: '创建导出任务函数', supportVariable: false, setter: { componentName: 'MixedSetter', props: { setters: [ { componentName: 'SchemaFunctionSetter', props: { title: 'exportFun', name: 'exportFun', async: true, properties: { input: { type: 'object', properties: { values: { type: 'object', }, }, required: ['values'], }, body: { type: 'array', items: [ { type: 'Function', properties: { template: 'RequestFunction', variable: 'requestRes', extraProps: { params: '{{this.state.filterProps}}', }, }, }, { type: 'Function', properties: { template: 'HistoryPushFunction', extraProps: { url: '', params: '{{undefined}}', hash: '{{undefined}}', }, }, }, ], }, }, }, }, ], }, }, }, ], supports: { style: true, className: true, }, component: { isContainer: false, }, }, }; const snippets: IPublicTypeSnippetMore[] = [ { title: '导出数据', svgId: 'icon-daochushuju', screenshot: 'https://yw-fed-static.oss-cn-hangzhou.aliyuncs.com/诗橙/导出.png', schema: { componentName: 'YwExport', props: {}, }, }, ]; export default { ...YwExportMeta, snippets, };