Socket
Socket
Sign inDemoInstall

@alilc/lowcode-plugin-datasource-pane

Package Overview
Dependencies
413
Maintainers
10
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @alilc/lowcode-plugin-datasource-pane

低代码引擎数据源面板


Version published
Weekly downloads
152
decreased by-8.43%
Maintainers
10
Created
Weekly downloads
 

Readme

Source

低代码引擎 - 数据源面板插件

配置页面的数据源。

一个 pluginProps 的例子

{
  importPlugins: [],
  exportPlugins: [],
  formComponents: {},
  tagSelector: () => {},
  dataSourceTypes: [
    {
      type: 'mopen',
      schema: {
        type: 'object',
        properties: {
          options: {
            type: 'object',
            properties: {
              uri: {
                title: 'api',
              },
              v: {
                title: 'v',
                type: 'string',
              },
              appKey: {
                title: 'appKey',
                type: 'string',
              },
            },
          },
        },
      },
    },
  ],
}

使用预置的数据源类型

import {
  DataSourceTypeFetch,
  DataSourceTypeJsonp,
  DataSourceTypeMtop,
} from '@alilc/lowcode-plugin-datasource-pane';

如何定制

定制数据源类型

类型定义

内置 fetch,mtop,jsonp 类型,支持传入自定义类型。

type DataSourceType = {
  type: string;
  optionsSchema: JSONSchema6
};

数据源类型需要在集团规范约束下扩展。目前只允许在 options 下添加扩展字段。

比如 mtop 类型,需要添加 options.v (版本)字段。

formily 组件

下钻

定制数据源信息展示标签

通过 renderDataSourceInfoTags 方法控制数据源的信息展示

(dataSourceConfig) => {
  if (dataSourceConfig.type = 'fetch') {
    return [{
      type: 'primary',
      content: dataSourceConfig.type
    }];
  }
}

定制导入插件

WIP

定制导出插件

WIP

事件钩子

依赖

  • formily v2
  • xstate
  • manaco
  • react-dnd

和之前版本的区别

  • 支持导出并自定义导出插件
  • 支持排序
  • 支持信息标签
  • 体验更好的对象参数编辑
  • 支持字段配置表达式

贡献代码

欢迎提 MR

未来计划

  • 详情页下钻
  • 支持多语言处理
  • 单元测试

参考

  • 搭建协议规范

FAQs

Last updated on 11 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc