1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { IPSDEReportPanel } from '@ibiz/dynamic-model-api';
import { Subscription } from 'rxjs';
import { AppReportPanelService } from '../ctrl-service/app-reportpanel-service';
import { MDControlBase } from './md-control-base';
export class ReportPanelControlBase extends MDControlBase {
/**
* 报表面板实例
*
* @type {IPSDEReportPanel}
* @memberof ReportPanelControlBase
*/
public declare controlInstance: IPSDEReportPanel;
/**
* @description 报表部件事件
* @type {(Subscription | undefined)}
* @memberof ReportPanelControlBase
*/
public reportControlEvent: Subscription | undefined;
/**
* 初始化报表面板模型
*
* @type {*}
* @memberof ReportPanelControlBase
*/
public async ctrlModelInit() {
await super.ctrlModelInit();
if (!(this.Environment && this.Environment.isPreviewMode)) {
this.service = new AppReportPanelService(this.controlInstance, this.context);
}
}
/**
* 报表面板部件初始化
*
* @memberof ReportPanelControlBase
*/
public ctrlInit() {
super.ctrlInit();
if (this.viewState) {
this.reportControlEvent = this.viewState.subscribe(({ tag, action, data }: any) => {
if (!Object.is(tag, this.name)) {
return;
}
if (action == 'load') {
this.load(data);
}
})
}
}
public load(data?: any) {
console.log("报表部件加载数据");
}
/**
* @description 部件销毁
* @memberof ReportPanelControlBase
*/
public ctrlDestroyed(){
super.ctrlDestroyed()
if(this.reportControlEvent){
this.reportControlEvent.unsubscribe();
}
}
}