SUPPORT-8846: extend LoadForm from Container; fix component and pages
This commit is contained in:
parent
7e9611a3f4
commit
5722e46735
5 changed files with 19 additions and 49 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import {FieldData, Form} from "@webbpm/base-package";
|
||||
import {ChangeDetectionStrategy, Component} from "@angular/core";
|
||||
import {Container, FieldData, Visible, Event} from "@webbpm/base-package";
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef} from "@angular/core";
|
||||
import {ErvuDataService} from "../../../modules/app/service/ervu-data.service";
|
||||
import {LoadFormField} from "../field/LoadFormField";
|
||||
import {Subscription} from "rxjs";
|
||||
|
|
@ -10,13 +10,29 @@ import {Subscription} from "rxjs";
|
|||
templateUrl: './../../../../../src/resources/template/component/container/Form.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class LoadForm extends Form {
|
||||
export class LoadForm extends Container {
|
||||
|
||||
@Visible("false")
|
||||
public formLoaded: Event<void> = new Event<void>(() => true);
|
||||
|
||||
private ervuDataService: ErvuDataService;
|
||||
private subscription: Subscription;
|
||||
private fields: any[];
|
||||
private fieldDataList: FieldData[] = [];
|
||||
|
||||
constructor(el: ElementRef, cd: ChangeDetectorRef) {
|
||||
super(el, cd);
|
||||
}
|
||||
|
||||
public fireOnLoadEvent(): void {
|
||||
super.fireOnLoadEvent();
|
||||
this.formLoaded.trigger();
|
||||
}
|
||||
|
||||
protected loadContainer(): Promise<any> {
|
||||
return Promise.resolve(this.loadData());
|
||||
}
|
||||
|
||||
initialize() {
|
||||
super.initialize();
|
||||
this.fields = this.getScriptsInChildren(LoadFormField);
|
||||
|
|
@ -38,14 +54,6 @@ export class LoadForm extends Form {
|
|||
return this.setData(this.fieldDataList);
|
||||
}
|
||||
|
||||
saveData(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
deleteData(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
super.ngOnDestroy();
|
||||
this.subscription.unsubscribe();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue