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
70
71
72
73
74
75
import { ModelTool, MobDataViewInterface } from 'ibiz-core';
import { MainViewBase } from './main-view-base';
import { IPSAppDEDashboardView, IPSDEDashboard } from '@ibiz/dynamic-model-api';
/**
* 移动端实体数据看板视图基类
*
* @export
* @class MobDashboardViewBase
* @extends {MainViewBase}
*/
export class MobDashboardViewBase extends MainViewBase implements MobDataViewInterface {
/**
* 数据视图视图实例
*
* @memberof MobDashboardViewBase
*/
public declare viewInstance: IPSAppDEDashboardView;
/**
* 数据看板实例
*
* @public
* @type {IBizDashboardModel}
* @memberof MobDashboardViewBase
*/
public dashboardInstance !: IPSDEDashboard;
/**
* 引擎初始化
*
* @param {*} [opts={}] 引擎参数
* @memberof MobDashboardViewBase
*/
public engineInit(opts: any = {}): void {
if (this.Environment && this.Environment.isPreviewMode) {
return;
}
if (this.engine && this.dashboardInstance) {
let engineOpts = Object.assign({
view: this,
p2k: '0',
isLoadDefault: this.viewInstance?.loadDefault,
keyPSDEField: this.appDeCodeName.toLowerCase(),
majorPSDEField: this.appDeMajorFieldName.toLowerCase(),
}, opts)
this.engine.init(engineOpts);
}
}
/**
* 初始化列表视图实例
*
* @memberof MobDashboardViewBase
*/
public async viewModelInit() {
await super.viewModelInit();
this.dashboardInstance = ModelTool.findPSControlByName('dashboard', this.viewInstance.getPSControls() || []);
}
/**
* 渲染视图主体内容区
*
* @memberof MobDashboardViewBase
*/
public renderMainContent() {
let { targetCtrlName, targetCtrlParam, targetCtrlEvent } = this.computeTargetCtrlData(this.dashboardInstance);
return <ion-content scroll-y={this.enableControlUIAuth}>{this.$createElement(targetCtrlName, {
props: targetCtrlParam,
ref: this.dashboardInstance.name,
on: targetCtrlEvent,
})}</ion-content>;
}
}