10 changed files with 254 additions and 38 deletions
@ -1,20 +0,0 @@ |
|||||||
import {Left, WidgetType, Label} from '@ui/index'; |
|
||||||
const className = 'fr.plugin.text'; |
|
||||||
const Widget: WidgetType = { |
|
||||||
render() { |
|
||||||
return { |
|
||||||
type: Left, |
|
||||||
cls: 'title', |
|
||||||
items: [{ |
|
||||||
type: Label, |
|
||||||
text:'123', |
|
||||||
}], |
|
||||||
}; |
|
||||||
}, |
|
||||||
}; |
|
||||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
|
||||||
|
|
||||||
export default className; |
|
||||||
|
|
||||||
BI.constant('bi.constant.database.conf.connect.form.redis.edit', className); |
|
||||||
BI.constant('bi.constant.database.conf.connect.form.redis.show', className); |
|
@ -1,6 +1,5 @@ |
|||||||
export const ConstantName = 'bi.constant.database.conf.connect.list'; |
export const ConstantName = 'dec.constant.database.conf.connect.list'; |
||||||
BI.constant(ConstantName, [ |
BI.constant(ConstantName, [ |
||||||
'APACHE KYLIN', 'DERBY', 'HP Vertica', 'IBM DB2', 'INFORMIX', 'Microsoft SQL Server', 'MySQL', 'Oracle', 'Privotal Greenplum Database', 'Postgresql', 'GaussDB 200', |
'APACHE KYLIN', 'DERBY', 'HP Vertica', 'IBM DB2', 'INFORMIX', 'Microsoft SQL Server', 'MySQL', 'Oracle', 'Privotal Greenplum Database', 'Postgresql', 'GaussDB 200', |
||||||
]); |
]); |
||||||
BI.config(ConstantName, (datas: string[]) => [...datas, 'Redis']); |
|
||||||
export default ConstantName; |
export default ConstantName; |
||||||
|
@ -0,0 +1,97 @@ |
|||||||
|
import './style.scss'; |
||||||
|
const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value'; |
||||||
|
const form = { |
||||||
|
url:'192.168.1.22', |
||||||
|
port: 6379, |
||||||
|
password: '123456', |
||||||
|
}; |
||||||
|
|
||||||
|
const classNameEdit = 'fr.plugin.redis.edit'; |
||||||
|
const Widget = BI.inherit(BI.Widget, { |
||||||
|
render() { |
||||||
|
return { |
||||||
|
type: 'bi.vertical', |
||||||
|
cls:'bi-plugin-redis', |
||||||
|
bgap:10, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.left', |
||||||
|
height: 30, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text: '数据库地址:', |
||||||
|
height: 24, |
||||||
|
width: 115, |
||||||
|
textAlign: 'left', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.editor', |
||||||
|
cls: 'bi-border', |
||||||
|
watermark: '数据库地址', |
||||||
|
value:form.url, |
||||||
|
allowBlank: true, |
||||||
|
width: 300, |
||||||
|
height: 24, |
||||||
|
}], |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.left', |
||||||
|
height: 30, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text: '端口:', |
||||||
|
height: 24, |
||||||
|
width: 115, |
||||||
|
textAlign: 'left', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.editor', |
||||||
|
cls: 'bi-border', |
||||||
|
watermark: '端口', |
||||||
|
allowBlank: true, |
||||||
|
width: 300, |
||||||
|
height: 24, |
||||||
|
value: form.port, |
||||||
|
errorText: '请输入有效的正整数', |
||||||
|
validationChecker (v: string) { |
||||||
|
if (/^\+?[1-9][0-9]*$/.test(v)) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
return false; |
||||||
|
}, |
||||||
|
}], |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.left', |
||||||
|
height: 30, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text: '密码:', |
||||||
|
height: 24, |
||||||
|
width: 115, |
||||||
|
textAlign: 'left', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.editor', |
||||||
|
cls: 'bi-border', |
||||||
|
inputType:'password', |
||||||
|
value: form.password, |
||||||
|
allowBlank: true, |
||||||
|
width: 300, |
||||||
|
height: 24, |
||||||
|
}], |
||||||
|
}, |
||||||
|
], |
||||||
|
}; |
||||||
|
}, |
||||||
|
}); |
||||||
|
BI.shortcut(classNameEdit, Widget); |
||||||
|
export default classNameEdit; |
||||||
|
export const ConstantName = 'dec.constant.database.conf.connect.list'; |
||||||
|
BI.config(ConstantName, (datas: string[]) => [...datas, 'Redis']); |
||||||
|
BI.constant(RedisConstantName, form); |
||||||
|
BI.constant('dec.constant.database.conf.connect.form.redis.edit', classNameEdit); |
@ -0,0 +1,69 @@ |
|||||||
|
const classNamePreview = 'fr.plugin.redis.preview'; |
||||||
|
const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value'; |
||||||
|
const form = BI.Constants.getConstant(RedisConstantName); |
||||||
|
console.log('%cform: ', 'color: MidnightBlue; background: Aquamarine;', form); |
||||||
|
|
||||||
|
const Widget = BI.inherit(BI.Widget, { |
||||||
|
render() { |
||||||
|
return { |
||||||
|
type: 'bi.vertical', |
||||||
|
cls:'bi-plugin-redis', |
||||||
|
bgap:10, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.left', |
||||||
|
height: 30, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text: '数据库地址:', |
||||||
|
height: 24, |
||||||
|
width: 115, |
||||||
|
textAlign: 'left', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text:form.url, |
||||||
|
height: 24, |
||||||
|
}], |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.left', |
||||||
|
height: 30, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text: '端口:', |
||||||
|
height: 24, |
||||||
|
width: 115, |
||||||
|
textAlign: 'left', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text:form.port, |
||||||
|
height: 24, |
||||||
|
}], |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.left', |
||||||
|
height: 30, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text: '密码:', |
||||||
|
height: 24, |
||||||
|
width: 115, |
||||||
|
textAlign: 'left', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.label', |
||||||
|
text:'********', |
||||||
|
height: 24, |
||||||
|
}], |
||||||
|
}, |
||||||
|
], |
||||||
|
}; |
||||||
|
}, |
||||||
|
}); |
||||||
|
BI.shortcut(classNamePreview, Widget); |
||||||
|
BI.constant('dec.constant.database.conf.connect.form.redis.preview', classNamePreview); |
Loading…
Reference in new issue