From 2fec3aef7310858e1564835940339700712c22a1 Mon Sep 17 00:00:00 2001 From: alan Date: Fri, 27 Sep 2019 10:50:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20DEC-10022=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E6=97=B6=E8=8B=A5=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E6=8F=90=E7=A4=BA=E5=A4=B1=E8=B4=A5=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=B9=B6=E5=8F=98=E5=9B=9E=E5=8E=9F=E6=9D=A5=E7=9A=84=E5=90=8D?= =?UTF-8?q?=E5=AD=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/list/list_item/list_item.model.ts | 1 - src/modules/pages/connection/list/list_item/list_item.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/pages/connection/list/list_item/list_item.model.ts b/src/modules/pages/connection/list/list_item/list_item.model.ts index d112a42..6db6b3e 100644 --- a/src/modules/pages/connection/list/list_item/list_item.model.ts +++ b/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, diff --git a/src/modules/pages/connection/list/list_item/list_item.ts b/src/modules/pages/connection/list/list_item/list_item.ts index cd1faa3..e0bd557 100644 --- a/src/modules/pages/connection/list/list_item/list_item.ts +++ b/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); }