From b57a86a640930bb134b62992644460efe4d4a763 Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 15:46:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A6=82=E6=9E=9C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E9=A9=B1=E5=8A=A8=20=E5=88=99=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/zh_cn.properties | 1 + private/i18n.ts | 2 +- src/modules/app.service.ts | 24 ++++++++++++++++-------- 3 files changed, 18 insertions(+), 9 deletions(-) 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; }