From 2fec3aef7310858e1564835940339700712c22a1 Mon Sep 17 00:00:00 2001 From: alan Date: Fri, 27 Sep 2019 10:50:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20DEC-10022=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E6=97=B6=E8=8B=A5=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=EF=BC=8C=E5=88=99=E6=8F=90=E7=A4=BA=E5=A4=B1=E8=B4=A5=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=B9=B6=E5=8F=98=E5=9B=9E=E5=8E=9F=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E5=90=8D=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); } From 5d60e02b6634da1c7407c9fa6bf29f3c3deedaf9 Mon Sep 17 00:00:00 2001 From: alan Date: Fri, 27 Sep 2019 11:10:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=B6=EF=BC=8C=E9=BB=98=E8=AE=A4=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E5=88=97=E8=A1=A8=E7=9A=84=E7=AC=AC=E4=B8=80=E4=B8=AA?= 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6db6b3e..da9924c 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 @@ -102,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); });