Browse Source

refactor: 修正不规范的写法

qufenxi
alan 6 years ago
parent
commit
f981258d31
  1. 2
      private/constants.ts
  2. 6
      src/app/app.ts
  3. 4
      src/app/connection/link_set.ts
  4. 167
      src/app/connection/right/right_edit/right_edit.ts
  5. 155
      src/app/connection/right/right_edit/right_edit_jndi.ts
  6. 150
      src/app/connection/right/right_edit/right_edit_mysql.ts
  7. 153
      src/app/connection/right/right_show/right_show_jndi.ts
  8. 6
      src/app/connection/right/right_title/right_title.ts
  9. 1
      src/app/status/left/left_item.ts
  10. 4
      src/app/status/link_status.ts
  11. 6
      src/app/status/right/right.ts
  12. 2
      src/app/title/item/title_item.ts
  13. 31
      src/shared/components/form_item.ts
  14. 4
      src/shared/components/title.ts

2
private/constants.ts

@ -1,6 +1,6 @@
export const OTHER_CONNECT = 'other'; export const OTHER_CONNECT = 'other';
export const JNDI_CONNECT = 'JNDI'; export const JNDI_CONNECT = 'JNDI';
export const MYSQL_CONNECT = 'mysql'; export const MYSQL_CONNECT = 'MySQL';
export const DEFAULT_INFO = 'DESIGNER'; export const DEFAULT_INFO = 'DESIGNER';
export const ACTION_DELETE = 'ACTION_DELETE'; export const ACTION_DELETE = 'ACTION_DELETE';
export const ACTION_COPY = 'ACTION_COPY'; export const ACTION_COPY = 'ACTION_COPY';

6
src/app/app.ts

