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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { ModelTool, EditViewInterface } from 'ibiz-core';
import { MainViewBase } from './mainview-base';
import { IPSAppDEEditView, IPSDEForm } from '@ibiz/dynamic-model-api';
/**
* 编辑视图基类
*
* @export
* @class EditViewBase
* @extends {MainViewBase}
* @implements {EditViewInterface}
*/
export class EditViewBase extends MainViewBase implements EditViewInterface {
/**
* 视图实例
*
* @memberof ViewBase
*/
public declare viewInstance: IPSAppDEEditView;
/**
* 编辑表单实例
*
* @public
* @type {IPSDEForm}
* @memberof EditViewBase
*/
public editFormInstance !: IPSDEForm;
/**
* 标题头信息表单部件实例
*
* @public
* @type {IPSDEForm}
* @memberof EditViewBase
*/
public dataPanelInstance !: IPSDEForm;
/**
* 引擎初始化
*
* @public
* @memberof EditViewBase
*/
public engineInit(): void {
if (this.Environment && this.Environment.isPreviewMode) {
return;
}
this.engine.init({
view: this,
form: (this.$refs[this.editFormInstance.name] as any).ctrl,
p2k: '0',
isLoadDefault: this.viewInstance.loadDefault,
keyPSDEField: this.appDeCodeName.toLowerCase(),
majorPSDEField: this.appDeMajorFieldName.toLowerCase(),
});
}
/**
* 初始化编辑视图实例
*
* @memberof EditViewBase
*/
public async viewModelInit() {
await super.viewModelInit();
this.editFormInstance = ModelTool.findPSControlByName('form', this.viewInstance.getPSControls()) as IPSDEForm;
}
/**
* 渲染视图标题头信息表单部件(暂未实现)
*
* @memberof EditViewBase
*/
public renderDataPanelInfo() {
return null;
}
/**
* 渲染视图主体内容区
*
* @memberof EditViewBase
*/
public renderMainContent() {
if (!this.editFormInstance) {
return null;
}
let { targetCtrlName, targetCtrlParam, targetCtrlEvent } = this.computeTargetCtrlData(this.editFormInstance);
return this.$createElement(targetCtrlName, { slot: 'default', props: targetCtrlParam, ref: this.editFormInstance?.name, on: targetCtrlEvent });
}
}