帆软决策平台数据连接界面库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
superman ddc532e9ff Merge pull request #248 in DEC/decision-webui-dcm from final/10.0 to release/10.0 4 years ago
assets/scripts undefined([object Object]): 5 years ago
config KERNEL-4727 refactor: 【平台】使用babel-preset-fineui插件配置babel 4 years ago
i18n fix: DEC-11221 加入对可输入数值的区间验证 5 years ago
lib
private fix: DEC-11221 加入对可输入数值的区间验证 5 years ago
src fix: 添加判断 4 years ago
types fix: DEC-11797 改用dec中自带的http请求方法 5 years ago
webpack KERNEL-4727 refactor: 【平台】使用babel-preset-fineui插件配置babel 4 years ago
.eslintignore
.eslintrc feat: DEC-9068 加入表单验证,添加other类型数据连接 5 years ago
.gitignore
.npmrc KERNEL-4727 refactor: 【平台】使用babel-preset-fineui插件配置babel 4 years ago
README.md
babel.config.js KERNEL-4727 refactor: 【平台】使用babel-preset-fineui插件配置babel 4 years ago
index.html KERNEL-4727 refactor: 【平台】使用babel-preset-fineui插件配置babel 4 years ago
jest.config.js fix: BI-51537 未拥有编辑权限的不可编辑、删除、重命名、复制。 5 years ago
package.json KERNEL-4727 refactor: 【平台】使用babel-preset-fineui插件配置babel 4 years ago
redis.js fix: 无jira任务 重命名的时候也发送socket,修改插件图片地址 5 years ago
tsconfig.json
yarn.lock fix: DEC-12046 修复本地运行时报错的问题 5 years ago

README.md

Database Connection Manager

用于决策平台和设计器中管理数据连接的通用管理器

fineui

开始

安装依赖

yarn

开始开发

yarn dev

接口文档:

增加数据连接类型

使用BI.config,ConstantName名称为dec.constant.database.conf.connect.types,值为连接的名称

例如增加Redis的连接:

BI.config(ConstantPluginTyps, (datas: string[]) => [...datas, {
    text: 'Redis',
    databaseType: 'Redis',
}]);

数据连接填写页面

ConstantName名称为dec.constant.database.conf.connect.form.${name}.edit,值为组件shortcut的名称

数据连接展示页面

ConstantName名称为dec.constant.database.conf.connect.form.${name}.show,值为组件shortcut的名称

示例

const ConstantRedisType = 'dec.constant.database.conf.connect.types';
const ConstantRedisShow = 'dec.constant.database.conf.connect.form.Redis.show';
const ConstantRedisEdit = 'dec.constant.database.conf.connect.form.Redis.edit';

BI.DOM.ready(() => {
    BI.config(ConstantRedisType, datas => [...datas, {
        text: 'Redis',
        databaseType: 'Redis',
    }]);

    const RedisShowName = 'dec.dcm.connection.plugin.redis.show';
    const RedisShow = BI.inherit(BI.Widget, {
        props: {
            formData: {
                url: '',
                port: '6379',
                password: '',
            },
        },
        render() {
            const o = this.options;
            
            return {
                type: 'bi.vertical',
                hgap: 15,
                vgap: 10,
                items: [
                    {
                        type: 'bi.left',
                        items: [
                            {
                                type: 'bi.label',
                                cls: 'bi-font-bold',
                                width: 100,
                                textAlign: 'left',
                                text: '数据库地址',
                            },
                            {
                                type: 'bi.label',
                                text: o.formData.url,
                            },
                        ],
                    },
                    {
                        type: 'bi.left',
                        items: [
                            {
                                type: 'bi.label',
                                cls: 'bi-font-bold',
                                width: 100,
                                textAlign: 'left',
                                text: '端口号',
                            },
                            {
                                type: 'bi.label',
                                text: o.formData.port,
                            },
                        ],
                    },
                    {
                        type: 'bi.left',
                        items: [
                            {
                                type: 'bi.label',
                                cls: 'bi-font-bold',
                                width: 100,
                                textAlign: 'left',
                                text: '密码',
                            },
                            {
                                type: 'bi.label',
                                text: o.formData.password,
                            },
                        ],
                    },
                ],
            };
        },
    });

    BI.shortcut(RedisShowName, RedisShow);
    BI.constant(ConstantRedisShow, RedisShowName);


    const RedisEditName = 'dec.dcm.connection.plugin.redis.edit';
    const RedisEdit = BI.inherit(BI.Widget, {
        props: {
            formData: {
                url: '',
                port: '6379',
                password: '',
            },
        },
        render() {
            const o = this.options;
            
            return {
                type: 'bi.vertical',
                hgap: 15,
                vgap: 10,
                items: [
                    {
                        type: 'bi.left',
                        items: [
                            {
                                type: 'bi.label',
                                cls: 'bi-font-bold',
                                width: 100,
                                textAlign: 'left',
                                text: '数据库地址',
                            },
                            {
                                type: 'bi.text_editor',
                                width: 300,
                                allowBlank: true,
                                ref: _ref => {
                                    this.url = _ref;
                                },
                                text: o.formData.url,
                            },
                        ],
                    },
                    {
                        type: 'bi.left',
                        items: [
                            {
                                type: 'bi.label',
                                cls: 'bi-font-bold',
                                width: 100,
                                textAlign: 'left',
                                text: '端口号',
                            },
                            {
                                type: 'bi.text_editor',
                                width: 300,
                                allowBlank: true,
                                ref: _ref => {
                                    this.port = _ref;
                                },
                                text: o.formData.port,
                            },
                        ],
                    },
                    {
                        type: 'bi.left',
                        items: [
                            {
                                type: 'bi.label',
                                cls: 'bi-font-bold',
                                width: 100,
                                textAlign: 'left',
                                text: '密码',
                            },
                            {
                                type: 'bi.text_editor',
                                width: 300,
                                allowBlank: true,
                                inputType: 'password',
                                ref: _ref => {
                                    this.password = _ref;
                                },
                                text: o.formData.password,
                            },
                        ],
                    },
                ],
            };
        },
        getSubmitValue() {
            return {
                url: this.url.getValue(),
                port: this.port.getValue(),
                password: this.password.getValue(),
            };
        },
    });

    BI.shortcut(RedisEditName, RedisEdit);
    BI.constant(ConstantRedisEdit, RedisEditName);
});