Browse Source

Merge pull request #114 in DEC/decision-webui-dcm from ~ALAN/decision-webui-dcm:release/10.0 to release/10.0

* commit '461912f675431f15c4bbf35b666caaa820d13a81':
  fix: KERNEL-1655 兼容旧版数据连接数据
qufenxi
alan 5 years ago
parent
commit
cc4c25c2dd
  1. 9
      src/modules/app.service.ts

9
src/modules/app.service.ts

@ -26,11 +26,14 @@ export function getPluginWidgetEdit(plugin: string) {
// 由于database可能为空,所以为了兼容平台和设计器,需要根据driver来判断数据库类型 // 由于database可能为空,所以为了兼容平台和设计器,需要根据driver来判断数据库类型
export function getJdbcDatabaseType(database: string, driver: string): DatabaseType { export function getJdbcDatabaseType(database: string, driver: string): DatabaseType {
let databaseType = null; let databaseType = null;
if (database && DATA_BASE_TYPES.some(item => item.databaseType === database)) { // KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driber来判断数据类型
if (database && database !== 'other' && DATA_BASE_TYPES.some(item => item.databaseType === database)) {
databaseType = DATA_BASE_TYPES.find(item => item.databaseType === database); databaseType = DATA_BASE_TYPES.find(item => item.databaseType === database);
} else { } else {
const desingDatabase = DESIGN_DRIVER_TYPE.find(item => item.driver === driver); const designDatabase = DESIGN_DRIVER_TYPE.find(item => item.driver === driver);
databaseType = DATA_BASE_TYPES.find(item => item.databaseType === BI.get(desingDatabase, 'type')); const decisionDatabase = DATA_BASE_TYPES.find(item => item.driver === driver);
const type = designDatabase ? BI.get(designDatabase, 'type') : BI.get(decisionDatabase, 'databaseType');
databaseType = DATA_BASE_TYPES.find(item => item.databaseType === type);
} }
if (!databaseType) { if (!databaseType) {
return DATA_BASE_TYPES_OTHER; return DATA_BASE_TYPES_OTHER;

Loading…
Cancel
Save