easy3wmui 0.0.43-beta2 → 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
|
// 生成分页数字
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
|
|
5
|
+
var _toast = require('antd-mobile/es/components/toast');
|
|
6
|
+
|
|
7
|
+
var _toast2 = _interopRequireDefault(_toast);
|
|
8
|
+
|
|
5
9
|
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
6
10
|
|
|
7
11
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
@@ -20,6 +24,8 @@ var _react2 = _interopRequireDefault(_react);
|
|
|
20
24
|
|
|
21
25
|
var _dva = require('dva');
|
|
22
26
|
|
|
27
|
+
var _antdMobile = require('antd-mobile');
|
|
28
|
+
|
|
23
29
|
var _antdMobileIcons = require('antd-mobile-icons');
|
|
24
30
|
|
|
25
31
|
var _Easy3wMCard = require('../Easy3wMCard');
|
|
@@ -37,33 +43,43 @@ var Easy3wMPagination = function (_PureComponent) {
|
|
|
37
43
|
var _this = (0, _possibleConstructorReturn3['default'])(this, _PureComponent.call(this, props));
|
|
38
44
|
|
|
39
45
|
_this.onChange = function (num, notFetchFlag) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
var globalLoading = _this.props.loading.global;
|
|
47
|
+
if (globalLoading) {
|
|
48
|
+
_toast2['default'].show({
|
|
49
|
+
icon: 'loading',
|
|
50
|
+
content: '正在后台处理,请稍后!',
|
|
51
|
+
duration: 3000
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
// func(e);
|
|
55
|
+
var _this$props = _this.props,
|
|
56
|
+
intData = _this$props.intData,
|
|
57
|
+
touchFetch = _this$props.touchFetch;
|
|
43
58
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
var intTotalPage = Math.ceil(intData / 10);
|
|
60
|
+
// const intTotalPage = 99999;
|
|
61
|
+
var offset = _this.state.offset;
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
if (offset < 1) {
|
|
54
|
-
offset = 1;
|
|
55
|
-
} else if (offset > intTotalPage) {
|
|
56
|
-
offset = intTotalPage;
|
|
57
|
-
}
|
|
58
|
-
_this.setState({
|
|
59
|
-
offset: offset // 当前页
|
|
60
|
-
}, function () {
|
|
61
|
-
if (notFetchFlag) {// true 不查询 false 查询
|
|
62
|
-
// 不查询
|
|
63
|
-
} else if (touchFetch && typeof touchFetch === 'function') {
|
|
64
|
-
touchFetch();
|
|
63
|
+
if (typeof num === 'string') {
|
|
64
|
+
offset += Number(num);
|
|
65
|
+
} else {
|
|
66
|
+
offset = num;
|
|
65
67
|
}
|
|
66
|
-
|
|
68
|
+
if (offset < 1) {
|
|
69
|
+
offset = 1;
|
|
70
|
+
} else if (offset > intTotalPage) {
|
|
71
|
+
offset = intTotalPage;
|
|
72
|
+
}
|
|
73
|
+
_this.setState({
|
|
74
|
+
offset: offset // 当前页
|
|
75
|
+
}, function () {
|
|
76
|
+
if (notFetchFlag) {// true 不查询 false 查询
|
|
77
|
+
// 不查询
|
|
78
|
+
} else if (touchFetch && typeof touchFetch === 'function') {
|
|
79
|
+
touchFetch();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
67
83
|
};
|
|
68
84
|
|
|
69
85
|
_this.touchCreatePageNum = function (intTotalPage, offset, index) {
|
|
@@ -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
|
|
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
|
-
},
|
|
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
|
-
{
|
|
417
|
-
'
|
|
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) {
|