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
import { ViewEngine } from './view-engine';
/**
* 实体选择视图(分页关系)
*
* @export
* @class PickupView3Engine
* @extends {ViewEngine}
*/
export class PickupView3Engine extends ViewEngine {
/**
* Creates an instance of PickupView3Engine.
*
* @memberof PickupView3Engine
*/
constructor() {
super();
}
public pickupViewPanelModels: any[] = [];
public init(options: any) {
this.pickupViewPanelModels = options.pickupViewPanelModels;
super.init(options);
}
public load() {
this.view.viewSelections = [];
super.load();
const activedPickupViewPanel = this.view.activedPickupViewPanel ? this.view.activedPickupViewPanel
: this.pickupViewPanelModels.length > 0
? this.pickupViewPanelModels[0].name : '';
if (activedPickupViewPanel) {
this.setViewState2({ tag: activedPickupViewPanel, action: 'load', viewdata: this.view.viewparams });
}
}
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(eventName, 'selectionchange')) {
this.onSelectionChange(args);
}
if (Object.is(eventName, 'activated')) {
this.emitViewEvent('viewdatasactivated', args);
}
}
public onSelectionChange(args: any[]) {
this.view.viewSelections = [];
this.view.viewSelections = [...args]
const _disabled: boolean = this.view.viewSelections.length > 0 ? false : true;
this.view.viewButtonModel.view_okbtn.disabled = _disabled;
if(!this.view.isShowButton){
this.emitViewEvent('viewdataschange', [...args]);
}
}
}