Browse Source

fix: 无法识别的数据库类型则默认为other

qufenxi
alan 5 years ago
parent
commit
e77fbc0219
  1. 6
      src/modules/app.service.ts
  2. 15
      src/modules/constants/constant.ts

6
src/modules/app.service.ts

@ -1,4 +1,4 @@
import { DATA_BASE_TYPES } from '@constants/constant'; import { DATA_BASE_TYPES, DATA_BASE_TYPES_OTHER } from '@constants/constant';
import { CONSTANT_PLUGIN_TYPES, CONSTANT_PLUGIN_SHOW, CONSTANT_PLUGIN_EDIT } from '@constants/plugin'; import { CONSTANT_PLUGIN_TYPES, CONSTANT_PLUGIN_SHOW, CONSTANT_PLUGIN_EDIT } from '@constants/plugin';
import { DatabaseType } from './app.typings'; import { DatabaseType } from './app.typings';
export function getAllDatabaseTypes():DatabaseType[] { export function getAllDatabaseTypes():DatabaseType[] {
@ -37,9 +37,7 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT
}); });
} }
if (!databaseType) { if (!databaseType) {
BI.Msg.toast(BI.i18nText('Dec-Dcm_Connection_Driver_Unable_Recognize', driver), { return DATA_BASE_TYPES_OTHER;
level: 'error',
});
} }
return databaseType; return databaseType;

15
src/modules/constants/constant.ts

@ -15,6 +15,19 @@ export const DATEBASE_FILTER_TYPE = {
BI.constant(CONSTANT_PLUGIN_TYPES, [ BI.constant(CONSTANT_PLUGIN_TYPES, [
]); ]);
export const DATA_BASE_TYPES_OTHER =
{
text: 'other',
databaseType: 'other',
driver: '',
url: '',
commonly: false,
internal: false,
type: 'jdbc',
hasSchema: false,
kerberos: false,
};
export const DATA_BASE_TYPES = [ export const DATA_BASE_TYPES = [
{ {
text: 'ADS', text: 'ADS',
@ -383,6 +396,8 @@ export const DATA_BASE_TYPES = [
}), }),
]; ];
export const CONNECT_CHARSET = [ export const CONNECT_CHARSET = [
{ {
text: '自动', text: '自动',

Loading…
Cancel
Save