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) => {