@ywfe/materials-design
Version:
YwDesign for lowcode
280 lines (276 loc) • 8.05 kB
text/typescript
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
import { IPublicTypeSnippetMore } from '../_base';
const YwMemberListMeta: IPublicTypeComponentMetadata = {
componentName: 'YwMemberList',
title: 'YwMemberList',
group: '基础组件',
category: '表单',
docUrl: '',
screenshot: '',
devMode: 'proCode',
npm: {
package: '@ywfe/materials-design',
version: '0.1.0',
exportName: 'YwMemberList',
main: 'src/index.tsx',
destructuring: true,
subName: '',
},
configure: {
props: [
{
title: { label: '人员选择完成回调', tip: 'onFinish | 人员选择完成' },
name: 'onFinish',
defaultValue: () => ({
type: 'JSFunction',
schema: {
title: 'onFinish',
type: 'JSFunction',
name: 'onFinish',
async: true,
properties: {
input: {
type: 'object',
properties: {
value: {
type: 'string',
defaultValue: '',
},
},
required: ['value'],
},
body: {
type: 'array',
items: [
{
type: 'Function',
properties: {
template: 'RequestFunction',
variable: 'result',
extraProps: {
apiId: 'API_344_77190_323217f643c3e3f1fe7532e72ac01bb0748c97be',
params: { selectionNo: '{{value}}' },
},
},
},
],
},
},
required: ['input', 'body'],
},
}),
setter: {
componentName: 'SchemaFunctionSetter',
},
},
{
title: { label: '人员获取接口', tip: 'getUserListSource | 人员获取接口' },
name: 'getUserListSource',
defaultValue: () => ({
type: 'JSFunction',
schema: {
title: 'getUserListSource',
type: 'JSFunction',
name: 'getUserListSource',
async: true,
properties: {
input: {
type: 'object',
properties: {
value: {
type: 'string',
defaultValue: '',
},
},
required: ['value'],
},
body: {
type: 'array',
items: [
{
type: 'Function',
properties: {
template: 'RequestFunction',
variable: 'result',
extraProps: {
apiId: 'API_344_77190_323217f643c3e3f1fe7532e72ac01bb0748c97be',
params: { selectionNo: '{{value}}' },
},
},
},
],
},
},
required: ['input', 'body'],
},
}),
setter: {
componentName: 'SchemaFunctionSetter',
},
},
{
name: 'getOrgList',
title: { label: '组织架构接口配置', tip: 'getOrgList | 组织架构接口配置' },
supportVariable: false,
defaultValue: () => ({
type: 'JSFunction',
schema: {
title: 'getOrgList',
type: 'JSFunction',
name: 'getOrgList',
async: true,
properties: {
input: {
type: 'object',
properties: {
params: {
type: 'object',
defaultValue: {},
},
},
required: ['params'],
},
body: {
type: 'array',
items: [
{
type: 'Function',
properties: {
template: 'RequestFunction',
variable: 'result',
returnResult: '0',
extraProps: {
apiId: 'API_88_65658_323217f643c3e3f1fe7532e72ac01bb0748c97be',
params: {},
},
},
},
],
},
},
required: ['input', 'body'],
},
}),
setter: {
componentName: 'SchemaFunctionSetter',
},
},
{
title: { label: '人员接口配置', tip: 'getDataSource | 人员接口配置' },
name: 'getDataSource',
defaultValue: () => ({
type: 'JSFunction',
schema: {
title: 'getDataSource',
type: 'JSFunction',
name: 'getDataSource',
async: true,
properties: {
input: {
type: 'object',
properties: {
value: {
type: 'string',
defaultValue: '',
},
},
required: ['value'],
},
body: {
type: 'array',
items: [
{
type: 'Function',
properties: {
template: 'RequestFunction',
variable: 'result',
extraProps: {
apiId: 'API_88_59650_323217f643c3e3f1fe7532e72ac01bb0748c97be',
params: { keyword: '{{value}}' },
},
},
},
],
},
},
required: ['input', 'body'],
},
}),
setter: {
componentName: 'SchemaFunctionSetter',
},
},
{
title: {
label: '通过部门id查询下级用户',
tip: 'getUserListForOrg | 通过部门id查询下级用户',
},
name: 'getUserListForOrg',
// setter: {
// componentName: 'VariableSetter',
// },
defaultValue: () => ({
type: 'JSFunction',
schema: {
title: 'getUserListForOrg',
type: 'JSFunction',
name: 'getUserListForOrg',
async: true,
properties: {
input: {
type: 'object',
properties: {
params: {
type: 'object',
defaultValue: '',
},
},
required: ['params'],
},
body: {
type: 'array',
items: [
{
type: 'Function',
properties: {
template: 'RequestFunction',
variable: 'result',
extraProps: {
apiId: 'API_88_65794_323217f643c3e3f1fe7532e72ac01bb0748c97be',
params: { orgId: '{{params.orgIds}}' },
},
},
},
],
},
},
required: ['input', 'body'],
},
}),
setter: {
componentName: 'SchemaFunctionSetter',
},
},
],
supports: {
className: true,
style: true,
},
component: {},
},
};
const snippets: IPublicTypeSnippetMore[] = [
{
title: '成员列表',
svgId: 'icon-chengyuanliebiao',
screenshot: 'https://yw-fed-static.oss-cn-hangzhou.aliyuncs.com/诗橙/platformwithicon',
schema: {
componentName: 'YwMemberList',
props: {},
},
},
];
export default {
...YwMemberListMeta,
snippets,
};