Browse Source

Pull request #2711: DEC-20036 fix: 【自动化】数据连接管理-其他JDBC类型,切换驱动类型后URL没有联动变化

Merge in DEC/decision-webui-dcm from ~DAILER/decision-webui-dcm:feature/10.0 to feature/10.0

* commit '982682e600d6153ada09b13acf6195b23e369625':
  DEC-20036 fix: 【自动化】数据连接管理-其他JDBC类型,切换驱动类型后URL没有联动变化
feature/10.0
Dailer 3 years ago
parent
commit
0f02894f84
  1. 10
      src/modules/pages/maintain/components/driverselector/driverselector.ts
  2. 4
      src/modules/pages/maintain/forms/components/form.jdbc.ts

10
src/modules/pages/maintain/components/driverselector/driverselector.ts

@ -101,7 +101,10 @@ export class DriverSelector extends BI.Widget {
listeners: [ listeners: [
{ {
eventName: BI.EditorIconCheckCombo.EVENT_CHANGE, 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: [ listeners: [
{ {
eventName: BI.SearchTextValueCombo.EVENT_CHANGE, 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');
},
}, },
], ],
}, },

4
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 value = this.form.driver.getValue();
const connectionData = this.options.formData.connectionData as ConnectionJDBC; const connectionData = this.options.formData.connectionData as ConnectionJDBC;
const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); 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); this.form.url.setValue(url);
const urlInfo = resolveUrlInfo(url, connectionData.database); const urlInfo = resolveUrlInfo(url, connectionData.database);
this.form.host.setValue(urlInfo.host); this.form.host.setValue(urlInfo.host);
@ -806,7 +806,7 @@ export class FormJdbc extends BI.Widget {
private onHostPortChange(databaseType) { private onHostPortChange(databaseType) {
const { urls, url } = databaseType; const { urls, url } = databaseType;
const driver = this.form.driver.getValue(); 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 host = this.form.host.getValue();
const port = this.form.port.getValue(); const port = this.form.port.getValue();
const database = this.form.database.getValue(); const database = this.form.database.getValue();

Loading…
Cancel
Save