From e3380485328a8a77bbf0e578a03ddcd4712cf0c8 Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 16:12:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=A0=E6=B3=95=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/maintain/forms/components/form.jdbc.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index aefb72a..9ab16e5 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -508,8 +508,7 @@ export class FormJdbc extends BI.Widget { private getDrivers() { const connectionData = this.options.formData.connectionData as ConnectionJDBC; const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); - - return connectionType.drivers ? + const drivers = connectionType.drivers ? connectionType.drivers.map(item => { return { text: item, @@ -520,6 +519,17 @@ export class FormJdbc extends BI.Widget { text: connectionType.driver, value: connectionType.driver, }]; + + if (!drivers.some(item => item.text === connectionData.driver)) { + return [ + { + text: connectionData.driver, + value: connectionData.driver, + }, + ]; + } + + return drivers; } private getBooleanItem() {