|
|
|
@ -24,15 +24,23 @@ 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); |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return item.driver === driver; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (!databaseType) { |
|
|
|
|
BI.Msg.toast(BI.i18nText('Dec-Dcm_Connection_Driver_Unable_Recognize', driver), { |
|
|
|
|
level: 'error', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return (DATA_BASE_TYPES as DatabaseType[]).find(item => { |
|
|
|
|
if (item.drivers) { |
|
|
|
|
return item.drivers.includes(driver); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return item.driver === driver; |
|
|
|
|
}); |
|
|
|
|
return databaseType; |
|
|
|
|
} |
|
|
|
|