import { Component, Injector, OnInit } from '@angular/core'; import { appModuleAnimation } from '@shared/animations/routerTransition'; import { AppComponentBase } from '@shared/common/app-component-base'; import { ComboboxItemDto, HostSettingsServiceProxy, SendTestEmailInput, VersionManagementDto, AppVersionServiceProxy } from '@shared/service-proxies/service-proxies'; @Component({ templateUrl: './versionmanagement.component.html', animations: [appModuleAnimation()] }) export class VersionManagementComponent extends AppComponentBase implements OnInit { appVersion: VersionManagementDto; isEdit = false; EditText = '修改'; constructor( injector: Injector, private _appVersionService: AppVersionServiceProxy, ) { super(injector); this.appVersion = new VersionManagementDto(); } loadAppVersion(): void { const self = this; self._appVersionService.getappVersion() .subscribe(result => { self.appVersion = result; }); } init(): void { const self = this; self.loadAppVersion(); } ngOnInit(): void { const self = this; self.init(); } Edit() { if (this.isEdit) { this.isEdit = false; this.EditText = '修改'; this.loadAppVersion(); } else { this.isEdit = true; this.EditText = '放弃'; } } saveAll(): void { const self = this; self.appVersion.isForceUpgrade = true; self._appVersionService.createOrUpdateSubApp(self.appVersion).subscribe(result => { self.notify.info(self.l('SavedSuccessfully')); this.isEdit = false; this.EditText = '修改'; }); } }