|
|
@ -25,28 +25,32 @@ yarn dev |
|
|
|
BI.config(ConstantPluginTyps, (datas: string[]) => [...datas, { |
|
|
|
BI.config(ConstantPluginTyps, (datas: string[]) => [...datas, { |
|
|
|
text: 'Redis', |
|
|
|
text: 'Redis', |
|
|
|
databaseType: 'Redis', |
|
|
|
databaseType: 'Redis', |
|
|
|
|
|
|
|
edit: '', |
|
|
|
|
|
|
|
show: '', |
|
|
|
}]); |
|
|
|
}]); |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
### 数据连接填写页面 |
|
|
|
### 数据连接填写页面 |
|
|
|
ConstantName名称为`dec.constant.database.conf.connect.form.${name}.edit`,值为组件shortcut的名称 |
|
|
|
edit属性值为填写组件shortcut的名称 |
|
|
|
|
|
|
|
|
|
|
|
### 数据连接展示页面 |
|
|
|
### 数据连接展示页面 |
|
|
|
ConstantName名称为`dec.constant.database.conf.connect.form.${name}.show`,值为组件shortcut的名称 |
|
|
|
show属性值为组件shortcut的名称 |
|
|
|
|
|
|
|
|
|
|
|
### 示例 |
|
|
|
### 示例 |
|
|
|
``` |
|
|
|
``` |
|
|
|
const ConstantRedisType = 'dec.constant.database.conf.connect.types'; |
|
|
|
const DataBaseConfigProvider = 'dec.connection.provider.datebase'; |
|
|
|
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 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, { |
|
|
|
const RedisShow = BI.inherit(BI.Widget, { |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
formData: { |
|
|
|
formData: { |
|
|
@ -115,15 +119,11 @@ BI.DOM.ready(() => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.shortcut(RedisShowName, RedisShow); |
|
|
|
BI.shortcut(RedisShowName, RedisShow); |
|
|
|
BI.constant(ConstantRedisShow, RedisShowName); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit'; |
|
|
|
|
|
|
|
const RedisEdit = BI.inherit(BI.Widget, { |
|
|
|
const RedisEdit = BI.inherit(BI.Widget, { |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
formData: { |
|
|
|
value: { |
|
|
|
url: '', |
|
|
|
url: '', |
|
|
|
port: '6379', |
|
|
|
port: '6379', |
|
|
|
password: '', |
|
|
|
password: '', |
|
|
@ -154,7 +154,7 @@ BI.DOM.ready(() => { |
|
|
|
ref: _ref => { |
|
|
|
ref: _ref => { |
|
|
|
this.url = _ref; |
|
|
|
this.url = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
text: o.formData.url, |
|
|
|
text: o.value.url, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
@ -175,7 +175,7 @@ BI.DOM.ready(() => { |
|
|
|
ref: _ref => { |
|
|
|
ref: _ref => { |
|
|
|
this.port = _ref; |
|
|
|
this.port = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
text: o.formData.port, |
|
|
|
text: o.value.port, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
@ -197,14 +197,14 @@ BI.DOM.ready(() => { |
|
|
|
ref: _ref => { |
|
|
|
ref: _ref => { |
|
|
|
this.password = _ref; |
|
|
|
this.password = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
text: o.formData.password, |
|
|
|
text: o.value.password, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
getSubmitValue() { |
|
|
|
getValue() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
url: this.url.getValue(), |
|
|
|
url: this.url.getValue(), |
|
|
|
port: this.port.getValue(), |
|
|
|
port: this.port.getValue(), |
|
|
@ -212,9 +212,6 @@ BI.DOM.ready(() => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.shortcut(RedisEditName, RedisEdit); |
|
|
|
BI.shortcut(RedisEditName, RedisEdit); |
|
|
|
BI.constant(ConstantRedisEdit, RedisEditName); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
``` |