|
|
|
@ -6,6 +6,9 @@ import { PAGE_INDEX } from '@constants/constant';
|
|
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
|
const api = new ApiFactory().create(); |
|
|
|
|
import './maintain.less'; |
|
|
|
|
import { connectionType } from '@constants/env'; |
|
|
|
|
import { getJdbcDatabaseType } from '../../app.service'; |
|
|
|
|
import { ConnectionJDBC } from 'src/modules/crud/crud.typings'; |
|
|
|
|
|
|
|
|
|
export const MaintainXtype = 'dec.dcm.maintain'; |
|
|
|
|
@shortcut(MaintainXtype) |
|
|
|
@ -17,7 +20,8 @@ export class Maintain extends BI.Widget {
|
|
|
|
|
listView: any; |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
const { text, isEdit } = this.getEditConnection(); |
|
|
|
|
const { text, isEdit, databaseType } = this.getEditConnection(); |
|
|
|
|
const titleText = this.model.isCopy ? `${text}-${BI.i18nText('Dec-Dcm_Copy')}` : text; |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: Vtape, |
|
|
|
@ -39,7 +43,7 @@ export class Maintain extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label, |
|
|
|
|
text: this.model.isCopy ? `${text}-${BI.i18nText('Dec-Dcm_Copy')}` : text, |
|
|
|
|
text: `${titleText}(${databaseType})`, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
height: 40, |
|
|
|
@ -78,13 +82,20 @@ export class Maintain extends BI.Widget {
|
|
|
|
|
type: this.model.datebaseTypeSelectedOne.type, |
|
|
|
|
text: this.model.datebaseTypeSelectedOne.text, |
|
|
|
|
isEdit: false, |
|
|
|
|
databaseType: this.model.datebaseTypeSelectedOne.databaseType, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
let databaseType = this.model.connectionSelectedOne.connectionType; |
|
|
|
|
if (databaseType === connectionType.JDBC) { |
|
|
|
|
const connectionJDBC = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; |
|
|
|
|
databaseType = getJdbcDatabaseType(connectionJDBC.database, connectionJDBC.driver).databaseType; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: this.model.connectionSelectedOne.connectionType, |
|
|
|
|
text: this.model.connectionSelectedOne.connectionName, |
|
|
|
|
isEdit: true, |
|
|
|
|
databaseType, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|