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
import { Component, Prop } from 'vue-property-decorator';
import { IPSAppDEEditView, IPSSysCss } from "@ibiz/dynamic-model-api";
import { AppServiceBase, ModelTool, Util } from "ibiz-core";
import { AppDefaultViewLayout } from "../app-default-view-layout/app-default-view-layout";
@Component({})
export class AppDefaultEditViewLayout extends AppDefaultViewLayout {
/**
* 编辑视图模型数据
*
* @type {IPSAppDEEditView}
*/
@Prop() public declare viewInstance: IPSAppDEEditView;
/**
* 引擎初始化
*
* @param {*} [opts={}]
* @memberof AppDefaultEditViewLayout
*/
public engineInit(opts: any = {}) {
const form = ModelTool.findPSControlByType('FORM', this.containerModel.getPSControls());
if (form) {
this.engine.init({
view: this,
form: (this.$refs[form.name] as any).ctrl,
p2k: '0',
isLoadDefault: this.viewInstance.loadDefault,
keyPSDEField: this.appDeCodeName.toLowerCase(),
majorPSDEField: this.appDeMajorFieldName.toLowerCase()
});
}
}
/**
* 绘制头部内容
*
* @memberof AppDefaultEditViewLayout
*/
public renderViewHeader(): any {
if (this.$slots.datapanel) {
return [
this.viewIsshowToolbar ? [<div class="view-header__toolbar--top">{this.$slots.toolbar}</div>, <divider />] : null,
<div class='view-header__info'>
{
this.showCaption ? <div class='view-header__left__caption'>{this.renderViewCaption()}</div> : null
}
<div class='info__content'>{this.$slots.datapanel}</div>
</div>
]
} else {
return [
<div class="view-header__left">
{this.showCaption ? <div class='view-header__left__caption'>{this.renderViewCaption()}</div> : null}
</div>,
this.viewIsshowToolbar && this.$slots.toolbar ? <div class="view-header__right">
<div class="view-header__right__toolbar">{this.$slots.toolbar}</div>
</div> : null
]
}
}
}