Browse Source

refactor: 将标识符配置为常量

qufenxi
alan 6 years ago
parent
commit
6188e34a44
  1. 4
      src/app/link_set/right/right_title/right.title.component.ts
  2. 6
      src/app/link_set/select/select.service.ts

4
src/app/link_set/right/right_title/right.title.component.ts

@ -1,7 +1,7 @@
import {WidgetType, Left, Label, Button} from '@ui/index'; import {WidgetType, Left, Label, Button} 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 {saveConnection} from '../../link-set.service'; import {OTHER_CONNECT} from '../../select/select.service';
const className = 'fr.component.right.title'; const className = 'fr.component.right.title';
const Widget: WidgetType = { const Widget: WidgetType = {
_store() { _store() {
@ -12,7 +12,7 @@ const Widget: WidgetType = {
const linkList: LinkType[] = this.model.linkList; const linkList: LinkType[] = this.model.linkList;
const that = this; const that = this;
const {isEdit} = this.options; const {isEdit} = this.options;
const title = linkSelected.text === 'other' ? BI.i18nText('Dec-Dcm_Connection_Other') : linkSelected.text; const title = linkSelected.text === OTHER_CONNECT ? BI.i18nText('Dec-Dcm_Connection_Other') : linkSelected.text;
return { return {
type: Left, type: Left,

6
src/app/link_set/select/select.service.ts

@ -1,5 +1,9 @@
import {LinkType} from '@ui/type'; import {LinkType} from '@ui/type';
import pluginListConstant from '../../app.constant'; import pluginListConstant from '../../app.constant';
/**
*
*/
export const OTHER_CONNECT = 'other';
export const databaseTyle = [ export const databaseTyle = [
{ {
@ -70,7 +74,7 @@ export const databaseTyle = [
url: 'jdbc:mysql://localhost/dbname', url: 'jdbc:mysql://localhost/dbname',
}, },
{ {
text:'other', text: OTHER_CONNECT,
databaseType: 'other', databaseType: 'other',
driver: 'org.h2.Driver', driver: 'org.h2.Driver',
drivers:['org.h2.Driver', 'com.fr.third.org.hsqldb.jdbcDriver', 'org.sqlite.JDBC'], drivers:['org.h2.Driver', 'com.fr.third.org.hsqldb.jdbcDriver', 'org.sqlite.JDBC'],

Loading…
Cancel
Save