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 JNDI_CONNECT = 'JNDI';
export const MYSQL_CONNECT = 'mysql';
export const MYSQL_CONNECT = 'MySQL';
export const DEFAULT_INFO = 'DESIGNER';
export const ACTION_DELETE = 'ACTION_DELETE';
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 title from './title/title';
import linkSet from './connection/link_set';
@ -7,6 +7,9 @@ import '../less/index.less';
const className = 'dec.dcm.main';
const Widget = BI.inherit(BI.Widget, {
props: {
baseCls: 'dec-webui-dcm-layout bi-background',
},
_store() {
return BI.Models.getModel(appModel);
},
@ -16,7 +19,6 @@ const Widget = BI.inherit(BI.Widget, {
render() {
return {
type: Vtape,
cls: 'dec-webui-dcm-layout bi-background',
items: [
{
el: {

4
src/app/connection/link_set.ts

@ -6,6 +6,9 @@ import Right from './right/right';
import {TAB_LINK_SET} from '@private/constants';
const className = 'dec.dcm.linkset';
const Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() {
return BI.Models.getModel(linkSetModel);
},
@ -17,7 +20,6 @@ const Widget: WidgetType = {
render() {
return {
type: Htape,
cls: 'bi-card',
items: [{
el: {
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 {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model';
import FormItem from '@shared/components/form_item';
import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null;
@ -31,10 +30,16 @@ const Widget: WidgetType = {
vgap: 10,
items: [
{
type: FormItem,
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
hint: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
form: {
},
{
type: TextEditor,
width: 300,
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'),
height: 420,
form: {
},
{
type: Vertical,
vgap: 10,
items: [
{
type: FormItem,
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
form: {
},
{
type: TextValueCombo,
width: 300,
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'),
form: {
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
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'),
form: {
},
{
type: TextValueCombo,
width: 300,
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'),
form: {
},
{
type: TextEditor,
allowBlank: true,
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'),
form: {
},
{
type: TextEditor,
inputType: 'password',
allowBlank: true,
@ -168,17 +226,25 @@ const Widget: WidgetType = {
},
}],
},
],
},
{
type: Title,
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'),
height: 100,
form: {
},
{
type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
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'),
form: {
},
{
type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'),
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'),
form: {
},
{
type: TextEditor,
allowBlank: true,
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'),
form: {
},
{
type: Button,
width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore',
},
],
},
{
type: FormItem,
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
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'),
form: {
},
{
type: TextEditor,
width: 300,
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 FormItem from '@shared/components/form_item';
import {Vertical, TextValueCombo, TextButton, Label, TextEditor, VerticalAdapt} from '@ui';
import {JNDI_FACTORYS, OTHER_ATTRIBUTES, CONNECT_CHARSET} from '@private/constants';
import {AttributeType} from '../right.typing';
import ModelName from './right_edit.model';
@ -11,9 +10,7 @@ const Widget = BI.inherit(BI.Widget, {
},
watch: {
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');
this.jndiFormRef.setHeight(height);
this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse);
},
@ -26,31 +23,48 @@ const Widget = BI.inherit(BI.Widget, {
vgap: 10,
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'),
form: {
},
{
type: TextEditor,
width: 300,
allowBlank: true,
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'),
height: 200,
ref: _ref => {
this.jndiFormRef = _ref;
},
form: {
{
type: Vertical,
vgap: 10,
items: [
{
type: FormItem,
text: 'INTIAL_CONTEXT_FACTORY',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: TextValueCombo,
width: 300,
value: factory,
@ -61,47 +75,69 @@ const Widget = BI.inherit(BI.Widget, {
};
}),
},
],
},
{
type: FormItem,
text: 'PROVIDER_URL',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: url,
},
],
},
{
type: FormItem,
text: 'SECURITY_PRINCIPAL',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: principal,
},
],
},
{
type: FormItem,
text: 'SECURITY_CREDENTIALS',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: credentials,
},
],
},
{
type: FormItem,
width: 180,
form: {
type: VerticalAdapt,
items: [
{
type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 300,
width: 480,
textAlign: 'right',
ref: _ref => {
this.collapseRef = _ref;
@ -110,6 +146,7 @@ const Widget = BI.inherit(BI.Widget, {
this.store.setIsCollapse(!this.model.isCollapse);
},
},
],
},
{
type: Vertical,
@ -117,45 +154,37 @@ const Widget = BI.inherit(BI.Widget, {
ref: _ref => {
this.otherAttributesRef = _ref;
},
items: BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: FormItem,
text: item.text,
width: 180,
form: {
type: TextEditor,
width: 300,
allowBlank: true,
value: this.options[item.name],
},
};
}),
items: this._getOtherItems(),
},
],
},
],
},
{
type: FormItem,
text: '',
height: 25,
form: {
type: Label,
cls: 'bi-error',
lgap: 10,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'),
},
},
{
type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
height: 40,
form: {
type: Vertical,
type: VerticalAdapt,
items: [
{
type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
type: Label,
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,
form: {
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo,
width: 300,
items: [{
@ -165,12 +194,32 @@ const Widget = BI.inherit(BI.Widget, {
...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);

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 {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model';
import FormItem from '@shared/components/form_item';
import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null;
const className = 'dec.dcm.component.right.edit.mysql';
const Widget: WidgetType = {
_store() {
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() {
const linkSelected: LinkType = this.model.linkSelected;
const that = this;
@ -19,13 +30,22 @@ const Widget: WidgetType = {
vgap: 10,
items: [
{
type: FormItem,
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
hint: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
form: {
},
{
type: TextEditor,
width: 300,
value: linkSelected.connectionName,
ref(ref: any) {
connectionName = ref;
},
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
@ -34,13 +54,34 @@ const Widget: WidgetType = {
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'),
form: {
},
{
type: TextValueCombo,
width: 300,
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'),
form: {
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
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'),
form: {
},
{
type: TextValueCombo,
width: 300,
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'),
form: {
},
{
type: TextEditor,
allowBlank: true,
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'),
form: {
},
{
type: TextEditor,
inputType: 'password',
allowBlank: true,
@ -140,17 +213,25 @@ const Widget: WidgetType = {
},
}],
},
],
},
{
type: Title,
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'),
height: 100,
form: {
},
{
type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
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'),
form: {
},
{
type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'),
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'),
form: {
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
@ -207,15 +304,18 @@ const Widget: WidgetType = {
},
}],
},
],
},
{
type: FormItem,
text: BI.i18nText('Dec-Dcm_Test_Connection'),
form: {
type: VerticalAdapt,
items: [
{
type: Button,
width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore',
},
],
},
],
};

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

@ -1,5 +1,4 @@
import {Vertical, TextButton, Label} from '@ui';
import FormItem from '@shared/components/form_item';
import {Vertical, TextButton, Label, VerticalAdapt} from '@ui';
import {OTHER_ATTRIBUTES} from '@private/constants';
import {AttributeType} from '../right.typing';
import ModelName from './right_show.model';
@ -11,9 +10,7 @@ const Widget = BI.inherit(BI.Widget, {
},
watch: {
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');
this.jndiFormRef.setHeight(height);
this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse);
},
@ -26,69 +23,107 @@ const Widget = BI.inherit(BI.Widget, {
vgap: 10,
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'),
form: {
},
{
type: Label,
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'),
height: 200,
ref: _ref => {
this.jndiFormRef = _ref;
},
form: {
{
type: Vertical,
vgap: 10,
items: [
{
type: FormItem,
text: 'INTIAL_CONTEXT_FACTORY',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: Label,
text: factory,
},
],
},
{
type: FormItem,
text: 'PROVIDER_URL',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: Label,
text: url,
},
],
},
{
type: FormItem,
text: 'SECURITY_PRINCIPAL',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: Label,
text: principal,
value: principal,
},
],
},
{
type: FormItem,
text: 'SECURITY_CREDENTIALS',
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
form: {
textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: Label,
text: credentials,
value: credentials,
},
],
},
{
type: FormItem,
width: 180,
form: {
type: VerticalAdapt,
items: [
{
type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 300,
width: 480,
textAlign: 'right',
value: true,
ref: _ref => {
this.collapseRef = _ref;
},
@ -96,6 +131,7 @@ const Widget = BI.inherit(BI.Widget, {
this.store.setIsCollapse(!this.model.isCollapse);
},
},
],
},
{
type: Vertical,
@ -103,42 +139,65 @@ const Widget = BI.inherit(BI.Widget, {
ref: _ref => {
this.otherAttributesRef = _ref;
},
items: BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: FormItem,
text: item.text,
width: 180,
form: {
type: Label,
text: this.options[item.name],
},
};
}),
items: this._getOtherItems(),
},
],
},
],
},
{
type: FormItem,
text: '',
height: 25,
form: {
type: Label,
cls: 'bi-error',
lgap: 10,
textAlign: 'left',
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'),
form: {
},
{
type: Label,
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);
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 {LinkType} from '@ui/type';
import {OTHER_CONNECT} from '@private/constants';
const className = 'dec.dcm.component.right.title';
const Widget: WidgetType = {
props: {
baseCls: 'bi-border-bottom',
},
_store() {
return BI.Models.getModel(RightTitleModel);
},
@ -17,7 +20,6 @@ const Widget: WidgetType = {
return {
type: LeftRightVerticalAdapt,
height: 40,
cls: 'bi-border-bottom',
items: {
left: [
{

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

@ -6,6 +6,7 @@ const Widget: WidgetType = {
title: '',
id: '',
creator: '',
baseCls: 'bi-list-item-active',
},
_store() {
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 Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() {
return BI.Models.getModel(linkStatusModel);
},
@ -17,7 +20,6 @@ const Widget: WidgetType = {
render() {
return {
type: Htape,
cls: 'bi-card',
items: [{
el: {
type: Vtape,

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

@ -6,9 +6,12 @@ import {InfoType} from './right.typings';
import {LinkType} from '@ui/type';
import pluginListConstant from '../../app.constant';
const className = 'dec.dcm.component.linkStatus.right';
const className = 'dcm-link-form';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
},
_store() {
return BI.Models.getModel(Model);
},
@ -30,7 +33,6 @@ const Widget: WidgetType = {
render() {
return {
type: Vertical,
cls: 'dcm-link-form',
items: [
{
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 Widget = BI.inherit(BI.BasicButton, {
props: {
baseCls: 'bi-font-bold',
text: '',
},
_store() {
@ -20,7 +21,6 @@ const Widget = BI.inherit(BI.BasicButton, {
return {
type: Label,
cls: 'bi-font-bold',
height: 40,
hgap: 15,
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';
const className = 'dec.dcm.shared.component.title';
const Widget: WidgetType = {
props: {
baseCls: 'bi-tips bi-border-bottom',
},
render() {
const {text} = this.options;
return {
type: Label,
cls: 'bi-water-mark bi-border-bottom',
height: 24,
bgap: 10,
textAlign: 'left',

Loading…
Cancel
Save