@ -7,7 +7,7 @@ import { getAllDatabaseTypes } from './app.service';
export class AppModel extends Model {
export class AppModel extends Model {
static xtype = 'dec.dcm.model.main' ;
static xtype = 'dec.dcm.model.main' ;
childContext = < const > [ 'pageIndex' , 'datebaseTypeSelected' , 'datebaseTypeSelectedOne' , 'filter' , 'connections' , 'connectionSelected' , 'connectionSelectedOne' , 'saveEvent' , 'testEvent' , 'isCopy' ] ;
childContext = < const > [ 'pageIndex' , 'datebaseTypeSelected' , 'datebaseTypeSelectedOne' , 'filter' , 'connections' , 'connectionSelected' , 'connectionSelectedOne' , 'saveEvent' , 'testEvent' , 'isCopy' , 'connectionLicInfo' ] ;
state() {
state() {
return {
return {
@ -19,13 +19,17 @@ export class AppModel extends Model {
saveEvent : '' ,
saveEvent : '' ,
testEvent : '' ,
testEvent : '' ,
isCopy : false ,
isCopy : false ,
connectionLicInfo : {
currentConnectionNum : 0 ,
maxConnectionNum : 0 ,
} ,
} ;
} ;
}
}
computed = {
computed = {
connectionSelectedOne : ( ) = > this . model . connections . find ( item = > item . connectionName === this . model . connectionSelected ) ,
connectionSelectedOne : ( ) = > this . model . connections . find ( item = > item . connectionName === this . model . connectionSelected ) ,
datebaseTypeSelectedOne : ( ) = > getAllDatabaseTypes ( ) . find ( item = > item . databaseType === this . model . datebaseTypeSelected ) ,
datebaseTypeSelectedOne : ( ) = > getAllDatabaseTypes ( ) . find ( item = > item . databaseType === this . model . datebaseTypeSelected ) ,
}
} ;
actions = {
actions = {
setPageIndex : ( index : string ) = > {
setPageIndex : ( index : string ) = > {
@ -37,5 +41,5 @@ export class AppModel extends Model {
setDatebaseTypeSelected : ( datebaseTypeSelected : string ) = > {
setDatebaseTypeSelected : ( datebaseTypeSelected : string ) = > {
this . model . datebaseTypeSelected = datebaseTypeSelected ;
this . model . datebaseTypeSelected = datebaseTypeSelected ;
} ,
} ,
}
} ;
}
}