|
|
@ -36,185 +36,180 @@ ConstantName名称为`dec.constant.database.conf.connect.form.${name}.show`, |
|
|
|
|
|
|
|
|
|
|
|
### 示例 |
|
|
|
### 示例 |
|
|
|
``` |
|
|
|
``` |
|
|
|
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'; |
|
|
|
const RedisShowName = 'dec.dcm.connection.plugin.redis.show'; |
|
|
|
|
|
|
|
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit'; |
|
|
|
BI.DOM.ready(() => { |
|
|
|
BI.config(DataBaseConfigProvider, function (provider) { |
|
|
|
BI.config(ConstantRedisType, datas => [...datas, { |
|
|
|
provider.registerDatabaseType({ |
|
|
|
text: 'Redis', |
|
|
|
text: "Redis", |
|
|
|
databaseType: 'Redis', |
|
|
|
databaseType: "Redis", |
|
|
|
}]); |
|
|
|
edit: "dec.dcm.connection.plugin.demo.edit", |
|
|
|
|
|
|
|
show: "dec.dcm.connection.plugin.demo.show", |
|
|
|
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); |
|
|
|
const RedisShow = BI.inherit(BI.Widget, { |
|
|
|
BI.constant(ConstantRedisShow, RedisShowName); |
|
|
|
props: { |
|
|
|
|
|
|
|
formData: { |
|
|
|
|
|
|
|
url: '', |
|
|
|
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit'; |
|
|
|
port: '6379', |
|
|
|
const RedisEdit = BI.inherit(BI.Widget, { |
|
|
|
password: '', |
|
|
|
props: { |
|
|
|
|
|
|
|
formData: { |
|
|
|
|
|
|
|
url: '', |
|
|
|
|
|
|
|
port: '6379', |
|
|
|
|
|
|
|
password: '', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
render() { |
|
|
|
}, |
|
|
|
const o = this.options; |
|
|
|
render() { |
|
|
|
|
|
|
|
const o = this.options; |
|
|
|
return { |
|
|
|
|
|
|
|
type: 'bi.vertical', |
|
|
|
return { |
|
|
|
hgap: 15, |
|
|
|
type: 'bi.vertical', |
|
|
|
vgap: 10, |
|
|
|
hgap: 15, |
|
|
|
items: [ |
|
|
|
vgap: 10, |
|
|
|
{ |
|
|
|
items: [ |
|
|
|
type: 'bi.left', |
|
|
|
{ |
|
|
|
items: [ |
|
|
|
type: 'bi.left', |
|
|
|
{ |
|
|
|
items: [ |
|
|
|
type: 'bi.label', |
|
|
|
{ |
|
|
|
cls: 'bi-font-bold', |
|
|
|
type: 'bi.label', |
|
|
|
width: 100, |
|
|
|
cls: 'bi-font-bold', |
|
|
|
textAlign: 'left', |
|
|
|
width: 100, |
|
|
|
text: '数据库地址', |
|
|
|
textAlign: 'left', |
|
|
|
}, |
|
|
|
text: '数据库地址', |
|
|
|
{ |
|
|
|
}, |
|
|
|
type: 'bi.text_editor', |
|
|
|
{ |
|
|
|
width: 300, |
|
|
|
type: 'bi.label', |
|
|
|
allowBlank: true, |
|
|
|
text: o.formData.url, |
|
|
|
ref: _ref => { |
|
|
|
}, |
|
|
|
this.url = _ref; |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
text: o.formData.url, |
|
|
|
{ |
|
|
|
}, |
|
|
|
type: 'bi.left', |
|
|
|
], |
|
|
|
items: [ |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: 'bi.label', |
|
|
|
type: 'bi.left', |
|
|
|
cls: 'bi-font-bold', |
|
|
|
items: [ |
|
|
|
width: 100, |
|
|
|
{ |
|
|
|
textAlign: 'left', |
|
|
|
type: 'bi.label', |
|
|
|
text: '端口号', |
|
|
|
cls: 'bi-font-bold', |
|
|
|
}, |
|
|
|
width: 100, |
|
|
|
{ |
|
|
|
textAlign: 'left', |
|
|
|
type: 'bi.label', |
|
|
|
text: '端口号', |
|
|
|
text: o.formData.port, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
], |
|
|
|
type: 'bi.text_editor', |
|
|
|
}, |
|
|
|
width: 300, |
|
|
|
{ |
|
|
|
allowBlank: true, |
|
|
|
type: 'bi.left', |
|
|
|
ref: _ref => { |
|
|
|
items: [ |
|
|
|
this.port = _ref; |
|
|
|
{ |
|
|
|
}, |
|
|
|
type: 'bi.label', |
|
|
|
text: o.formData.port, |
|
|
|
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: { |
|
|
|
|
|
|
|
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.left', |
|
|
|
type: 'bi.label', |
|
|
|
items: [ |
|
|
|
cls: 'bi-font-bold', |
|
|
|
{ |
|
|
|
width: 100, |
|
|
|
type: 'bi.label', |
|
|
|
textAlign: 'left', |
|
|
|
cls: 'bi-font-bold', |
|
|
|
text: '密码', |
|
|
|
width: 100, |
|
|
|
|
|
|
|
textAlign: 'left', |
|
|
|
|
|
|
|
text: '端口号', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: 'bi.text_editor', |
|
|
|
|
|
|
|
width: 300, |
|
|
|
|
|
|
|
allowBlank: true, |
|
|
|
|
|
|
|
ref: _ref => { |
|
|
|
|
|
|
|
this.port = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: o.formData.port, |
|
|
|
type: 'bi.text_editor', |
|
|
|
}, |
|
|
|
width: 300, |
|
|
|
], |
|
|
|
allowBlank: true, |
|
|
|
}, |
|
|
|
inputType: 'password', |
|
|
|
{ |
|
|
|
ref: _ref => { |
|
|
|
type: 'bi.left', |
|
|
|
this.password = _ref; |
|
|
|
items: [ |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: o.formData.password, |
|
|
|
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(), |
|
|
|
getSubmitValue() { |
|
|
|
port: this.port.getValue(), |
|
|
|
return { |
|
|
|
password: this.password.getValue(), |
|
|
|
url: this.url.getValue(), |
|
|
|
}; |
|
|
|
port: this.port.getValue(), |
|
|
|
}, |
|
|
|
password: this.password.getValue(), |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
BI.shortcut(RedisEditName, RedisEdit); |
|
|
|
|
|
|
|
BI.constant(ConstantRedisEdit, RedisEditName); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
BI.shortcut(RedisEditName, RedisEdit); |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
``` |
|
|
|