diff --git a/i18n/zh_cn.properties b/i18n/zh_cn.properties index 7a781eb..3672ab6 100644 --- a/i18n/zh_cn.properties +++ b/i18n/zh_cn.properties @@ -94,6 +94,7 @@ Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes= 收起 Dec-Dcm_Connection_JNDI= JNDI数据连接 Dec-Dcm_Connection_JNDI_Warning= 注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下 Dec-Dcm_Connection_Error= 接口访问错误 +Dec-Dcm_Connection_Driver_Unable_Recognize= 无法识别的驱动:{R1} BI-Multi_Date_Quarter_End= 季度末 BI-Multi_Date_Month_Begin= 月初 diff --git a/private/i18n.ts b/private/i18n.ts index 29a533a..1b75c90 100644 --- a/private/i18n.ts +++ b/private/i18n.ts @@ -22,7 +22,6 @@ export default { 'Dec-Dcm_Test_Connection': '测试连接', 'Dec-Dcm_Copy': '复制', 'Dec-Dcm_Edit': '编辑', - 'Dec-Dcm_Save': '保存', 'Dec-Dcm_Yes': '是', 'Dec-Dcm_No': '否', 'Dec-Dcm_Search': '搜索', @@ -94,6 +93,7 @@ export default { 'Dec-Dcm_Connection_JNDI': 'JNDI数据连接', 'Dec-Dcm_Connection_JNDI_Warning': '注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下', 'Dec-Dcm_Connection_Error': '接口访问错误', + 'Dec-Dcm_Connection_Driver_Unable_Recognize': '无法识别的驱动:{R1}', 'BI-Multi_Date_Quarter_End': '季度末', 'BI-Multi_Date_Month_Begin': '月初', 'BI-Multi_Date_YMD': '年月日', diff --git a/src/modules/app.service.ts b/src/modules/app.service.ts index f9820c1..2b08642 100644 --- a/src/modules/app.service.ts +++ b/src/modules/app.service.ts @@ -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; }