You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
37 lines
1.3 KiB
import { model, Model } from '@core/core'; |
|
import { AppModel } from 'src/modules/app.model'; |
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
const api = new ApiFactory().create(); |
|
|
|
@model() |
|
export class TitleMaintainModel extends Model<{ |
|
types : { |
|
pageIndex: AppModel['TYPE']['pageIndex']; |
|
saveEvent: AppModel['TYPE']['saveEvent']; |
|
connectionSelected: AppModel['TYPE']['connectionSelected']; |
|
testEvent: AppModel['TYPE']['testEvent']; |
|
isCopy: AppModel['TYPE']['isCopy']; |
|
noTestConnection: AppModel['TYPE']['noTestConnection']; |
|
}, |
|
context: TitleMaintainModel['context']; |
|
}> { |
|
static xtype = 'dec.dcm.model.title_maintain'; |
|
|
|
context = <const>['pageIndex', 'saveEvent', 'testEvent', 'connectionSelected', 'isCopy', 'noTestConnection']; |
|
|
|
actions = { |
|
setPageIndex: (index: string) => { |
|
this.model.pageIndex = index; |
|
}, |
|
setSaveEvent: () => { |
|
this.model.saveEvent = BI.UUID(); |
|
}, |
|
setTestEvent: () => { |
|
this.model.testEvent = BI.UUID(); |
|
}, |
|
shutdownConnectionStatus: () => api.shutdownConnectionStatus(this.model.connectionSelected), |
|
setIsCopy(isCopy: boolean) { |
|
this.model.isCopy = isCopy; |
|
}, |
|
} |
|
}
|
|
|