easy3wmui 0.0.43-beta3 → 0.0.43-beta4

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,6 +72,20 @@ var Easy3wMGridPage = function (_Component) {
72
72
  return _this;
73
73
  }
74
74
 
75
+ Easy3wMGridPage.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
76
+ var offset = this.state.offset;
77
+ var totalResult = nextProps.totalResult;
78
+ // const { totalResult } = this.props;
79
+
80
+ var intTotalPage = Math.ceil(totalResult / 10);
81
+ // 查询之后发现,当前页数大于最大页数 (情况:1、录入查询条件,直接选择了最后一个分页,最终当前页数大于最大页数)
82
+ if (totalResult !== this.props.totalResult && offset > intTotalPage) {
83
+ this.setState({
84
+ offset: intTotalPage
85
+ });
86
+ }
87
+ };
88
+
75
89
  Easy3wMGridPage.prototype.componentWillUnmount = function componentWillUnmount() {};
76
90
  // --------------------------------------------- 分页 start ---------------------------------------------
77
91
  // 生成分页数字
@@ -64,7 +64,9 @@ var Easy3wMTable = function (_PureComponent) {
64
64
  var handleSearch = _this.props.handleSearch;
65
65
  var offset = _this.state.offset;
66
66
 
67
- handleSearch(offset, _this.searchInfo, callback);
67
+ if (handleSearch && typeof handleSearch === 'function') {
68
+ handleSearch(offset, _this.searchInfo, callback);
69
+ }
68
70
  };
69
71
 
70
72
  _this.touchCreatePageNum = function (intTotalPage, offset, index) {
@@ -144,7 +146,7 @@ var Easy3wMTable = function (_PureComponent) {
144
146
  }
145
147
  };
146
148
 
147
- _this.touchChangePage = function (num) {
149
+ _this.touchChangePage = function (num, notFetchFlag) {
148
150
  var intData = _this.props.intData;
149
151
 
150
152
  var intTotalPage = Math.ceil(intData / 10);
@@ -163,7 +165,13 @@ var Easy3wMTable = function (_PureComponent) {
163
165
  }
164
166
  _this.setState({
165
167
  offset: offset // 当前页
166
- }, _this.touchFetch);
168
+ }, function () {
169
+ if (notFetchFlag) {// true 不查询 false 查询
170
+ // 不查询
171
+ } else {
172
+ _this.touchFetch();
173
+ }
174
+ });
167
175
  };
168
176
 
169
177
  _this.touchDropUpFlip = function () {
@@ -306,6 +314,20 @@ var Easy3wMTable = function (_PureComponent) {
306
314
  }
307
315
  };
308
316
 
317
+ Easy3wMTable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
318
+ var offset = this.state.offset;
319
+ var intData = nextProps.intData;
320
+ // const { intData } = this.props;
321
+
322
+ var intTotalPage = Math.ceil(intData / 10);
323
+ // 查询之后发现,当前页数大于最大页数 (情况:1、录入查询条件,直接选择了最后一个分页,最终当前页数大于最大页数)
324
+ if (intData !== this.props.intData && offset > intTotalPage) {
325
+ this.setState({
326
+ offset: intTotalPage
327
+ });
328
+ }
329
+ };
330
+
309
331
  Easy3wMTable.prototype.componentWillUnmount = function componentWillUnmount() {
310
332
  var flipContainer = document.querySelector('.flipContainer'); // 翻页主体
311
333
  if (flipContainer.removeEventListener) {
@@ -413,8 +435,21 @@ var Easy3wMTable = function (_PureComponent) {
413
435
  className: 'queryCriteria',
414
436
  extra: arrFilter && arrFilter.length ? _react2['default'].createElement(
415
437
  'div',
416
- { className: 'more', onClick: this.showModal },
417
- '\u66F4\u591A\u7B5B\u9009'
438
+ { style: { fontSize: '18px' } },
439
+ _react2['default'].createElement(
440
+ 'span',
441
+ { style: { marginRight: '12px' }, onClick: function onClick() {
442
+ return _this2.deleteFilter();
443
+ } },
444
+ _react2['default'].createElement(_antdMobileIcons.RedoOutline, null)
445
+ ),
446
+ _react2['default'].createElement(
447
+ 'span',
448
+ { onClick: function onClick() {
449
+ return _this2.showModal();
450
+ } },
451
+ _react2['default'].createElement(_antdMobileIcons.FilterOutline, null)
452
+ )
418
453
  ) : '',
419
454
  title: _react2['default'].createElement(_easy3wmui.Easy3wMSearchBar, {
420
455
  onChange: function onChange(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wmui",
3
- "version": "0.0.43-beta3",
3
+ "version": "0.0.43-beta4",
4
4
  "description": "easy3wmui components for react",
5
5
  "keywords": [
6
6
  "react",