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.
@@ -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 rowKey = _this.props.rowKey;
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 _this$state2 = _this.state,
118
- arrValues = _this$state2.arrValues,
119
- arrValuesInfo = _this$state2.arrValuesInfo;
120
- var rowKey = _this.props.rowKey;
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
- _this.onSelectedRowsChange(arrValues, arrValuesInfo);
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$props2 = _this.props,
150
- onGridRowsUpdated = _this$props2.onGridRowsUpdated,
151
- dataList = _this$props2.dataList;
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$props3 = _this.props,
162
- onGridRowsUpdated = _this$props3.onGridRowsUpdated,
163
- dataList = _this$props3.dataList;
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$props4 = _this.props,
188
- dataList = _this$props4.dataList,
189
- onGridRowsUpdated = _this$props4.onGridRowsUpdated,
190
- objToolbarProps = _this$props4.objToolbarProps,
191
- rowKey = _this$props4.rowKey;
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$props5 = _this.props,
300
- touchAutoCompute = _this$props5.touchAutoCompute,
301
- onGridRowsUpdated = _this$props5.onGridRowsUpdated,
302
- dataList = _this$props5.dataList,
303
- rowKey = _this$props5.rowKey;
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$state3 = _this.state,
338
- filters = _this$state3.filters,
339
- sortColumn = _this$state3.sortColumn,
340
- sortDirection = _this$state3.sortDirection;
341
- var _this$props6 = _this.props,
342
- dataList = _this$props6.dataList,
343
- enableCellSelect = _this$props6.enableCellSelect,
344
- rowSelection = _this$props6.rowSelection;
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$props7 = _this.props,
404
- arrColumnsKey = _this$props7.arrColumnsKey,
405
- objSheet = _this$props7.objSheet,
406
- arrColInfo = _this$props7.arrColInfo;
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$props8 = _this.props,
584
- enableCellSelect = _this$props8.enableCellSelect,
585
- rowKey = _this$props8.rowKey,
586
- objToolbarProps = _this$props8.objToolbarProps,
587
- rowSelection = _this$props8.rowSelection,
588
- onCheckCellIsEditable = _this$props8.onCheckCellIsEditable,
589
- touchRowRenderer = _this$props8.touchRowRenderer;
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$props9 = _this.props,
635
- autoAddNumber = _this$props9.autoAddNumber,
636
- columns = _this$props9.columns;
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$props10 = _this.props,
662
- columns = _this$props10.columns,
663
- dataList = _this$props10.dataList;
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 = []; // 必填提示信息
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.55-beta10",
3
+ "version": "1.5.55-beta12",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",