From 461912f675431f15c4bbf35b666caaa820d13a81 Mon Sep 17 00:00:00 2001 From: alan Date: Thu, 24 Oct 2019 14:32:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20KERNEL-1655=20=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=97=A7=E7=89=88=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/app.service.ts b/src/modules/app.service.ts index a770f78..9139f32 100644 --- a/src/modules/app.service.ts +++ b/src/modules/app.service.ts @@ -26,11 +26,14 @@ export function getPluginWidgetEdit(plugin: string) { // 由于database可能为空,所以为了兼容平台和设计器,需要根据driver来判断数据库类型 export function getJdbcDatabaseType(database: string, driver: string): DatabaseType { 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); } else { - const desingDatabase = DESIGN_DRIVER_TYPE.find(item => item.driver === driver); - databaseType = DATA_BASE_TYPES.find(item => item.databaseType === BI.get(desingDatabase, 'type')); + const designDatabase = DESIGN_DRIVER_TYPE.find(item => item.driver === driver); + 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) { return DATA_BASE_TYPES_OTHER;