|
|
|
@ -210,19 +210,13 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private getConnectionName(name = BI.i18nText('Dec-Dcm_Data_Connections')) { |
|
|
|
|
const connections = this.model.connections.filter(item => item.connectionName.startsWith(name)); |
|
|
|
|
const defaultName = name.replace(/\d+$/, ''); |
|
|
|
|
const connections = this.model.connections.filter(item => item.connectionName.startsWith(defaultName)); |
|
|
|
|
if (connections.length === 0) { |
|
|
|
|
return name; |
|
|
|
|
} |
|
|
|
|
let index = 0; |
|
|
|
|
connections.forEach(item => { |
|
|
|
|
const num = parseFloat(item.connectionName.replace(name, '')); |
|
|
|
|
if (num > index) { |
|
|
|
|
index = num; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return `${name}${index + 1}`; |
|
|
|
|
return BI.Func.createDistinctName(connections.map(item => item.connectionName), defaultName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private testConnection() { |
|
|
|
|