Browse Source

fix: 解决驱动不存在无法选择的问题

qufenxi
alan 6 years ago
parent
commit
e338048532
  1. 14
      src/modules/pages/maintain/forms/components/form.jdbc.ts

14
src/modules/pages/maintain/forms/components/form.jdbc.ts

@ -508,8 +508,7 @@ export class FormJdbc extends BI.Widget {
private getDrivers() { private getDrivers() {
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 drivers = connectionType.drivers ?
return connectionType.drivers ?
connectionType.drivers.map(item => { connectionType.drivers.map(item => {
return { return {
text: item, text: item,
@ -520,6 +519,17 @@ export class FormJdbc extends BI.Widget {
text: connectionType.driver, text: connectionType.driver,
value: connectionType.driver, value: connectionType.driver,
}]; }];
if (!drivers.some(item => item.text === connectionData.driver)) {
return [
{
text: connectionData.driver,
value: connectionData.driver,
},
];
}
return drivers;
} }
private getBooleanItem() { private getBooleanItem() {

Loading…
Cancel
Save