easy3wui 1.5.55-beta10 → 1.5.55-beta12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Easy3wEditBigTable/index.js +61 -47
- package/package.json +1 -1
|
@@ -99,7 +99,9 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
99
99
|
var _this$state = _this.state,
|
|
100
100
|
arrValues = _this$state.arrValues,
|
|
101
101
|
arrValuesInfo = _this$state.arrValuesInfo;
|
|
102
|
-
var
|
|
102
|
+
var _this$props2 = _this.props,
|
|
103
|
+
rowKey = _this$props2.rowKey,
|
|
104
|
+
onRowsSelectedCb = _this$props2.onRowsSelectedCb;
|
|
103
105
|
|
|
104
106
|
var arrValuesNew = []; // 表格选择行索引
|
|
105
107
|
var arrValuesInfoNew = []; // 表格选择行数据
|
|
@@ -110,17 +112,23 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
110
112
|
});
|
|
111
113
|
arrValues = arrValues.concat(arrValuesNew); // 表格选择行索引
|
|
112
114
|
arrValuesInfo = arrValuesInfo.concat(arrValuesInfoNew); // 表格选择行数据
|
|
115
|
+
if (onRowsSelectedCb && typeof onRowsSelectedCb === 'function') {
|
|
116
|
+
// 表格选择回调函数
|
|
117
|
+
onRowsSelectedCb('onRowsSelected', arrValues, arrValuesInfo, arrValuesNew, arrValuesInfoNew);
|
|
118
|
+
}
|
|
113
119
|
_this.onSelectedRowsChange(arrValues, arrValuesInfo);
|
|
114
120
|
};
|
|
115
121
|
|
|
116
122
|
_this.onRowsDeselected = function (rows) {
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
var arrValuesInfo = _this.state.arrValuesInfo;
|
|
124
|
+
var _this$props3 = _this.props,
|
|
125
|
+
rowKey = _this$props3.rowKey,
|
|
126
|
+
onRowsSelectedCb = _this$props3.onRowsSelectedCb;
|
|
121
127
|
|
|
122
128
|
var arrValuesNew = []; // 表格选择行索引
|
|
123
129
|
var arrValuesInfoNew = []; // 表格选择行数据
|
|
130
|
+
var arrSelected = []; // 已选择的行索引
|
|
131
|
+
var arrSelectedInfo = []; // 已选择的行数据
|
|
124
132
|
arrValuesInfo.filter(function (item) {
|
|
125
133
|
var flag = true;
|
|
126
134
|
rows.map(function (r) {
|
|
@@ -129,6 +137,8 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
129
137
|
if (item[rowKey] === row[rowKey]) {
|
|
130
138
|
// 删除已取消选择的行
|
|
131
139
|
flag = false;
|
|
140
|
+
arrSelected.push(item[rowKey]);
|
|
141
|
+
arrSelectedInfo.push(item);
|
|
132
142
|
}
|
|
133
143
|
return r;
|
|
134
144
|
});
|
|
@@ -138,7 +148,11 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
138
148
|
}
|
|
139
149
|
return flag;
|
|
140
150
|
});
|
|
141
|
-
|
|
151
|
+
if (onRowsSelectedCb && typeof onRowsSelectedCb === 'function') {
|
|
152
|
+
// 表格选择回调函数
|
|
153
|
+
onRowsSelectedCb('onRowsDeselected', arrValuesNew, arrValuesInfoNew, arrSelected, arrSelectedInfo);
|
|
154
|
+
}
|
|
155
|
+
_this.onSelectedRowsChange(arrValuesNew, arrValuesInfoNew);
|
|
142
156
|
};
|
|
143
157
|
|
|
144
158
|
_this.onSelectedRowsChange = function (arrValues, arrValuesInfo) {
|
|
@@ -146,9 +160,9 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
146
160
|
};
|
|
147
161
|
|
|
148
162
|
_this.touchAddRow = function () {
|
|
149
|
-
var _this$
|
|
150
|
-
onGridRowsUpdated = _this$
|
|
151
|
-
dataList = _this$
|
|
163
|
+
var _this$props4 = _this.props,
|
|
164
|
+
onGridRowsUpdated = _this$props4.onGridRowsUpdated,
|
|
165
|
+
dataList = _this$props4.dataList;
|
|
152
166
|
|
|
153
167
|
var dataListNew = [].concat(dataList, [{}]);
|
|
154
168
|
if (onGridRowsUpdated && typeof onGridRowsUpdated === 'function') {
|
|
@@ -158,9 +172,9 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
158
172
|
};
|
|
159
173
|
|
|
160
174
|
_this.touchCopyRow = function () {
|
|
161
|
-
var _this$
|
|
162
|
-
onGridRowsUpdated = _this$
|
|
163
|
-
dataList = _this$
|
|
175
|
+
var _this$props5 = _this.props,
|
|
176
|
+
onGridRowsUpdated = _this$props5.onGridRowsUpdated,
|
|
177
|
+
dataList = _this$props5.dataList;
|
|
164
178
|
var arrValues = _this.state.arrValues;
|
|
165
179
|
|
|
166
180
|
if (arrValues.length) {
|
|
@@ -184,11 +198,11 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
184
198
|
};
|
|
185
199
|
|
|
186
200
|
_this.deleteRow = function () {
|
|
187
|
-
var _this$
|
|
188
|
-
dataList = _this$
|
|
189
|
-
onGridRowsUpdated = _this$
|
|
190
|
-
objToolbarProps = _this$
|
|
191
|
-
rowKey = _this$
|
|
201
|
+
var _this$props6 = _this.props,
|
|
202
|
+
dataList = _this$props6.dataList,
|
|
203
|
+
onGridRowsUpdated = _this$props6.onGridRowsUpdated,
|
|
204
|
+
objToolbarProps = _this$props6.objToolbarProps,
|
|
205
|
+
rowKey = _this$props6.rowKey;
|
|
192
206
|
var deleteRowInterface = objToolbarProps.deleteRowInterface;
|
|
193
207
|
var arrValues = _this.state.arrValues;
|
|
194
208
|
|
|
@@ -296,11 +310,11 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
296
310
|
};
|
|
297
311
|
|
|
298
312
|
_this.confirmCallbackBatchEditBigTable = function (objFormData, objColumn) {
|
|
299
|
-
var _this$
|
|
300
|
-
touchAutoCompute = _this$
|
|
301
|
-
onGridRowsUpdated = _this$
|
|
302
|
-
dataList = _this$
|
|
303
|
-
rowKey = _this$
|
|
313
|
+
var _this$props7 = _this.props,
|
|
314
|
+
touchAutoCompute = _this$props7.touchAutoCompute,
|
|
315
|
+
onGridRowsUpdated = _this$props7.onGridRowsUpdated,
|
|
316
|
+
dataList = _this$props7.dataList,
|
|
317
|
+
rowKey = _this$props7.rowKey;
|
|
304
318
|
// if (touchAutoCompute && typeof touchAutoCompute === 'function') { // 数据变更-自动计算行数据
|
|
305
319
|
// updated = touchAutoCompute(objUpdated);
|
|
306
320
|
// }
|
|
@@ -334,14 +348,14 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
334
348
|
};
|
|
335
349
|
|
|
336
350
|
_this.getRows = function () {
|
|
337
|
-
var _this$
|
|
338
|
-
filters = _this$
|
|
339
|
-
sortColumn = _this$
|
|
340
|
-
sortDirection = _this$
|
|
341
|
-
var _this$
|
|
342
|
-
dataList = _this$
|
|
343
|
-
enableCellSelect = _this$
|
|
344
|
-
rowSelection = _this$
|
|
351
|
+
var _this$state2 = _this.state,
|
|
352
|
+
filters = _this$state2.filters,
|
|
353
|
+
sortColumn = _this$state2.sortColumn,
|
|
354
|
+
sortDirection = _this$state2.sortDirection;
|
|
355
|
+
var _this$props8 = _this.props,
|
|
356
|
+
dataList = _this$props8.dataList,
|
|
357
|
+
enableCellSelect = _this$props8.enableCellSelect,
|
|
358
|
+
rowSelection = _this$props8.rowSelection;
|
|
345
359
|
|
|
346
360
|
var rows = dataList;
|
|
347
361
|
if (enableCellSelect || rowSelection) {
|
|
@@ -400,10 +414,10 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
400
414
|
|
|
401
415
|
_this.getHearder = function () {
|
|
402
416
|
var columns = _this.props.columns;
|
|
403
|
-
var _this$
|
|
404
|
-
arrColumnsKey = _this$
|
|
405
|
-
objSheet = _this$
|
|
406
|
-
arrColInfo = _this$
|
|
417
|
+
var _this$props9 = _this.props,
|
|
418
|
+
arrColumnsKey = _this$props9.arrColumnsKey,
|
|
419
|
+
objSheet = _this$props9.objSheet,
|
|
420
|
+
arrColInfo = _this$props9.arrColInfo;
|
|
407
421
|
|
|
408
422
|
|
|
409
423
|
var arrColumnsKeyNew = ['id'];
|
|
@@ -580,13 +594,13 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
580
594
|
|
|
581
595
|
_this.getReactDataGridProps = function () {
|
|
582
596
|
var arrValues = _this.state.arrValues;
|
|
583
|
-
var _this$
|
|
584
|
-
enableCellSelect = _this$
|
|
585
|
-
rowKey = _this$
|
|
586
|
-
objToolbarProps = _this$
|
|
587
|
-
rowSelection = _this$
|
|
588
|
-
onCheckCellIsEditable = _this$
|
|
589
|
-
touchRowRenderer = _this$
|
|
597
|
+
var _this$props10 = _this.props,
|
|
598
|
+
enableCellSelect = _this$props10.enableCellSelect,
|
|
599
|
+
rowKey = _this$props10.rowKey,
|
|
600
|
+
objToolbarProps = _this$props10.objToolbarProps,
|
|
601
|
+
rowSelection = _this$props10.rowSelection,
|
|
602
|
+
onCheckCellIsEditable = _this$props10.onCheckCellIsEditable,
|
|
603
|
+
touchRowRenderer = _this$props10.touchRowRenderer;
|
|
590
604
|
|
|
591
605
|
var objReactDataGridProps = {}; // ReactDataGrid属性对象
|
|
592
606
|
// toolbar属性
|
|
@@ -631,9 +645,9 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
631
645
|
};
|
|
632
646
|
|
|
633
647
|
_this.createColumns = function () {
|
|
634
|
-
var _this$
|
|
635
|
-
autoAddNumber = _this$
|
|
636
|
-
columns = _this$
|
|
648
|
+
var _this$props11 = _this.props,
|
|
649
|
+
autoAddNumber = _this$props11.autoAddNumber,
|
|
650
|
+
columns = _this$props11.columns;
|
|
637
651
|
// 自动添加序号
|
|
638
652
|
|
|
639
653
|
var columnsNew = [].concat(columns);
|
|
@@ -658,9 +672,9 @@ var Easy3wEditBigTable = function (_Component) {
|
|
|
658
672
|
};
|
|
659
673
|
|
|
660
674
|
_this.checkData = function () {
|
|
661
|
-
var _this$
|
|
662
|
-
columns = _this$
|
|
663
|
-
dataList = _this$
|
|
675
|
+
var _this$props12 = _this.props,
|
|
676
|
+
columns = _this$props12.columns,
|
|
677
|
+
dataList = _this$props12.dataList;
|
|
664
678
|
|
|
665
679
|
var strCheckFailRows = ''; // 校验失败的行号
|
|
666
680
|
var arrRequiredMessage = []; // 必填提示信息
|