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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import IncidentService from '@/service/incident/incident-service';
import ByParentKeyService from './by-parent-key-form-service';
import IncidentUIService from '@/uiservice/incident/incident-ui-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
/**
* form部件基类
*
* @export
* @class EditFormControlBase
* @extends {ByParentKeyEditFormBase}
*/
export class ByParentKeyEditFormBase extends EditFormControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof ByParentKeyEditFormBase
*/
protected controlType: string = 'FORM';
/**
* 建构部件服务对象
*
* @type {ByParentKeyService}
* @memberof ByParentKeyEditFormBase
*/
public service: ByParentKeyService = new ByParentKeyService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IncidentService}
* @memberof ByParentKeyEditFormBase
*/
public appEntityService: IncidentService = new IncidentService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof ByParentKeyEditFormBase
*/
protected appDeName: string = 'incident';
/**
* 界面UI服务对象
*
* @type {IncidentUIService}
* @memberof ByParentKeyEditFormBase
*/
public appUIService:IncidentUIService = new IncidentUIService(this.$store);
/**
* 表单数据对象
*
* @type {*}
* @memberof ByParentKeyEditFormBase
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
title: null,
subjectname: null,
caseorigincode: null,
productname: null,
entitlementname: null,
customerid: null,
customername: null,
customertype: null,
description: null,
productid: null,
incidentid: null,
subjectid: null,
entitlementid: null,
incident:null,
};
/**
* 属性值规则
*
* @type {*}
* @memberof ByParentKeyEditFormBase
*/
public rules: any = {
title: [
{ required: true, type: 'string', message: '案例标题 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '案例标题 值不能为空', trigger: 'blur' },
],
customerid: [
{ required: true, type: 'string', message: '客户 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '客户 值不能为空', trigger: 'blur' },
],
customername: [
{ required: true, type: 'string', message: '客户 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '客户 值不能为空', trigger: 'blur' },
],
customertype: [
{ required: true, type: 'string', message: '客户类型 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '客户类型 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof ByParentKeyEditFormBase
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '案例基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, showMoreMode: 0, uiActionGroup: { caption: '', langbase: 'entities.incident.byparentkey_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this, showMoreMode: 0 }),
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 0 }),
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfkey: new FormItemModel({ caption: '案例', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfmajortext: new FormItemModel({ caption: '案例标题', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
title: new FormItemModel({ caption: '案例标题', detailType: 'FORMITEM', name: 'title', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
subjectname: new FormItemModel({ caption: '主题', detailType: 'FORMITEM', name: 'subjectname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
caseorigincode: new FormItemModel({ caption: '起源', detailType: 'FORMITEM', name: 'caseorigincode', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
productname: new FormItemModel({ caption: '产品', detailType: 'FORMITEM', name: 'productname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
entitlementname: new FormItemModel({ caption: '权利', detailType: 'FORMITEM', name: 'entitlementname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
customerid: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'customerid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
customername: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'customername', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
customertype: new FormItemModel({ caption: '客户类型', detailType: 'FORMITEM', name: 'customertype', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
description: new FormItemModel({ caption: '说明', detailType: 'FORMITEM', name: 'description', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
productid: new FormItemModel({ caption: '产品', detailType: 'FORMITEM', name: 'productid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
incidentid: new FormItemModel({ caption: '案例', detailType: 'FORMITEM', name: 'incidentid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
subjectid: new FormItemModel({ caption: '主题', detailType: 'FORMITEM', name: 'subjectid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
entitlementid: new FormItemModel({ caption: '权利', detailType: 'FORMITEM', name: 'entitlementid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
/**
* 新建默认值
* @memberof ByParentKeyEditFormBase
*/
public createDefault(){
if (this.data.hasOwnProperty('customerid')) {
this.data['customerid'] = this.viewparams['customerid'];
}
if (this.data.hasOwnProperty('customername')) {
this.data['customername'] = this.viewparams['customername'];
}
if (this.data.hasOwnProperty('customertype')) {
this.data['customertype'] = this.viewparams['customertype'];
}
}
}