Browse Source

refactor: 常量改为大写

qufenxi
alan 6 years ago
parent
commit
880d784633
  1. 8
      src/plugins/jndi/jndi.edit.ts
  2. 4
      src/plugins/jndi/jndi.preview.ts
  3. 6
      src/plugins/jndi/jndi.service.ts

8
src/plugins/jndi/jndi.edit.ts

@ -1,5 +1,5 @@
import {Vertical, Editor, TextValueCombo, TextButton, Label} from '@ui'; import {Vertical, Editor, TextValueCombo, TextButton, Label} from '@ui';
import {factorys, otherAttributes, originalCharsetNames} from './jndi.service'; import {FACTORYS, OTHER_ATTRIBUTES, ORIGINAL_CHARSET_NAMES} from './jndi.service';
import FormItem from '@shared/components/form.item.component'; import FormItem from '@shared/components/form.item.component';
import {AttributeType, FormType} from './jdni.typing'; import {AttributeType, FormType} from './jdni.typing';
import './jdni.scss'; import './jdni.scss';
@ -46,7 +46,7 @@ const Widget = BI.inherit(BI.Widget, {
cls: 'bi-border', cls: 'bi-border',
width: 300, width: 300,
value: form.factory, value: form.factory,
items: BI.map(factorys, (index: number, item: string) => { items: BI.map(FACTORYS, (index: number, item: string) => {
return { return {
text: item, text: item,
value: item, value: item,
@ -120,7 +120,7 @@ const Widget = BI.inherit(BI.Widget, {
ref: _ref => { ref: _ref => {
this.otherAttributesRef = _ref; this.otherAttributesRef = _ref;
}, },
items: BI.map(otherAttributes, (index: number, item: AttributeType) => { items: BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return { return {
type: FormItem, type: FormItem,
text: item.text, text: item.text,
@ -168,7 +168,7 @@ const Widget = BI.inherit(BI.Widget, {
text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'), text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
value: form.originalCharsetName, value: form.originalCharsetName,
}, },
...originalCharsetNames, ...ORIGINAL_CHARSET_NAMES,
], ],
}, },
}, },

4
src/plugins/jndi/jndi.preview.ts

@ -1,7 +1,7 @@
import {Vertical, Label, TextButton} from '@ui'; import {Vertical, Label, TextButton} from '@ui';
import FormItem from '@shared/components/form.item.component'; import FormItem from '@shared/components/form.item.component';
import {FormType, AttributeType} from './jdni.typing'; import {FormType, AttributeType} from './jdni.typing';
import {otherAttributes} from './jndi.service'; import {OTHER_ATTRIBUTES} from './jndi.service';
const JndiPreview = 'fr.plugin.jndi.preview'; const JndiPreview = 'fr.plugin.jndi.preview';
const JndiConstantName = 'dec.constant.database.conf.connect.form.jndi.value'; const JndiConstantName = 'dec.constant.database.conf.connect.form.jndi.value';
@ -98,7 +98,7 @@ const jndiWidget = BI.inherit(BI.Widget, {
ref: _ref => { ref: _ref => {
this.otherAttributesRef = _ref; this.otherAttributesRef = _ref;
}, },
items: BI.map(otherAttributes, (index: number, item: AttributeType) => { items: BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return { return {
type: FormItem, type: FormItem,
text: item.text, text: item.text,

6
src/plugins/jndi/jndi.service.ts

@ -1,8 +1,8 @@
import {AttributeType} from './jdni.typing'; import {AttributeType} from './jdni.typing';
export const factorys = ['', 'weblogic.jndi.WLInitialContextFactory', 'com.ibm.websphere.naming.WsnInitialContextFactory', 'org.jboss.naming.HttpNamingContextFactory', 'org.jnp.interfaces.NamingContextFactory', 'com.caucho.burlap.BurlapContextFactory']; export const FACTORYS = ['', 'weblogic.jndi.WLInitialContextFactory', 'com.ibm.websphere.naming.WsnInitialContextFactory', 'org.jboss.naming.HttpNamingContextFactory', 'org.jnp.interfaces.NamingContextFactory', 'com.caucho.burlap.BurlapContextFactory'];
export const otherAttributes: AttributeType[] = [ export const OTHER_ATTRIBUTES: AttributeType[] = [
{ {
text: 'OBJECT_FACTORIES', text: 'OBJECT_FACTORIES',
name: 'objectFactories', name: 'objectFactories',
@ -50,7 +50,7 @@ export const otherAttributes: AttributeType[] = [
]; ];
export const originalCharsetNames = [ export const ORIGINAL_CHARSET_NAMES = [
{ {
text: 'GBK', text: 'GBK',
value: 'GBK', value: 'GBK',

Loading…
Cancel
Save