From f15c965f5abb822e183cf0439daa82d1095c0c8b Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 10 Aug 2021 14:46:49 +0800 Subject: [PATCH] =?UTF-8?q?DEC-20036=20fix:=20=E3=80=90=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E5=85=B6=E4=BB=96JDBC=E7=B1=BB=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=A9=B1=E5=8A=A8=E7=B1=BB=E5=9E=8B=E5=90=8E?= =?UTF-8?q?URL=E6=B2=A1=E6=9C=89=E8=81=94=E5=8A=A8=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/driverselector/driverselector.ts | 10 ++++++++-- .../pages/maintain/forms/components/form.jdbc.ts | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.ts b/src/modules/pages/maintain/components/driverselector/driverselector.ts index d59f956..c155878 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.ts @@ -101,7 +101,10 @@ export class DriverSelector extends BI.Widget { listeners: [ { eventName: BI.EditorIconCheckCombo.EVENT_CHANGE, - action: () => this.store.changeDefaultDriver(this.defaultDrivers.getValue()), + action: () => { + this.store.changeDefaultDriver(this.defaultDrivers.getValue()); + this.fireEvent('EVENT_CHANGE'); + }, }, ], }, @@ -124,7 +127,10 @@ export class DriverSelector extends BI.Widget { listeners: [ { eventName: BI.SearchTextValueCombo.EVENT_CHANGE, - action: () => this.store.changeCustomDriver(this.customDrivers.getValue()[0]), + action: () => { + this.store.changeCustomDriver(this.customDrivers.getValue()[0]); + this.fireEvent('EVENT_CHANGE'); + }, }, ], }, diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index baf83ff..c73ff73 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -148,7 +148,7 @@ export class FormJdbc extends BI.Widget { const value = this.form.driver.getValue(); const connectionData = this.options.formData.connectionData as ConnectionJDBC; const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); - const url = connectionType.urls ? connectionType.urls[value] : connectionType.url; + const url = connectionType.urls ? connectionType.urls[value.driver] : connectionType.url; this.form.url.setValue(url); const urlInfo = resolveUrlInfo(url, connectionData.database); this.form.host.setValue(urlInfo.host); @@ -806,7 +806,7 @@ export class FormJdbc extends BI.Widget { private onHostPortChange(databaseType) { const { urls, url } = databaseType; const driver = this.form.driver.getValue(); - const selectUrl = BI.get(urls, driver) || url; + const selectUrl = BI.get(urls, driver.driver) || url; const host = this.form.host.getValue(); const port = this.form.port.getValue(); const database = this.form.database.getValue();