Browse Source

Merge pull request #118 in DEC/decision-webui-dcm from ~ALAN/decision-webui-dcm:release/10.0 to release/10.0

* commit 'e23e511b0d6cc034541af64b63334941ebea5fd7':
  fix: update
  fix: 改成和bi同样的逻辑
  fix: BI-54743 修改数据连接自动命名的逻辑
qufenxi
alan 5 years ago
parent
commit
d6dfd5a5b8
  1. 14
      src/modules/pages/maintain/forms/form.ts

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

@ -210,19 +210,7 @@ export class MaintainForm extends BI.Widget {
} }
private getConnectionName(name = BI.i18nText('Dec-Dcm_Data_Connections')) { private getConnectionName(name = BI.i18nText('Dec-Dcm_Data_Connections')) {
const connections = this.model.connections.filter(item => item.connectionName.startsWith(name)); return BI.Func.createDistinctName(this.model.connections.map(item => item.connectionName), name);
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}`;
} }
private testConnection() { private testConnection() {

Loading…
Cancel
Save