easy3wui 1.5.49-beta3 → 1.5.49-beta5
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/Easy3wGridPage/index.js +58 -75
- package/package.json +1 -1
|
@@ -114,7 +114,6 @@ var Easy3wGridPage = function (_Component) {
|
|
|
114
114
|
_this.state = {
|
|
115
115
|
// 数据
|
|
116
116
|
arrData: arrData, // 列表
|
|
117
|
-
arrColumns: [], // 列
|
|
118
117
|
// 选择
|
|
119
118
|
selectedRowKeysState: selectedKey || [],
|
|
120
119
|
selectedRowsState: selectedVal || [],
|
|
@@ -125,31 +124,15 @@ var Easy3wGridPage = function (_Component) {
|
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
Easy3wGridPage.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
128
|
-
var _props = this.props,
|
|
129
|
-
_props$dataList
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (nextProps.dataList && nextProps.dataList.length !== dataList.length || JSON.stringify(nextProps.dataList) !== JSON.stringify(dataList)) {
|
|
138
|
-
arrDataFlag = true;
|
|
139
|
-
objSetData.arrData = nextProps.dataList && nextProps.dataList.length ? JSON.parse(JSON.stringify(nextProps.dataList)) : [];
|
|
140
|
-
// this.setState({
|
|
141
|
-
// arrData: nextProps.dataList && nextProps.dataList.length ? JSON.parse(JSON.stringify(nextProps.dataList)) : [],
|
|
142
|
-
// });
|
|
143
|
-
}
|
|
144
|
-
if (nextProps.columns && nextProps.columns.length !== columns.length) {
|
|
145
|
-
arrColumnsFlag = true;
|
|
146
|
-
objSetData.arrColumns = nextProps.columns && nextProps.columns.length ? this.touchCreateColumns((0, _cloneDeep2['default'])(nextProps.columns)) : [];
|
|
147
|
-
// this.setState({
|
|
148
|
-
// arrColumns: nextProps.columns && nextProps.columns.length ? this.touchCreateColumns(cloneDeep(nextProps.columns)) : [],
|
|
149
|
-
// });
|
|
150
|
-
}
|
|
151
|
-
if (arrColumnsFlag || arrDataFlag) {
|
|
152
|
-
this.setState((0, _extends3['default'])({}, objSetData));
|
|
127
|
+
var _props$dataList = this.props.dataList,
|
|
128
|
+
dataList = _props$dataList === undefined ? [] : _props$dataList;
|
|
129
|
+
var _nextProps$dataList = nextProps.dataList,
|
|
130
|
+
nextDataList = _nextProps$dataList === undefined ? [] : _nextProps$dataList;
|
|
131
|
+
|
|
132
|
+
if (nextDataList.length !== dataList.length || JSON.stringify(nextDataList) !== JSON.stringify(dataList)) {
|
|
133
|
+
this.setState({
|
|
134
|
+
arrData: nextDataList.length ? JSON.parse(JSON.stringify(nextDataList)) : []
|
|
135
|
+
});
|
|
153
136
|
}
|
|
154
137
|
if (nextProps.cleanFlag === '1') {
|
|
155
138
|
this.delAll();
|
|
@@ -167,20 +150,20 @@ var Easy3wGridPage = function (_Component) {
|
|
|
167
150
|
Easy3wGridPage.prototype.render = function render() {
|
|
168
151
|
var _this2 = this;
|
|
169
152
|
|
|
170
|
-
var
|
|
171
|
-
columns =
|
|
172
|
-
loading =
|
|
173
|
-
getCheckboxProps =
|
|
174
|
-
needPaginationFlag =
|
|
175
|
-
gridProps =
|
|
176
|
-
totalResult =
|
|
177
|
-
rowKey =
|
|
178
|
-
checkType =
|
|
179
|
-
bordered =
|
|
180
|
-
chooseFlag =
|
|
181
|
-
scroll =
|
|
182
|
-
className =
|
|
183
|
-
paginationInfo =
|
|
153
|
+
var _props = this.props,
|
|
154
|
+
columns = _props.columns,
|
|
155
|
+
loading = _props.loading,
|
|
156
|
+
getCheckboxProps = _props.getCheckboxProps,
|
|
157
|
+
needPaginationFlag = _props.needPaginationFlag,
|
|
158
|
+
gridProps = _props.gridProps,
|
|
159
|
+
totalResult = _props.totalResult,
|
|
160
|
+
rowKey = _props.rowKey,
|
|
161
|
+
checkType = _props.checkType,
|
|
162
|
+
bordered = _props.bordered,
|
|
163
|
+
chooseFlag = _props.chooseFlag,
|
|
164
|
+
scroll = _props.scroll,
|
|
165
|
+
className = _props.className,
|
|
166
|
+
paginationInfo = _props.paginationInfo;
|
|
184
167
|
var arrData = this.state.arrData;
|
|
185
168
|
// [].concat(arrA)
|
|
186
169
|
// const arrColumns = this.touchCreateColumns([].concat(columns));
|
|
@@ -261,7 +244,7 @@ var Easy3wGridPage = function (_Component) {
|
|
|
261
244
|
{ className: gridProps || this.props.rowType ? gridProps.onRow || this.props.rowType ? 'onRow' : null : null },
|
|
262
245
|
_react2['default'].createElement(_table2['default'], (0, _extends3['default'])({
|
|
263
246
|
className: printFlag ? 'scrollPrint' : className || 'scrollX',
|
|
264
|
-
columns:
|
|
247
|
+
columns: arrColumns,
|
|
265
248
|
dataSource: arrData,
|
|
266
249
|
pagination: paginationProps,
|
|
267
250
|
loading: loading,
|
|
@@ -302,11 +285,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
302
285
|
var _state2 = _this3.state,
|
|
303
286
|
selectedRowKeysState = _state2.selectedRowKeysState,
|
|
304
287
|
selectedRowsState = _state2.selectedRowsState;
|
|
305
|
-
var
|
|
306
|
-
rowKey =
|
|
307
|
-
rowKeyCname =
|
|
308
|
-
selectChangeCallback =
|
|
309
|
-
chooseFlag =
|
|
288
|
+
var _props2 = _this3.props,
|
|
289
|
+
rowKey = _props2.rowKey,
|
|
290
|
+
rowKeyCname = _props2.rowKeyCname,
|
|
291
|
+
selectChangeCallback = _props2.selectChangeCallback,
|
|
292
|
+
chooseFlag = _props2.chooseFlag;
|
|
310
293
|
|
|
311
294
|
selectedRowKeysState.splice(selectedRowKeysState.findIndex(function (selectedRowKey) {
|
|
312
295
|
return selectedRowKey === closeKey;
|
|
@@ -343,11 +326,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
343
326
|
|
|
344
327
|
var selectedRowKeysStateArr = selectedRowKeysState;
|
|
345
328
|
var selectedRowsStateArr = selectedRowsState;
|
|
346
|
-
var
|
|
347
|
-
rowKey =
|
|
348
|
-
rowKeyCname =
|
|
349
|
-
selectChangeCallback =
|
|
350
|
-
chooseFlag =
|
|
329
|
+
var _props3 = _this3.props,
|
|
330
|
+
rowKey = _props3.rowKey,
|
|
331
|
+
rowKeyCname = _props3.rowKeyCname,
|
|
332
|
+
selectChangeCallback = _props3.selectChangeCallback,
|
|
333
|
+
chooseFlag = _props3.chooseFlag;
|
|
351
334
|
|
|
352
335
|
var newSelRowKeysTags = [];
|
|
353
336
|
selectedRowKeysStateArr.splice(selectedRowKeysStateArr.findIndex(function (selectedRowKey) {
|
|
@@ -394,12 +377,12 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
394
377
|
var _state4 = _this3.state,
|
|
395
378
|
selectedRowKeysState = _state4.selectedRowKeysState,
|
|
396
379
|
selectedRowsState = _state4.selectedRowsState;
|
|
397
|
-
var
|
|
398
|
-
rowKey =
|
|
399
|
-
rowKeyCname =
|
|
400
|
-
selectChangeCallback =
|
|
401
|
-
chooseFlag =
|
|
402
|
-
checkType =
|
|
380
|
+
var _props4 = _this3.props,
|
|
381
|
+
rowKey = _props4.rowKey,
|
|
382
|
+
rowKeyCname = _props4.rowKeyCname,
|
|
383
|
+
selectChangeCallback = _props4.selectChangeCallback,
|
|
384
|
+
chooseFlag = _props4.chooseFlag,
|
|
385
|
+
checkType = _props4.checkType;
|
|
403
386
|
|
|
404
387
|
if (checkType === 'radio') {
|
|
405
388
|
selectedRowKeysState = [];
|
|
@@ -435,11 +418,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
435
418
|
var _state5 = _this3.state,
|
|
436
419
|
selectedRowKeysState = _state5.selectedRowKeysState,
|
|
437
420
|
selectedRowsState = _state5.selectedRowsState;
|
|
438
|
-
var
|
|
439
|
-
rowKey =
|
|
440
|
-
rowKeyCname =
|
|
441
|
-
selectChangeCallback =
|
|
442
|
-
chooseFlag =
|
|
421
|
+
var _props5 = _this3.props,
|
|
422
|
+
rowKey = _props5.rowKey,
|
|
423
|
+
rowKeyCname = _props5.rowKeyCname,
|
|
424
|
+
selectChangeCallback = _props5.selectChangeCallback,
|
|
425
|
+
chooseFlag = _props5.chooseFlag;
|
|
443
426
|
|
|
444
427
|
removeRows.forEach(function (removeRow) {
|
|
445
428
|
selectedRowKeysState.splice(selectedRowKeysState.findIndex(function (selectedRowKey) {
|
|
@@ -512,11 +495,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
512
495
|
|
|
513
496
|
var selectedRowKeysStateArr = selectedRowKeysState;
|
|
514
497
|
var selectedRowsStateArr = selectedRowsState;
|
|
515
|
-
var
|
|
516
|
-
rowKey =
|
|
517
|
-
rowKeyCname =
|
|
518
|
-
selectChangeCallback =
|
|
519
|
-
chooseFlag =
|
|
498
|
+
var _props6 = _this3.props,
|
|
499
|
+
rowKey = _props6.rowKey,
|
|
500
|
+
rowKeyCname = _props6.rowKeyCname,
|
|
501
|
+
selectChangeCallback = _props6.selectChangeCallback,
|
|
502
|
+
chooseFlag = _props6.chooseFlag;
|
|
520
503
|
|
|
521
504
|
var flag = false;
|
|
522
505
|
var newSelRowKeysTags = [];
|
|
@@ -585,10 +568,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
585
568
|
};
|
|
586
569
|
|
|
587
570
|
this.handleTableChange = function (pagination) {
|
|
588
|
-
var
|
|
589
|
-
selfDealPageChangeFunc =
|
|
590
|
-
getSearchCondition =
|
|
591
|
-
handleSearch =
|
|
571
|
+
var _props7 = _this3.props,
|
|
572
|
+
selfDealPageChangeFunc = _props7.selfDealPageChangeFunc,
|
|
573
|
+
getSearchCondition = _props7.getSearchCondition,
|
|
574
|
+
handleSearch = _props7.handleSearch;
|
|
592
575
|
|
|
593
576
|
var formVal = getSearchCondition();
|
|
594
577
|
var paginationInfo = { offset: pagination.current, limit: pagination.pageSize };
|
|
@@ -677,10 +660,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
677
660
|
};
|
|
678
661
|
|
|
679
662
|
this.touchCreateColumns = function (columns) {
|
|
680
|
-
var
|
|
681
|
-
dataList =
|
|
682
|
-
autoAddNumber =
|
|
683
|
-
paginationInfo =
|
|
663
|
+
var _props8 = _this3.props,
|
|
664
|
+
dataList = _props8.dataList,
|
|
665
|
+
autoAddNumber = _props8.autoAddNumber,
|
|
666
|
+
paginationInfo = _props8.paginationInfo;
|
|
684
667
|
var arrData = _this3.state.arrData;
|
|
685
668
|
|
|
686
669
|
var current = paginationInfo ? paginationInfo.offset : _this3.state.pagination.offset;
|