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;