帆软决策平台数据连接界面库
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 4223c0ac45 Merge pull request #1986 in DEC/decision-webui-dcm from final/10.0 to release/10.0 4 years ago
assets/scripts DEC-15759 & DEC-15764 帮助文档链接 4 years ago
config build: KERNEL-6541 引用类型规范化 4 years ago
i18n
lib
private
src DEC-18427 fix: 国际化问题 4 years ago
types build: KERNEL-6541 引用类型规范化 4 years ago
webpack build: KERNEL-6541 引用类型规范化 4 years ago
.eslintignore
.eslintrc
.gitignore
.npmrc
README.md DEC-18013 fix: 【自动化】最新redis数据集插件,新建redis数据连接,默认名称是widget7127这种带随机数 4 years ago
babel.config.js
index.html build: KERNEL-6541 引用类型规范化 4 years ago
jest.config.js
package.json KERNEL-6541 类型引用规范化 4 years ago
redis.js
tsconfig.json build: KERNEL-6541 引用类型规范化 4 years ago
yarn.lock KERNEL-6541 引用类型规范化 4 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',
    edit: '',
    show: '',
}]);

数据连接填写页面

edit属性值为填写组件shortcut的名称

数据连接展示页面

show属性值为组件shortcut的名称

示例

const DataBaseConfigProvider = 'dec.connection.provider.datebase';

const RedisShowName = 'dec.dcm.connection.plugin.redis.show';
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit';
BI.config(DataBaseConfigProvider, function (provider) {
    provider.registerDatabaseType({
        text: "Redis",
        databaseType: "Redis",
        edit: "dec.dcm.connection.plugin.demo.edit",
        show: "dec.dcm.connection.plugin.demo.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);

const RedisEdit = BI.inherit(BI.Widget, {
    props: {
        value: {
            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.value.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.value.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.value.password,
                        },
                    ],
                },
            ],
        };
    },
    getValue() {
        return {
            url: this.url.getValue(),
            port: this.port.getValue(),
            password: this.password.getValue(),
        };
    },
});
BI.shortcut(RedisEditName, RedisEdit);