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
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
/**
* 选择表格视图控制器(部件视图)
*
* @class IBizPickupGridViewController
* @extends {IBizGridViewController}
*/
var IBizPickupGridViewController = /** @class */ (function (_super) {
__extends(IBizPickupGridViewController, _super);
/**
* Creates an instance of IBizPickupGridViewController.
* 创建 IBizPickupGridViewController 实例
*
* @param {*} [opts={}]
* @memberof IBizPickupGridViewController
*/
function IBizPickupGridViewController(opts) {
if (opts === void 0) { opts = {}; }
var _this = _super.call(this, opts) || this;
/**
* 父数据 <Input>
*
* @type {*}
* @memberof IBizPickupGridViewController
*/
_this.parentData = null;
/**
* 是否支持多项数据选择 <Input>
*
* @type {boolean}
* @memberof IBizPickupGridViewController
*/
_this.multiselect = true;
/**
* 当前选择数据 <Input>
*
* @type {*}
* @memberof IBizPickupGridViewController
*/
_this.currentValue = null;
/**
* 删除数据 <Input>
*
* @type {*}
* @memberof IBizPickupGridViewController
*/
_this.deleteData = null;
/**
* 数据选中事件 <Output>
*
* @type {string}
* @memberof IBizPickupGridViewController
*/
_this.selectionChange = 'selectionChange';
/**
* 行数据激活事件 <Output>
*
* @type {string}
* @memberof IBizPickupGridViewController
*/
_this.dataActivated = 'dataActivated';
/**
* 多数据部件加载所有数据 <Output>
*
* @type {string}
* @memberof IBizPickupGridViewController
*/
_this.allData = 'allData';
return _this;
}
/**
* 部件初始化完成
*
* @param {*} opt
* @memberof IBizPickupGridViewController
*/
IBizPickupGridViewController.prototype.onStoreLoad = function (opt) {
_super.prototype.onStoreLoad.call(this, opt);
if (this.multiselect && Array.isArray(opt)) {
this.$vue.$emit(this.allData, opt);
}
};
/**
* 视图部件初始化完成
*
* @memberof IBizPickupGridViewController
*/
IBizPickupGridViewController.prototype.onInited = function () {
_super.prototype.onInited.call(this);
var grid = this.getGrid();
if (grid) {
grid.setMultiSelect(this.multiselect);
}
var searchForm = this.getSearchForm();
if (searchForm) {
searchForm.setOpen(true);
}
};
/**
* 获取多数据对象
*
* @returns {*}
* @memberof IBizPickupGridViewController
*/
IBizPickupGridViewController.prototype.getMDCtrl = function () {
return this.getControl('grid');
};
/**
* 数据选择事件触发,提交选中数据
*
* @param {Array<any>} selection
* @memberof IBizPickupGridViewController
*/
IBizPickupGridViewController.prototype.onSelectionChange = function (selection) {
this.$vue.$emit(this.selectionChange, selection);
};
/**
* 数据被激活<最典型的情况就是行双击>
*
* @param {*} [data={}]
* @returns {void}
* @memberof IBizPickupGridViewController
*/
IBizPickupGridViewController.prototype.onDataActivated = function (data) {
if (data === void 0) { data = {}; }
_super.prototype.onDataActivated.call(this, data);
if (Object.keys(data).length === 0) {
return;
}
this.$vue.$emit(this.dataActivated, [data]);
};
return IBizPickupGridViewController;
}(IBizGridViewController));