From e846f055ccf7ab5022151ff7140484a67c000891 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Thu, 4 Jan 2024 18:10:50 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-112768=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=9B=B4=E6=96=B0=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E4=B8=8D=E5=90=8C=E6=AD=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/connection.ts | 10 +++++++--- src/modules/pages/connection/list/list.model.ts | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/pages/connection/connection.ts b/src/modules/pages/connection/connection.ts index f06dcc5..1215974 100644 --- a/src/modules/pages/connection/connection.ts +++ b/src/modules/pages/connection/connection.ts @@ -24,11 +24,15 @@ export class Connection extends BI.Widget { title: HTapeLayout; watch = { - connectionSelected: { + connectionSelectedOne: { immediate: true, - handler: (name: string) => { + handler: (v: Connection) => { BI.nextTick(() => { - name ? this.renderConnectionListView(name) : this.renderEmptyListView(); + const connectionName = v.connectionName; + + connectionName + ? this.renderConnectionListView(connectionName) + : this.renderEmptyListView(); }); }, }, diff --git a/src/modules/pages/connection/list/list.model.ts b/src/modules/pages/connection/list/list.model.ts index 3d30378..b1bc9d2 100644 --- a/src/modules/pages/connection/list/list.model.ts +++ b/src/modules/pages/connection/list/list.model.ts @@ -44,7 +44,7 @@ export class ConnectionListModel extends Model<{ // 仅首次进入时从url中读取参数,其他情况保留选中状态 defaultDatabaseName ||= data.data[0].connectionName; - this.setSelectedConnection(this.model.connectionSelected || defaultDatabaseName); + this.setSelectedConnection(defaultDatabaseName); } return new Promise(resolve => {