Browse Source

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

* commit '5d60e02b6634da1c7407c9fa6bf29f3c3deedaf9':
  fix: 删除数据连接时,默认选中列表的第一个
  fix: DEC-10022 重命名时若保存失败,则提示失败信息并变回原来的名字。
qufenxi
alan 5 years ago
parent
commit
1c24e42887
  1. 3
      src/modules/pages/connection/list/list_item/list_item.model.ts
  2. 3
      src/modules/pages/connection/list/list_item/list_item.ts

3
src/modules/pages/connection/list/list_item/list_item.model.ts

@ -76,7 +76,6 @@ export class ListItemModel extends Model<{
return api.updateConnection(connection).then(re => {
if (!re.errorCode) {
this.setIsEdit(false, oldName);
this.model.connections = this.model.connections.map(item => {
return {
...item,
@ -103,7 +102,7 @@ export class ListItemModel extends Model<{
item.connectionData = JSON.parse(item.connectionData as string);
});
if (name === this.model.connectionSelected) {
this.model.connectionSelected = '';
this.model.connectionSelected = BI.size(this.model.connections) > 0 ? this.model.connections[0].connectionName : '';
}
api.shutdownConnectionStatus(name);
});

3
src/modules/pages/connection/list/list_item/list_item.ts

@ -73,11 +73,12 @@ export class ListItem extends BI.BasicButton {
action: () => {
const newName = this.nameEditor.getValue();
this.store.changeName(name, newName).then(re => {
this.store.setIsEdit(false, name);
if (re.errorCode) {
BI.Msg.toast(BI.i18nText(re.errorMsg), {
level: 'error',
});
this.nameEditor.focus();
this.nameLabel.setText(name);
} else {
this.nameLabel.setText(newName);
}

Loading…
Cancel
Save