easy3wui 1.5.49-beta5 → 1.5.49-beta8

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.
@@ -72,10 +72,6 @@ var _numeral = require('numeral');
72
72
 
73
73
  var _numeral2 = _interopRequireDefault(_numeral);
74
74
 
75
- var _cloneDeep = require('lodash/cloneDeep');
76
-
77
- var _cloneDeep2 = _interopRequireDefault(_cloneDeep);
78
-
79
75
  var _comonConfig = require('comonConfigPath/comonConfig');
80
76
 
81
77
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
@@ -146,6 +142,8 @@ var Easy3wGridPage = function (_Component) {
146
142
  // ---------------------------------- 数据脱敏 end ----------------------------------
147
143
  // 生成表格
148
144
 
145
+ // 数组深度复制
146
+
149
147
 
150
148
  Easy3wGridPage.prototype.render = function render() {
151
149
  var _this2 = this;
@@ -169,7 +167,7 @@ var Easy3wGridPage = function (_Component) {
169
167
  // const arrColumns = this.touchCreateColumns([].concat(columns));
170
168
  // const arrColumns = this.touchCreateColumns(JSON.parse(JSON.stringify(columns)));
171
169
 
172
- var arrColumns = this.touchCreateColumns((0, _cloneDeep2['default'])(columns));
170
+ var arrColumns = this.touchCreateColumns(this.deepCopy(columns));
173
171
  // const arrColumns = this.touchCreateColumns(columns);
174
172
  var _state = this.state,
175
173
  selectedRowKeysState = _state.selectedRowKeysState,
@@ -672,7 +670,20 @@ var _initialiseProps = function _initialiseProps() {
672
670
  var printValue = _this3.props.printValue || 'print';
673
671
  var printFlag = printArr[1] === printValue;
674
672
  var recursion = function recursion(arr) {
675
- arr.forEach(function (item) {
673
+ for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
674
+ var _ref2;
675
+
676
+ if (_isArray) {
677
+ if (_i >= _iterator.length) break;
678
+ _ref2 = _iterator[_i++];
679
+ } else {
680
+ _i = _iterator.next();
681
+ if (_i.done) break;
682
+ _ref2 = _i.value;
683
+ }
684
+
685
+ var item = _ref2;
686
+
676
687
  var columnsType = item.type;
677
688
  if (item.fixed && printFlag) {
678
689
  item.fixed = null;
@@ -693,12 +704,12 @@ var _initialiseProps = function _initialiseProps() {
693
704
  break;
694
705
  }
695
706
  if (item.children) {
696
- recursion(item.children);
707
+ item.children = recursion(item.children);
697
708
  }
698
- });
709
+ }
699
710
  };
700
711
  var recursionT = function recursionT(arr) {
701
- arr.forEach(function (item) {
712
+ var _loop = function _loop(item) {
702
713
  if (item.fixed && printFlag) {
703
714
  item.fixed = null;
704
715
  }
@@ -780,9 +791,26 @@ var _initialiseProps = function _initialiseProps() {
780
791
  item.minWidth = 5;
781
792
  }
782
793
  if (item.children) {
783
- recursionT(item.children);
794
+ item.children = recursionT(item.children);
784
795
  }
785
- });
796
+ };
797
+
798
+ for (var _iterator2 = arr, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
799
+ var _ref3;
800
+
801
+ if (_isArray2) {
802
+ if (_i2 >= _iterator2.length) break;
803
+ _ref3 = _iterator2[_i2++];
804
+ } else {
805
+ _i2 = _iterator2.next();
806
+ if (_i2.done) break;
807
+ _ref3 = _i2.value;
808
+ }
809
+
810
+ var item = _ref3;
811
+
812
+ _loop(item);
813
+ }
786
814
  };
787
815
  recursion(columns);
788
816
  if (dataList) {
@@ -792,7 +820,7 @@ var _initialiseProps = function _initialiseProps() {
792
820
  }
793
821
  var columnsNew = columns;
794
822
  if (autoAddNumber) {
795
- if (columns.length > 0) {
823
+ if (columnsNew.length > 0) {
796
824
  columnsNew = [{
797
825
  title: '序号',
798
826
  dataIndex: 'number',
@@ -805,10 +833,30 @@ var _initialiseProps = function _initialiseProps() {
805
833
  ' '
806
834
  );
807
835
  }
808
- }].concat(columns);
836
+ }].concat(columnsNew);
837
+ }
838
+ }
839
+ return [].concat(columnsNew);
840
+ };
841
+
842
+ this.deepCopy = function (obj) {
843
+ if (typeof obj !== 'object' || obj === null) {
844
+ return obj;
845
+ }
846
+
847
+ var copy = Array.isArray(obj) ? [] : {};
848
+
849
+ for (var key in obj) {
850
+ if (key === 'title' || key === 'filterDropdown') {
851
+ copy[key] = obj[key];
852
+ } else if (key === 'children' && Array.isArray(obj[key]) || typeof obj[key] === 'object') {
853
+ copy[key] = _this3.deepCopy(obj[key]);
854
+ } else {
855
+ copy[key] = obj[key];
809
856
  }
810
857
  }
811
- return columnsNew;
858
+
859
+ return copy;
812
860
  };
813
861
  };
814
862
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.49-beta5",
3
+ "version": "1.5.49-beta8",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",