UNPKG

oadp-material

Version:
318 lines (314 loc) 9.35 kB
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types'; const OadpEntityButtonReadFastMeta: IPublicTypeComponentMetadata = { "componentName": "OadpEntityButtonReadFast", "title": "实体快速查询", "category": "高级组件", "group": "低代码组件", "docUrl": "", "screenshot": "https://img.alicdn.com/imgextra/i1/O1CN01O4Oshp1RA6Z0sFZ6h_!!6000000002070-55-tps-56-56.svg", "devMode": "proCode", "npm": { "package": "oadp-material", "version": "{{version}}", "exportName": "OadpEntityButtonReadFast", "main": "src/index.tsx", "destructuring": true, "subName": "" }, "configure": { "props": [ { "name": "DataSetting", "title": "数据设置", "type": "group", "display": "block", "items": [ { "name": "label", "title": { "label": { "type": "i18n", "zh_CN": "标题", "en_US": "Label", }, "tip": { "type": "i18n", "zh_CN": "属性: label | 说明: 标题", "en_US": "prop: label | description: label content", }, }, "setter": "StringSetter", "description": "标题", }, { "name": "name", "title": { "label": { "type": "i18n", "zh_CN": "表单标识", "en_US": "Name", }, "tip": { "type": "i18n", "zh_CN": "属性: name | 说明: 表单标识", "en_US": "prop: name | description: switch name", }, }, "setter": "StringSetter", "supportVariable": false, }, { "name": "id", "title": { "label": { "type": "i18n", "zh_CN": "唯一标识", "en_US": "ID", }, "tip": { "type": "i18n", "zh_CN": "属性: id | 说明: 唯一标识", "en_US": "prop: id | description: switch id", }, }, "setter": "StringSetter" }, { "name": "entity", "title": { "label": { "type": "i18n", "en-US": "Entity", "zh-CN": "绑定实体" }, "tip": { "type": "i18n", "zh_CN": "属性: entity | 说明:绑定实体", "en_US": "prop: entity | description: Set Entity.", }, }, "description": "绑定实体", "setter": "OadpEntitySetter", "supportVariable": true, }, { "name": "tableComponentRefId", "title": { "label": { "type": "i18n", "zh_CN": "联动表格", "en_US": "Bind Table Component", }, "tip": { "type": "i18n", "zh_CN": "属性: tableComponentRefId | 说明: 联动表格", "en_US": "prop: tableComponentRefId | description: Bind Table Component", }, }, "setter": "StringSetter" }, ] }, { "name": "DisplaySetting", "title": "显示设置", "type": "group", "display": "block", "items": [ { "name": "type", "title": { "label": { "type": "i18n", "en-US": "type", "zh-CN": "类型" }, "tip": "type | 类型" }, "description": "类型", "setter": { "componentName": "RadioGroupSetter", "props": { "dataSource": [ { "label": "主按钮", "value": "primary" }, { "label": "次按钮", "value": "secondary" }, { "label": "普通按钮", "value": "normal" } ], "options": [ { "label": "主按钮", "value": "primary" }, { "label": "次按钮", "value": "secondary" }, { "label": "普通按钮", "value": "normal" } ] }, "initialValue": "primary" } }, { "title": { "label": { "type": "i18n", "en-US": "size", "zh-CN": "尺寸" }, "tip": "size | 尺寸" }, "name": "size", "description": "尺寸", "setter": { "componentName": "RadioGroupSetter", "props": { "dataSource": [ { "label": "中", "value": "medium" }, { "label": "大", "value": "large" } ], "options": [ { "label": "中", "value": "medium" }, { "label": "大", "value": "large" } ] }, "initialValue": "medium" } }, ] }, { "name": "InteractionSetting", "title": "交互设置", "type": "group", "display": "block", "items": [ { "title": { "label": { "type": "i18n", "en-US": "Query Attribute List", "zh-CN": "查询属性" }, "tip": { "type": "i18n", "zh_CN": "属性: queryAttributeList | 说明: 查询属性", "en_US": "prop: queryAttributeList | description: Query Attribute List.", }, }, "name": "queryAttributeList", "description": "查询属性", "setter": { "componentName": "ArraySetter", "props": { "itemSetter": { "componentName": "OadpAttributeSetter", "props": (target: IPublicModelSettingField) => ({ "entity": target.getProps().getPropValue('entity'), }), } }, "initialValue": [] }, "supportVariable": true, }, { "title": { "label": { "type": "i18n", "en-US": "disabled", "zh-CN": "是否禁用" }, "tip": "disabled | 是否禁用" }, "name": "disabled", "description": "是否禁用", "setter": { "componentName": "BoolSetter", "isRequired": false, "initialValue": false } }, ] }, ], "supports": { "events": ["onClick"], "style": true }, "component": { "isContainer": true } } }; const snippets: IPublicTypeSnippet[] = [ { "title": "实体快速查询", "screenshot": "https://img.alicdn.com/imgextra/i1/O1CN01O4Oshp1RA6Z0sFZ6h_!!6000000002070-55-tps-56-56.svg", "schema": { "componentName": "OadpEntityButtonReadFast", "props": { "label": "快速查询", "type": "primary", "size": "medium", "disabled": false, "onClick": { "type": "JSExpression", "value": "function() {\n const self = this;\n try {\n return (function (v,e){ return this.utils.eventUtil.onReadFast.apply(this,Array.prototype.slice.call(arguments).concat([{\n\t\"schema\": this.schema\n}])) }).apply(self, arguments);\n } catch(e) {\n console.warn('call function which parsed by lowcode failed: ', e);\n return e.message;\n }\n }" }, "__events": { "eventDataList": [ { "type": "componentEvent", "name": "onClick", "relatedEventName": "onClick", "paramStr": "{\n\t\"schema\": this.schema\n}" } ], "eventList": [ { "name": "onClick", "disabled": true } ] }, "style": { "marginRight": "5px" } }, "hidden": false, "title": "", "isLocked": false, "condition": true, "conditionGroup": "", } } ]; export default { ...OadpEntityButtonReadFastMeta, snippets };