|
|
|
@ -24,11 +24,11 @@ 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)) { |
|
|
|
|
return DATA_BASE_TYPES.find(item => item.databaseType === database); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return (DATA_BASE_TYPES as DatabaseType[]).find(item => { |
|
|
|
|
databaseType = DATA_BASE_TYPES.find(item => item.databaseType === database); |
|
|
|
|
} else { |
|
|
|
|
databaseType = (DATA_BASE_TYPES as DatabaseType[]).find(item => { |
|
|
|
|
if (item.drivers) { |
|
|
|
|
return item.drivers.includes(driver); |
|
|
|
|
} |
|
|
|
@ -36,3 +36,11 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT
|
|
|
|
|
return item.driver === driver; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (!databaseType) { |
|
|
|
|
BI.Msg.toast(BI.i18nText('Dec-Dcm_Connection_Driver_Unable_Recognize', driver), { |
|
|
|
|
level: 'error', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return databaseType; |
|
|
|
|
} |
|
|
|
|