easy3wmui 0.0.43-beta3 → 0.0.43-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/assets/index.css CHANGED
@@ -449,6 +449,13 @@
449
449
  #Easy3wMTable .singleItem .itemAttr.clickable .attrKey {
450
450
  color: var(--adm-color-primary);
451
451
  }
452
+ #Easy3wMTable .singleItem .itemAttr.itemAttrLong {
453
+ -ms-flex-direction: column;
454
+ flex-direction: column;
455
+ }
456
+ #Easy3wMTable .singleItem .itemAttr.itemAttrLong .attrKey {
457
+ text-align: left;
458
+ }
452
459
  #Easy3wMTable .easy3wMGridPageStepper {
453
460
  display: -ms-flexbox;
454
461
  display: flex;
package/assets/mTable.css CHANGED
@@ -54,6 +54,13 @@
54
54
  #Easy3wMTable .singleItem .itemAttr.clickable .attrKey {
55
55
  color: var(--adm-color-primary);
56
56
  }
57
+ #Easy3wMTable .singleItem .itemAttr.itemAttrLong {
58
+ -ms-flex-direction: column;
59
+ flex-direction: column;
60
+ }
61
+ #Easy3wMTable .singleItem .itemAttr.itemAttrLong .attrKey {
62
+ text-align: left;
63
+ }
57
64
  #Easy3wMTable .easy3wMGridPageStepper {
58
65
  display: -ms-flexbox;
59
66
  display: flex;
@@ -514,7 +514,15 @@ var Easy3wMFormPage = function (_Component) {
514
514
  if (readFlag || allReadFlag) {
515
515
  return _react2['default'].createElement(
516
516
  Item,
517
- (0, _extends3['default'])({ label: label, name: fieldId + 'Easy3wView', required: required, initialValue: 'easy3wView', preserve: false }, cmptPros, { rules: addrules }),
517
+ (0, _extends3['default'])({
518
+ label: label,
519
+ name: fieldId + 'Easy3wView',
520
+ required: required,
521
+ initialValue: 'easy3wView',
522
+ preserve: false
523
+ }, itemProps, cmptPros, {
524
+ rules: addrules
525
+ }),
518
526
  value
519
527
  );
520
528
  } else {
@@ -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) {
@@ -447,9 +482,10 @@ var Easy3wMTable = function (_PureComponent) {
447
482
  columns.map(function (obj) {
448
483
  var title = obj.title,
449
484
  dataIndex = obj.dataIndex,
485
+ type = obj.type,
450
486
  render = obj.render,
451
487
  onRow = obj.onRow,
452
- _onClick = obj.onClick;
488
+ onClick = obj.onClick;
453
489
 
454
490
  var value = item[dataIndex];
455
491
  if (render) {
@@ -457,9 +493,9 @@ var Easy3wMTable = function (_PureComponent) {
457
493
  }
458
494
  return _react2['default'].createElement(
459
495
  'div',
460
- { className: 'itemAttr ' + (onRow ? 'clickable' : ''), onClick: function onClick() {
496
+ { className: 'itemAttr ' + (type === 'longText' ? 'itemAttrLong' : '') + ' ' + (onRow ? 'clickable' : ''), onClick: onRow ? function () {
461
497
  return onRow(item[dataIndex], item, index);
462
- } },
498
+ } : function () {} },
463
499
  _react2['default'].createElement(
464
500
  'span',
465
501
  { className: 'attrLabel' },
@@ -467,9 +503,9 @@ var Easy3wMTable = function (_PureComponent) {
467
503
  ),
468
504
  _react2['default'].createElement(
469
505
  'span',
470
- { className: 'attrKey ' + (_onClick ? 'clickable' : ''), onClick: function onClick() {
471
- return _onClick(item[dataIndex], item, index);
472
- } },
506
+ { className: 'attrKey ' + (onClick ? 'clickable' : ''), onClick: onClick ? function () {
507
+ return onClick(item[dataIndex], item, index);
508
+ } : function () {} },
473
509
  value
474
510
  )
475
511
  );
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-beta5",
4
4
  "description": "easy3wmui components for react",
5
5
  "keywords": [
6
6
  "react",