From 2d1a088cfb60ef2fadc8da295c946b6f5d5e8159 Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 27 Jul 2021 14:11:20 +0800 Subject: [PATCH] =?UTF-8?q?DEC-19934=20fix:=20=E3=80=90=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=87=BA=E9=94=99?= =?UTF-8?q?=E6=8F=90=E7=A4=BA-=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AE=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.model.ts | 10 +++++++--- src/modules/pages/connection/connection.model.ts | 13 +------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/modules/app.model.ts b/src/modules/app.model.ts index 79b06f6..200800c 100644 --- a/src/modules/app.model.ts +++ b/src/modules/app.model.ts @@ -7,7 +7,7 @@ import { getAllDatabaseTypes } from './app.service'; export class AppModel extends Model { static xtype = 'dec.dcm.model.main'; - childContext = ['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'filter', 'connections', 'connectionSelected', 'connectionSelectedOne', 'saveEvent', 'testEvent', 'isCopy']; + childContext = ['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'filter', 'connections', 'connectionSelected', 'connectionSelectedOne', 'saveEvent', 'testEvent', 'isCopy', 'connectionLicInfo']; state() { return { @@ -19,13 +19,17 @@ export class AppModel extends Model { saveEvent: '', testEvent: '', isCopy: false, + connectionLicInfo: { + currentConnectionNum: 0, + maxConnectionNum: 0, + }, }; } computed = { connectionSelectedOne: () => this.model.connections.find(item => item.connectionName === this.model.connectionSelected), datebaseTypeSelectedOne: () => getAllDatabaseTypes().find(item => item.databaseType === this.model.datebaseTypeSelected), - } + }; actions = { setPageIndex: (index: string) => { @@ -37,5 +41,5 @@ export class AppModel extends Model { setDatebaseTypeSelected: (datebaseTypeSelected: string) => { this.model.datebaseTypeSelected = datebaseTypeSelected; }, - } + }; } diff --git a/src/modules/pages/connection/connection.model.ts b/src/modules/pages/connection/connection.model.ts index bdea196..f037865 100644 --- a/src/modules/pages/connection/connection.model.ts +++ b/src/modules/pages/connection/connection.model.ts @@ -19,18 +19,7 @@ export class ConnectionModel extends Model<{ }> { static xtype = 'dec.dcm.model.connection'; - state() { - return { - connectionLicInfo: { - currentConnectionNum: 0, - maxConnectionNum: 0, - }, - }; - } - - childContext: ['connectionLicInfo']; - - context = ['pageIndex', 'connectionSelected', 'connectionSelectedOne', 'datebaseTypeSelected']; + context = ['pageIndex', 'connectionSelected', 'connectionSelectedOne', 'datebaseTypeSelected', 'connectionLicInfo']; actions = { initConnectionLicInfo: (cb: Function) => {