@ -1,4 +1,4 @@
import {Vtape, Vertical, Absolute} from '../ui/index'; import {Vtape, Absolute} from '../ui/index';
import appModel from './app.model'; import appModel from './app.model';
import title from './title/title'; import title from './title/title';
import linkSet from './connection/link_set'; import linkSet from './connection/link_set';
@ -7,6 +7,9 @@ import '../less/index.less';
const className = 'dec.dcm.main'; const className = 'dec.dcm.main';
const Widget = BI.inherit(BI.Widget, { const Widget = BI.inherit(BI.Widget, {
props: {
baseCls: 'dec-webui-dcm-layout bi-background',
},
_store() { _store() {
return BI.Models.getModel(appModel); return BI.Models.getModel(appModel);
}, },
@ -16,7 +19,6 @@ const Widget = BI.inherit(BI.Widget, {
render() { render() {
return { return {
type: Vtape, type: Vtape,
cls: 'dec-webui-dcm-layout bi-background',
items: [ items: [
{ {
el: { el: {

4
src/app/connection/link_set.ts

@ -6,6 +6,9 @@ import Right from './right/right';
import {TAB_LINK_SET} from '@private/constants'; import {TAB_LINK_SET} from '@private/constants';
const className = 'dec.dcm.linkset'; const className = 'dec.dcm.linkset';
const Widget: WidgetType = { const Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() { _store() {
return BI.Models.getModel(linkSetModel); return BI.Models.getModel(linkSetModel);
}, },
@ -17,7 +20,6 @@ const Widget: WidgetType = {
render() { render() {
return { return {
type: Htape, type: Htape,
cls: 'bi-card',
items: [{ items: [{
el: { el: {
type: Vtape, type: Vtape,

167
src/app/connection/right/right_edit/right_edit.ts

@ -1,8 +1,7 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor} from '@ui/index'; import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor, VerticalAdapt, Label} from '@ui/index';
import {LinkType} from '@ui/type'; import {LinkType} from '@ui/type';
import {CONNECT_CHARSET} from '@private/constants'; import {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model'; import Model from '../../link_set.model';
import FormItem from '@shared/components/form_item';
import Title from '@shared/components/title'; import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service'; import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null; let connectionName: any = null;
@ -31,10 +30,16 @@ const Widget: WidgetType = {
vgap: 10, vgap: 10,
items: [ items: [
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'), text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
hint: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'), },
form: { {
type: TextEditor, type: TextEditor,
width: 300, width: 300,
value: linkSelected.connectionName, value: linkSelected.connectionName,
@ -56,19 +61,40 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
{
type: Label,
cls: 'bi-water-mark',
lgap: 5,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
}, },
],
},
{
type: VerticalAdapt,
items: [
{ {
type: FormItem, type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_First_Step'), text: BI.i18nText('Dec-Dcm_First_Step'),
height: 420, },
form: { {
type: Vertical, type: Vertical,
vgap: 10, vgap: 10,
items: [ items: [
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
form: { },
{
type: TextValueCombo, type: TextValueCombo,
width: 300, width: 300,
text: linkSelected.driver, text: linkSelected.driver,
@ -83,11 +109,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'), text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
form: { },
{
type: TextEditor, type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -102,11 +136,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
form: { },
{
type: TextValueCombo, type: TextValueCombo,
width: 300, width: 300,
text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName, text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
@ -127,11 +169,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
form: { },
{
type: TextEditor, type: TextEditor,
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
@ -147,11 +197,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'), text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
form: { },
{
type: TextEditor, type: TextEditor,
inputType: 'password', inputType: 'password',
allowBlank: true, allowBlank: true,
@ -168,17 +226,25 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: Title, type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'), text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
height: 100, },
form: { {
type: TextAreaEditor, type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -194,11 +260,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
form: { },
{
type: MultiSelectItem, type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'), text: BI.i18nText('Dec-Dcm_Yes'),
selected: linkSelected.testOnBorrow, selected: linkSelected.testOnBorrow,
@ -213,11 +287,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'), text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
form: { },
{
type: TextEditor, type: TextEditor,
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
@ -235,32 +317,53 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
], ],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Second_Step'), text: BI.i18nText('Dec-Dcm_Second_Step'),
form: { },
{
type: Button, type: Button,
width: 80, width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'), text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore', level: 'ignore',
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Third_Step'), text: BI.i18nText('Dec-Dcm_Third_Step'),
form: { },
type: FormItem, {
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'), text: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
form: { },
{
type: TextEditor, type: TextEditor,
width: 300, width: 300,
disabled: true, disabled: true,
}, },
}, ],
}, },
], ],
}; };

155
src/app/connection/right/right_edit/right_edit_jndi.ts

@ -1,5 +1,4 @@
import {Vertical, Editor, TextValueCombo, TextButton, Label, TextEditor} from '@ui'; import {Vertical, TextValueCombo, TextButton, Label, TextEditor, VerticalAdapt} from '@ui';
import FormItem from '@shared/components/form_item';
import {JNDI_FACTORYS, OTHER_ATTRIBUTES, CONNECT_CHARSET} from '@private/constants'; import {JNDI_FACTORYS, OTHER_ATTRIBUTES, CONNECT_CHARSET} from '@private/constants';
import {AttributeType} from '../right.typing'; import {AttributeType} from '../right.typing';
import ModelName from './right_edit.model'; import ModelName from './right_edit.model';
@ -11,9 +10,7 @@ const Widget = BI.inherit(BI.Widget, {
}, },
watch: { watch: {
isCollapse(isCollapse) { isCollapse(isCollapse) {
const height = isCollapse ? 550 : 200;
const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'); const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes');
this.jndiFormRef.setHeight(height);
this.collapseRef.setText(text); this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse); this.otherAttributesRef.setVisible(isCollapse);
}, },
@ -26,31 +23,48 @@ const Widget = BI.inherit(BI.Widget, {
vgap: 10, vgap: 10,
items: [ items: [
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'), text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
form: { },
{
type: TextEditor, type: TextEditor,
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: connectionName, value: connectionName,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'), text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'),
height: 200,
ref: _ref => {
this.jndiFormRef = _ref;
}, },
form: { {
type: Vertical, type: Vertical,
vgap: 10, vgap: 10,
items: [ items: [
{ {
type: FormItem, type: VerticalAdapt,
text: 'INTIAL_CONTEXT_FACTORY', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: TextValueCombo, type: TextValueCombo,
width: 300, width: 300,
value: factory, value: factory,
@ -61,47 +75,69 @@ const Widget = BI.inherit(BI.Widget, {
}; };
}), }),
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
text: 'PROVIDER_URL', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: TextEditor, type: TextEditor,
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: url, value: url,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
text: 'SECURITY_PRINCIPAL', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: TextEditor, type: TextEditor,
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: principal, value: principal,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
text: 'SECURITY_CREDENTIALS', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: TextEditor, type: TextEditor,
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: credentials, value: credentials,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
width: 180, items: [
form: { {
type: TextButton, type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'), text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 300, width: 480,
textAlign: 'right', textAlign: 'right',
ref: _ref => { ref: _ref => {
this.collapseRef = _ref; this.collapseRef = _ref;
@ -110,6 +146,7 @@ const Widget = BI.inherit(BI.Widget, {
this.store.setIsCollapse(!this.model.isCollapse); this.store.setIsCollapse(!this.model.isCollapse);
}, },
}, },
],
}, },
{ {
type: Vertical, type: Vertical,
@ -117,45 +154,37 @@ const Widget = BI.inherit(BI.Widget, {
ref: _ref => { ref: _ref => {
this.otherAttributesRef = _ref; this.otherAttributesRef = _ref;
}, },
items: BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => { items: this._getOtherItems(),
return {
type: FormItem,
text: item.text,
width: 180,
form: {
type: TextEditor,
width: 300,
allowBlank: true,
value: this.options[item.name],
},
};
}),
}, },
], ],
}, },
],
}, },
{ {
type: FormItem,
text: '',
height: 25,
form: {
type: Label, type: Label,
cls: 'bi-error', cls: 'bi-error',
lgap: 10,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'), text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'),
}, },
},
{ {
type: FormItem, type: VerticalAdapt,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
height: 40,
form: {
type: Vertical,
items: [ items: [
{ {
type: FormItem, type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
},
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo, type: TextValueCombo,
width: 300, width: 300,
items: [{ items: [{
@ -165,12 +194,32 @@ const Widget = BI.inherit(BI.Widget, {
...CONNECT_CHARSET, ...CONNECT_CHARSET,
], ],
}, },
],
}, },
], ],
};
}, },
_getOtherItems() {
return BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: item.text,
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: this.options[item.name],
}, },
], ],
}; };
});
}, },
}); });
BI.shortcut(classNameEdit, Widget); BI.shortcut(classNameEdit, Widget);

150
src/app/connection/right/right_edit/right_edit_mysql.ts

@ -1,15 +1,26 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor} from '@ui/index'; import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor, VerticalAdapt, Label} from '@ui/index';
import {LinkType} from '@ui/type'; import {LinkType} from '@ui/type';
import {CONNECT_CHARSET} from '@private/constants'; import {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model'; import Model from '../../link_set.model';
import FormItem from '@shared/components/form_item';
import Title from '@shared/components/title'; import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service'; import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null;
const className = 'dec.dcm.component.right.edit.mysql'; const className = 'dec.dcm.component.right.edit.mysql';
const Widget: WidgetType = { const Widget: WidgetType = {
_store() { _store() {
return BI.Models.getModel(Model); return BI.Models.getModel(Model);
}, },
watch: {
connectionNameErr(msg: string) {
if (msg) {
BI.Bubbles.show('singleBubble', msg, connectionName, {
level: 'error',
});
} else {
BI.Bubbles.hide('singleBubble');
}
},
},
render() { render() {
const linkSelected: LinkType = this.model.linkSelected; const linkSelected: LinkType = this.model.linkSelected;
const that = this; const that = this;
@ -19,13 +30,22 @@ const Widget: WidgetType = {
vgap: 10, vgap: 10,
items: [ items: [
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'), text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
hint: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'), },
form: { {
type: TextEditor, type: TextEditor,
width: 300, width: 300,
value: linkSelected.connectionName, value: linkSelected.connectionName,
ref(ref: any) {
connectionName = ref;
},
listeners: [{ listeners: [{
eventName: BI.Editor.EVENT_CHANGE, eventName: BI.Editor.EVENT_CHANGE,
action() { action() {
@ -34,13 +54,34 @@ const Widget: WidgetType = {
connectionName: this.getValue(), connectionName: this.getValue(),
}); });
}, },
}, {
eventName: BI.Editor.EVENT_FOCUS,
action() {
that.store.setConnectionNameErr('');
},
}], }],
}, },
{
type: Label,
cls: 'bi-water-mark',
lgap: 5,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
}, },
],
},
{
type: VerticalAdapt,
items: [
{ {
type: FormItem, type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
form: { },
{
type: TextValueCombo, type: TextValueCombo,
width: 300, width: 300,
text: linkSelected.driver, text: linkSelected.driver,
@ -55,11 +96,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'), text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
form: { },
{
type: TextEditor, type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -74,11 +123,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
form: { },
{
type: TextValueCombo, type: TextValueCombo,
width: 300, width: 300,
text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName, text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
@ -99,11 +156,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
form: { },
{
type: TextEditor, type: TextEditor,
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
@ -119,11 +184,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'), text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
form: { },
{
type: TextEditor, type: TextEditor,
inputType: 'password', inputType: 'password',
allowBlank: true, allowBlank: true,
@ -140,17 +213,25 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: Title, type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'), text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
height: 100, },
form: { {
type: TextAreaEditor, type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -166,11 +247,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
form: { },
{
type: MultiSelectItem, type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'), text: BI.i18nText('Dec-Dcm_Yes'),
selected: linkSelected.testOnBorrow, selected: linkSelected.testOnBorrow,
@ -185,11 +274,19 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'), text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
form: { },
{
type: TextEditor, type: TextEditor,
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
@ -207,15 +304,18 @@ const Widget: WidgetType = {
}, },
}], }],
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
text: BI.i18nText('Dec-Dcm_Test_Connection'), items: [
form: { {
type: Button, type: Button,
width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'), text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore', level: 'ignore',
}, },
],
}, },
], ],
}; };

153
src/app/connection/right/right_show/right_show_jndi.ts

@ -1,5 +1,4 @@
import {Vertical, TextButton, Label} from '@ui'; import {Vertical, TextButton, Label, VerticalAdapt} from '@ui';
import FormItem from '@shared/components/form_item';
import {OTHER_ATTRIBUTES} from '@private/constants'; import {OTHER_ATTRIBUTES} from '@private/constants';
import {AttributeType} from '../right.typing'; import {AttributeType} from '../right.typing';
import ModelName from './right_show.model'; import ModelName from './right_show.model';
@ -11,9 +10,7 @@ const Widget = BI.inherit(BI.Widget, {
}, },
watch: { watch: {
isCollapse(isCollapse) { isCollapse(isCollapse) {
const height = isCollapse ? 550 : 200;
const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'); const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes');
this.jndiFormRef.setHeight(height);
this.collapseRef.setText(text); this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse); this.otherAttributesRef.setVisible(isCollapse);
}, },
@ -26,69 +23,107 @@ const Widget = BI.inherit(BI.Widget, {
vgap: 10, vgap: 10,
items: [ items: [
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'), text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
form: { },
{
type: Label, type: Label,
text: connectionName, text: connectionName,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'), text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'),
height: 200,
ref: _ref => {
this.jndiFormRef = _ref;
}, },
form: { {
type: Vertical, type: Vertical,
vgap: 10, vgap: 10,
items: [ items: [
{ {
type: FormItem, type: VerticalAdapt,
text: 'INTIAL_CONTEXT_FACTORY', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: Label, type: Label,
text: factory, text: factory,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
text: 'PROVIDER_URL', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: Label, type: Label,
text: url, text: url,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
text: 'SECURITY_PRINCIPAL', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: Label, type: Label,
text: principal, value: principal,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
text: 'SECURITY_CREDENTIALS', items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180, width: 180,
form: { textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: Label, type: Label,
text: credentials, value: credentials,
}, },
],
}, },
{ {
type: FormItem, type: VerticalAdapt,
width: 180, items: [
form: { {
type: TextButton, type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'), text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 300, width: 480,
textAlign: 'right', textAlign: 'right',
value: true,
ref: _ref => { ref: _ref => {
this.collapseRef = _ref; this.collapseRef = _ref;
}, },
@ -96,6 +131,7 @@ const Widget = BI.inherit(BI.Widget, {
this.store.setIsCollapse(!this.model.isCollapse); this.store.setIsCollapse(!this.model.isCollapse);
}, },
}, },
],
}, },
{ {
type: Vertical, type: Vertical,
@ -103,42 +139,65 @@ const Widget = BI.inherit(BI.Widget, {
ref: _ref => { ref: _ref => {
this.otherAttributesRef = _ref; this.otherAttributesRef = _ref;
}, },
items: BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => { items: this._getOtherItems(),
return {
type: FormItem,
text: item.text,
width: 180,
form: {
type: Label,
text: this.options[item.name],
},
};
}),
}, },
], ],
}, },
],
}, },
{ {
type: FormItem,
text: '',
height: 25,
form: {
type: Label, type: Label,
cls: 'bi-error', cls: 'bi-error',
lgap: 10,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'), text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'),
}, },
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
}, },
{ {
type: FormItem, type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
form: { },
{
type: Label, type: Label,
text: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Auto'), text: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
}, },
],
}, },
], ],
}; };
}, },
_getOtherItems() {
return BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: item.text,
},
{
type: Label,
value: this.options[item.name],
},
],
};
});
},
}); });
BI.shortcut(className, Widget); BI.shortcut(className, Widget);
export default className; export default className;

6
src/app/connection/right/right_title/right_title.ts

@ -1,9 +1,12 @@
import {WidgetType, Left, Label, Button, LeftRightVerticalAdapt} from '@ui/index'; import {WidgetType, Label, Button, LeftRightVerticalAdapt} from '@ui/index';
import RightTitleModel from '../../link_set.model'; import RightTitleModel from '../../link_set.model';
import {LinkType} from '@ui/type'; import {LinkType} from '@ui/type';
import {OTHER_CONNECT} from '@private/constants'; import {OTHER_CONNECT} from '@private/constants';
const className = 'dec.dcm.component.right.title'; const className = 'dec.dcm.component.right.title';
const Widget: WidgetType = { const Widget: WidgetType = {
props: {
baseCls: 'bi-border-bottom',
},
_store() { _store() {
return BI.Models.getModel(RightTitleModel); return BI.Models.getModel(RightTitleModel);
}, },
@ -17,7 +20,6 @@ const Widget: WidgetType = {
return { return {
type: LeftRightVerticalAdapt, type: LeftRightVerticalAdapt,
height: 40, height: 40,
cls: 'bi-border-bottom',
items: { items: {
left: [ left: [
{ {

1
src/app/status/left/left_item.ts

@ -6,6 +6,7 @@ const Widget: WidgetType = {
title: '', title: '',
id: '', id: '',
creator: '', creator: '',
baseCls: 'bi-list-item-active',
}, },
_store() { _store() {
return BI.Models.getModel(Model); return BI.Models.getModel(Model);

4
src/app/status/link_status.ts

@ -6,6 +6,9 @@ import {TAB_LINK_POOL} from '@private/constants';
const className = 'dec.dcm.linkstatus'; const className = 'dec.dcm.linkstatus';
const Widget: WidgetType = { const Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() { _store() {
return BI.Models.getModel(linkStatusModel); return BI.Models.getModel(linkStatusModel);
}, },
@ -17,7 +20,6 @@ const Widget: WidgetType = {
render() { render() {
return { return {
type: Htape, type: Htape,
cls: 'bi-card',
items: [{ items: [{
el: { el: {
type: Vtape, type: Vtape,

6
src/app/status/right/right.ts

@ -6,9 +6,12 @@ import {InfoType} from './right.typings';
import {LinkType} from '@ui/type'; import {LinkType} from '@ui/type';
import pluginListConstant from '../../app.constant'; import pluginListConstant from '../../app.constant';
const className = 'dec.dcm.component.linkStatus.right'; const className = 'dcm-link-form';
const Widget: WidgetType = { const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
},
_store() { _store() {
return BI.Models.getModel(Model); return BI.Models.getModel(Model);
}, },
@ -30,7 +33,6 @@ const Widget: WidgetType = {
render() { render() {
return { return {
type: Vertical, type: Vertical,
cls: 'dcm-link-form',
items: [ items: [
{ {
type: VerticalAdapt, type: VerticalAdapt,

2
src/app/title/item/title_item.ts

@ -4,6 +4,7 @@ import {getSelectStyle} from './title_item.service';
const className = 'dec.dcm.title.item'; const className = 'dec.dcm.title.item';
const Widget = BI.inherit(BI.BasicButton, { const Widget = BI.inherit(BI.BasicButton, {
props: { props: {
baseCls: 'bi-font-bold',
text: '', text: '',
}, },
_store() { _store() {
@ -20,7 +21,6 @@ const Widget = BI.inherit(BI.BasicButton, {
return { return {
type: Label, type: Label,
cls: 'bi-font-bold',
height: 40, height: 40,
hgap: 15, hgap: 15,
text, text,

31
src/shared/components/form_item.ts

@ -1,31 +0,0 @@
import {WidgetType, Htape, Label} from '@ui/index';
const className = 'dec.dcm.shared.component.form.item';
const Widget: WidgetType = {
props: {
height: 24,
},
render() {
const {text, form, hint, width = 115} = this.options;
return {
type: Htape,
items: [{
el: {
type: Label,
cls: 'bi-font-bold',
textAlign: 'left',
text,
},
width,
}, form, hint ? {
type: Label,
cls: 'bi-water-mark',
lgap: 5,
textAlign: 'left',
text: hint,
} : null],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

4
src/shared/components/title.ts

@ -1,12 +1,14 @@
import {WidgetType, Label} from '@ui/index'; import {WidgetType, Label} from '@ui/index';
const className = 'dec.dcm.shared.component.title'; const className = 'dec.dcm.shared.component.title';
const Widget: WidgetType = { const Widget: WidgetType = {
props: {
baseCls: 'bi-tips bi-border-bottom',
},
render() { render() {
const {text} = this.options; const {text} = this.options;
return { return {
type: Label, type: Label,
cls: 'bi-water-mark bi-border-bottom',
height: 24, height: 24,
bgap: 10, bgap: 10,
textAlign: 'left', textAlign: 'left',

Loading…
Cancel
Save