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
/**
* 表单成员按钮
*
* @class IBizFormButton
* @extends {IBizFormItem}
*/
class IBizFormButton extends IBizFormItem {
/**
* 实体界面行为类型
*
* @type {string}
* @memberof IBizFormButton
*/
public actiontype: string;
/**
* 实体界面行为
*
* @type {*}
* @memberof IBizFormButton
*/
public uiaction: any = {};
/**
* 表单项更新
*
* @type {*}
* @memberof IBizFormButton
*/
public fiupdate: any = {};
/**
* Creates an instance of IBizFormButton.
* 创建 IBizFormButton 实例
*
* @param {*} [opts={}]
* @memberof IBizFormButton
*/
constructor(opts: any = {}) {
super(opts);
this.actiontype = opts.actiontype;
if (opts.uiaction) {
Object.assign(this.uiaction, opts.uiaction);
}
if (opts.fiupdate) {
Object.assign(this.fiupdate, opts.fiupdate);
}
}
/**
* 表单成员按钮事件
*
* @returns {void}
* @memberof IBizFormButton
*/
public onClick(): void {
const form = this.getForm();
if (!form) {
return;
}
const viewController = form.getViewController();
if (Object.is(this.actiontype, 'UIACTION') && viewController && Object.keys(this.uiaction).length > 0) {
let uiaction = viewController.getUIAction(this.uiaction.tag);
viewController.doUIAction(uiaction);
}
if (Object.is(this.actiontype, 'FIUPDATE') && Object.keys(this.fiupdate).length > 0) {
form.updateFormItems(this.fiupdate.tag);
}
}
}