tntd 1.4.32 → 1.4.33-beta.1

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.
Files changed (157) hide show
  1. package/components/Ellipsis/index.js +47 -15
  2. package/components/QueryListScene/QueryForm.js +4 -4
  3. package/components/QueryListScene/createActions.js +4 -4
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +24089 -23289
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +7 -10
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +79 -111
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +33 -40
  12. package/es/DevelopmentLogin/LoginModal.js +33 -46
  13. package/es/DevelopmentLogin/index.js +14 -18
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +100 -79
  17. package/es/Handle/index.js +46 -64
  18. package/es/Icon/fonts/iconfont.js +7 -12
  19. package/es/Icon/index.js +12 -15
  20. package/es/Img/Contain.js +26 -31
  21. package/es/Img/Cover.js +43 -57
  22. package/es/Img/index.js +39 -48
  23. package/es/Layout/ActionsContext.js +3 -2
  24. package/es/Layout/AppList.js +39 -94
  25. package/es/Layout/Application.js +28 -74
  26. package/es/Layout/Avatar.js +30 -67
  27. package/es/Layout/CompatibleLanguage.js +41 -96
  28. package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
  29. package/es/Layout/EnterpriseLayout/Language.js +16 -34
  30. package/es/Layout/EnterpriseLayout/Theme.js +18 -36
  31. package/es/Layout/EnterpriseLayout/index.js +14 -16
  32. package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
  33. package/es/Layout/GlobalNavigation/index.js +22 -56
  34. package/es/Layout/Header.js +26 -47
  35. package/es/Layout/HeaderActions.js +45 -59
  36. package/es/Layout/HeaderNavs.js +24 -51
  37. package/es/Layout/HeaderTabs.js +53 -106
  38. package/es/Layout/Iconfont.js +1 -1
  39. package/es/Layout/Language.js +16 -34
  40. package/es/Layout/Layout.js +88 -110
  41. package/es/Layout/Logo.js +17 -33
  42. package/es/Layout/OrgAppList.js +64 -109
  43. package/es/Layout/SideMenu.js +67 -128
  44. package/es/Layout/Theme.js +25 -63
  45. package/es/Layout/index.js +28 -37
  46. package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
  47. package/es/Layout/paaslayout/Header.js +23 -46
  48. package/es/Layout/paaslayout/Logo.js +4 -14
  49. package/es/Layout/paaslayout/SideMenu.js +41 -80
  50. package/es/Layout/paaslayout/index.js +77 -104
  51. package/es/Layout/storage.js +10 -9
  52. package/es/LoadingButton/index.js +18 -27
  53. package/es/Modal/index.js +42 -51
  54. package/es/Page/Box.js +36 -43
  55. package/es/Page/index.js +56 -71
  56. package/es/Page/utils.js +0 -5
  57. package/es/QueryForm/Field/Checkbox.js +7 -11
  58. package/es/QueryForm/Field/Select.js +34 -44
  59. package/es/QueryForm/Field/SelectInput.js +31 -46
  60. package/es/QueryForm/Field/fieldsMap.js +0 -1
  61. package/es/QueryForm/Field/index.js +46 -78
  62. package/es/QueryForm/createActions.js +6 -7
  63. package/es/QueryForm/index.js +79 -140
  64. package/es/QueryListScene/List.js +83 -139
  65. package/es/QueryListScene/QueryForm.js +54 -91
  66. package/es/QueryListScene/QueryListScene.js +29 -47
  67. package/es/QueryListScene/Title.js +3 -3
  68. package/es/QueryListScene/Toolbar.js +13 -14
  69. package/es/QueryListScene/createActions.js +4 -4
  70. package/es/Select/DropDownWrap.js +32 -55
  71. package/es/Select/index.js +140 -232
  72. package/es/Table/ResizableTable/index.js +29 -43
  73. package/es/Table/index.js +20 -19
  74. package/es/Title/index.js +23 -25
  75. package/es/locale.js +1 -5
  76. package/es/utils/checkAuth.js +6 -8
  77. package/es/utils/findMenuInfoByPath.js +0 -4
  78. package/es/utils/index.js +17 -27
  79. package/lib/ArrayInput/icon.js +7 -9
  80. package/lib/ArrayInput/index.js +82 -131
  81. package/lib/AuthContext.js +2 -6
  82. package/lib/Columns/index.js +36 -54
  83. package/lib/DevelopmentLogin/LoginModal.js +36 -63
  84. package/lib/DevelopmentLogin/index.js +21 -31
  85. package/lib/Ellipsis/Svg/CopySVG.js +15 -18
  86. package/lib/Ellipsis/Svg/TickSVG.js +10 -13
  87. package/lib/Ellipsis/index.js +105 -93
  88. package/lib/Handle/index.js +51 -87
  89. package/lib/Icon/fonts/iconfont.js +7 -12
  90. package/lib/Icon/iconList.js +1 -2
  91. package/lib/Icon/index.js +16 -26
  92. package/lib/Img/Contain.js +29 -40
  93. package/lib/Img/Cover.js +48 -72
  94. package/lib/Img/index.js +42 -58
  95. package/lib/Layout/ActionsContext.js +1 -5
  96. package/lib/Layout/AppList.js +45 -124
  97. package/lib/Layout/Application.js +31 -92
  98. package/lib/Layout/Avatar.js +36 -91
  99. package/lib/Layout/CompatibleLanguage.js +44 -116
  100. package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
  101. package/lib/Layout/EnterpriseLayout/Language.js +22 -54
  102. package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
  103. package/lib/Layout/EnterpriseLayout/index.js +17 -27
  104. package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
  105. package/lib/Layout/GlobalNavigation/index.js +28 -80
  106. package/lib/Layout/Header.js +36 -68
  107. package/lib/Layout/HeaderActions.js +51 -81
  108. package/lib/Layout/HeaderNavs.js +30 -70
  109. package/lib/Layout/HeaderTabs.js +58 -127
  110. package/lib/Layout/Iconfont.js +4 -9
  111. package/lib/Layout/Language.js +22 -54
  112. package/lib/Layout/Layout.js +93 -134
  113. package/lib/Layout/Logo.js +26 -47
  114. package/lib/Layout/OrgAppList.js +69 -133
  115. package/lib/Layout/SideMenu.js +72 -151
  116. package/lib/Layout/Theme.js +28 -79
  117. package/lib/Layout/createActions.js +3 -9
  118. package/lib/Layout/images/index.js +5 -36
  119. package/lib/Layout/index.js +35 -63
  120. package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
  121. package/lib/Layout/paaslayout/Header.js +30 -60
  122. package/lib/Layout/paaslayout/Logo.js +11 -24
  123. package/lib/Layout/paaslayout/SideMenu.js +44 -93
  124. package/lib/Layout/paaslayout/index.js +82 -128
  125. package/lib/Layout/storage.js +26 -68
  126. package/lib/LoadingButton/index.js +21 -36
  127. package/lib/Modal/index.js +45 -62
  128. package/lib/Page/Box.js +38 -50
  129. package/lib/Page/index.js +58 -84
  130. package/lib/Page/utils.js +5 -16
  131. package/lib/QueryForm/Field/Checkbox.js +10 -19
  132. package/lib/QueryForm/Field/Select.js +39 -60
  133. package/lib/QueryForm/Field/SelectInput.js +36 -65
  134. package/lib/QueryForm/Field/fieldsMap.js +6 -23
  135. package/lib/QueryForm/Field/index.js +50 -91
  136. package/lib/QueryForm/createActions.js +9 -16
  137. package/lib/QueryForm/index.js +83 -165
  138. package/lib/QueryForm/useForm.js +1 -6
  139. package/lib/QueryListScene/List.js +89 -153
  140. package/lib/QueryListScene/QueryForm.js +58 -101
  141. package/lib/QueryListScene/QueryListScene.js +31 -56
  142. package/lib/QueryListScene/Title.js +6 -11
  143. package/lib/QueryListScene/Toolbar.js +16 -22
  144. package/lib/QueryListScene/createActions.js +7 -13
  145. package/lib/QueryListScene/index.js +5 -19
  146. package/lib/QueryListScene/useActions.js +1 -6
  147. package/lib/Select/DropDownWrap.js +35 -63
  148. package/lib/Select/index.js +142 -245
  149. package/lib/Table/ResizableTable/index.js +31 -54
  150. package/lib/Table/index.js +21 -34
  151. package/lib/Title/index.js +26 -34
  152. package/lib/index.js +36 -57
  153. package/lib/locale.js +9 -25
  154. package/lib/utils/checkAuth.js +9 -16
  155. package/lib/utils/findMenuInfoByPath.js +3 -12
  156. package/lib/utils/index.js +26 -60
  157. package/package.json +3 -2
@@ -1,36 +1,25 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1
2
  import "antd/lib/spin/style";
2
3
  import _Spin from "antd/lib/spin";
3
-
4
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
5
-
6
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
7
-
8
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
-
10
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
-
12
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
13
-
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15
-
16
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
-
18
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
-
20
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
21
-
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
23
-
24
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
25
-
26
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
27
-
28
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
29
-
30
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
-
32
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
-
4
+ var _excluded = ["columns", "children", "pagination", "localPagination", "paginationSticky", "className", "qlsProps"];
5
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
6
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
7
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
8
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
17
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
18
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
19
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
21
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
22
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
34
23
  /**
35
24
  * @file QueryList
36
25
  * @author you.zhang
@@ -41,68 +30,53 @@ import cn from 'classnames';
41
30
  import { get, pickBy, isEmpty, debounce, throttle } from 'lodash';
42
31
  import Table from '../Table';
43
32
  import { getText, getLanguage } from '../locale';
44
-
45
- var QueryList =
46
- /*#__PURE__*/
47
- function (_React$PureComponent) {
48
- _inherits(QueryList, _React$PureComponent);
49
-
33
+ var QueryList = /*#__PURE__*/function (_React$PureComponent) {
50
34
  function QueryList(props) {
51
35
  var _props$scroll;
52
-
53
36
  var _this;
54
-
55
37
  _classCallCheck(this, QueryList);
56
-
57
- _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryList).call(this, props));
38
+ _this = _callSuper(this, QueryList, [props]);
58
39
  _this.onWindowResize = debounce(function () {
59
40
  var scroll = _this.state.scroll;
60
-
61
41
  _this.setState({
62
- scroll: _objectSpread({}, scroll, {
42
+ scroll: _objectSpread(_objectSpread({}, scroll), {}, {
63
43
  y: window.innerHeight - (_this.initialTop || _this.props.top || 200)
64
44
  })
65
45
  });
66
46
  }, 50);
67
-
68
47
  _this.fetchData = function () {
69
48
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
70
-
71
49
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
72
- callback = _ref.callback,
73
- _ref$showLoading = _ref.showLoading,
74
- showLoading = _ref$showLoading === void 0 ? true : _ref$showLoading,
75
- isInterval = _ref.isInterval;
76
-
50
+ callback = _ref.callback,
51
+ _ref$showLoading = _ref.showLoading,
52
+ showLoading = _ref$showLoading === void 0 ? true : _ref$showLoading,
53
+ isInterval = _ref.isInterval;
77
54
  var _this$props = _this.props,
78
- query = _this$props.qlsProps.query,
79
- defaultExpandAllRows = _this$props.defaultExpandAllRows,
80
- rowKey = _this$props.rowKey,
81
- actions = _this$props.actions;
55
+ query = _this$props.qlsProps.query,
56
+ defaultExpandAllRows = _this$props.defaultExpandAllRows,
57
+ rowKey = _this$props.rowKey,
58
+ actions = _this$props.actions;
82
59
  var pagination = _this.state.pagination;
83
60
  var hasPagination = _this.props.pagination !== false;
84
-
85
61
  if (hasPagination) {
86
62
  params = _objectSpread({
87
63
  pageSize: pagination.pageSize,
88
64
  current: pagination.current
89
65
  }, params);
90
66
  }
91
-
92
67
  showLoading && _this.setState({
93
68
  loading: true
94
- }); // 当用户操作查询还未得到服务端响应前,不要执行轮询请求时序问题导致覆盖
69
+ });
95
70
 
71
+ // 当用户操作查询还未得到服务端响应前,不要执行轮询请求时序问题导致覆盖
96
72
  if (!isInterval) {
97
73
  _this.isFetching = true;
98
74
  }
99
-
100
75
  actions.setData('submittedFormData', params);
101
76
  return query(pickBy(params, function (val) {
102
77
  return val !== '' && val !== null && val !== undefined;
103
78
  })).then(function (result) {
104
79
  var dataSource = hasPagination ? result.data || [] : result;
105
-
106
80
  _this.setState(_objectSpread({
107
81
  loading: false,
108
82
  dataSource: dataSource,
@@ -127,50 +101,42 @@ function (_React$PureComponent) {
127
101
  callback && callback();
128
102
  });
129
103
  };
130
-
131
104
  _this.updateDataSource = function (dataSource) {
132
105
  _this.setState({
133
106
  dataSource: dataSource
134
107
  });
135
-
136
108
  _this.props.actions.setData('dataSource', dataSource);
137
109
  };
138
-
139
110
  _this.updatePagination = function (pagination) {
140
111
  _this.setState({
141
112
  pagination: pagination
142
113
  });
143
-
144
114
  _this.props.actions.setData('pagination', pagination);
145
115
  };
146
-
147
116
  _this.onFormChange = function (values) {
148
- _this.formData = pickBy(_objectSpread({}, values, {
117
+ _this.formData = pickBy(_objectSpread(_objectSpread({}, values), {}, {
149
118
  sorter: get(_this.formData, 'sorter'),
150
119
  filters: get(_this.formData, 'filters')
151
120
  }), function (val) {
152
121
  return val !== undefined;
153
122
  });
154
123
  };
155
-
156
124
  _this.onSearch = function (values) {
157
125
  var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
158
- callback = _ref2.callback,
159
- _ref2$showLoading = _ref2.showLoading,
160
- showLoading = _ref2$showLoading === void 0 ? true : _ref2$showLoading;
161
-
162
- _this.formData = _objectSpread({}, _this.formData, {}, values); // this.props.actions.setData('formData', this.formData);
163
-
126
+ callback = _ref2.callback,
127
+ _ref2$showLoading = _ref2.showLoading,
128
+ showLoading = _ref2$showLoading === void 0 ? true : _ref2$showLoading;
129
+ _this.formData = _objectSpread(_objectSpread({}, _this.formData), values);
130
+ // this.props.actions.setData('formData', this.formData);
164
131
  return _this.fetchData(_this.formData, {
165
132
  callback: callback,
166
133
  showLoading: showLoading
167
134
  });
168
135
  };
169
-
170
136
  _this.onTableChange = function (pagination, filters, sorter) {
171
137
  var _this$props2 = _this.props,
172
- actions = _this$props2.actions,
173
- localPagination = _this$props2.localPagination;
138
+ actions = _this$props2.actions,
139
+ localPagination = _this$props2.localPagination;
174
140
  var tableParams = {
175
141
  pageSize: pagination.pageSize,
176
142
  current: pagination.current,
@@ -178,17 +144,17 @@ function (_React$PureComponent) {
178
144
  sorter: isEmpty(sorter) ? undefined : sorter
179
145
  };
180
146
  console.log('onTableChange...', actions.getSubmittedFormData(), _this.formData);
181
- Object.assign(_this.formData, tableParams); // 排序变化暂时不处理,因为有时可能是前端sorter不需要走请求
182
- // 所以暂时排序有使用者自己处理
147
+ Object.assign(_this.formData, tableParams);
183
148
 
149
+ // 排序变化暂时不处理,因为有时可能是前端sorter不需要走请求
150
+ // 所以暂时排序有使用者自己处理
184
151
  if (!localPagination) {
185
- _this.fetchData(_objectSpread({}, actions.getSubmittedFormData(), {}, tableParams));
186
-
152
+ _this.fetchData(_objectSpread(_objectSpread({}, actions.getSubmittedFormData()), tableParams));
187
153
  return;
188
154
  }
155
+ var dataSource = _this.state.dataSource;
189
156
 
190
- var dataSource = _this.state.dataSource; // 前端本地分页
191
-
157
+ // 前端本地分页
192
158
  if (localPagination) {
193
159
  _this.setState({
194
160
  dataSource: dataSource,
@@ -203,26 +169,21 @@ function (_React$PureComponent) {
203
169
  });
204
170
  }
205
171
  };
206
-
207
172
  _this.onTableBodyScroll = throttle(function (evt) {
208
173
  console.log('onTableBodyScroll', evt.target.scrollTop);
209
-
210
174
  _this.updateIsScrollToBottom(evt.target);
211
175
  }, 50);
212
-
213
176
  _this.updateIsScrollToBottom = function (tableBody) {
214
177
  var isScrollToBottom = function isScrollToBottom(tableBody) {
215
178
  var scrollHeight = tableBody.scrollHeight,
216
- scrollTop = tableBody.scrollTop,
217
- offsetHeight = tableBody.offsetHeight;
179
+ scrollTop = tableBody.scrollTop,
180
+ offsetHeight = tableBody.offsetHeight;
218
181
  return scrollHeight === scrollTop + offsetHeight;
219
182
  };
220
-
221
183
  _this.setState({
222
184
  hasScrollToBottom: isScrollToBottom(tableBody)
223
185
  });
224
186
  };
225
-
226
187
  _this.state = {
227
188
  loading: false,
228
189
  dataSource: [],
@@ -232,48 +193,41 @@ function (_React$PureComponent) {
232
193
  total: 0
233
194
  },
234
195
  scroll: props.scroll,
235
- hasScrollToBottom: !((_props$scroll = props.scroll) == null ? void 0 : _props$scroll.y)
196
+ hasScrollToBottom: !((_props$scroll = props.scroll) != null && _props$scroll.y)
236
197
  };
237
- _this.tableRef = createRef();
198
+ _this.tableRef = /*#__PURE__*/createRef();
238
199
  var _actions = props.actions;
239
-
240
200
  _actions.on('search', _this.onSearch);
241
-
242
201
  _actions.on('setTableDataSource', _this.updateDataSource);
243
-
244
202
  _actions.on('setPagination', _this.updatePagination);
245
-
246
203
  _actions.on('setFormData', _this.onFormChange);
247
-
248
204
  return _this;
249
205
  }
250
-
251
- _createClass(QueryList, [{
206
+ _inherits(QueryList, _React$PureComponent);
207
+ return _createClass(QueryList, [{
252
208
  key: "render",
253
209
  value: function render() {
254
210
  var _this$props3 = this.props,
255
- columns = _this$props3.columns,
256
- children = _this$props3.children,
257
- pagination = _this$props3.pagination,
258
- _this$props3$localPag = _this$props3.localPagination,
259
- localPagination = _this$props3$localPag === void 0 ? false : _this$props3$localPag,
260
- _this$props3$paginati = _this$props3.paginationSticky,
261
- paginationSticky = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
262
- _this$props3$classNam = _this$props3.className,
263
- className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
264
- qlsProps = _this$props3.qlsProps,
265
- rest = _objectWithoutProperties(_this$props3, ["columns", "children", "pagination", "localPagination", "paginationSticky", "className", "qlsProps"]);
266
-
211
+ columns = _this$props3.columns,
212
+ children = _this$props3.children,
213
+ pagination = _this$props3.pagination,
214
+ _this$props3$localPag = _this$props3.localPagination,
215
+ localPagination = _this$props3$localPag === void 0 ? false : _this$props3$localPag,
216
+ _this$props3$paginati = _this$props3.paginationSticky,
217
+ paginationSticky = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
218
+ _this$props3$classNam = _this$props3.className,
219
+ className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
220
+ qlsProps = _this$props3.qlsProps,
221
+ rest = _objectWithoutProperties(_this$props3, _excluded);
267
222
  var _this$state = this.state,
268
- dataSource = _this$state.dataSource,
269
- loading = _this$state.loading,
270
- _this$state$expandedR = _this$state.expandedRowKeys,
271
- expandedRowKeys = _this$state$expandedR === void 0 ? [] : _this$state$expandedR,
272
- scroll = _this$state.scroll,
273
- hasScrollToBottom = _this$state.hasScrollToBottom;
223
+ dataSource = _this$state.dataSource,
224
+ loading = _this$state.loading,
225
+ _this$state$expandedR = _this$state.expandedRowKeys,
226
+ expandedRowKeys = _this$state$expandedR === void 0 ? [] : _this$state$expandedR,
227
+ scroll = _this$state.scroll,
228
+ hasScrollToBottom = _this$state.hasScrollToBottom;
274
229
  var hasPagination = typeof pagination !== 'undefined' ? pagination : true;
275
-
276
- var paginationInfo = _objectSpread({}, this.state.pagination, {
230
+ var paginationInfo = _objectSpread(_objectSpread({}, this.state.pagination), {}, {
277
231
  // size: 'small',
278
232
  showQuickJumper: true,
279
233
  showSizeChanger: true,
@@ -281,20 +235,18 @@ function (_React$PureComponent) {
281
235
  return getText('totalRecords', getLanguage(), total);
282
236
  }
283
237
  }, pagination || {});
284
-
285
238
  var expandProps = _objectSpread({}, rest.defaultExpandAllRows ? {
286
239
  expandedRowKeys: expandedRowKeys,
287
240
  onExpandedRowsChange: this.onExpandedRowsChange
288
241
  } : {});
289
-
290
- return React.createElement("div", {
242
+ return /*#__PURE__*/React.createElement("div", {
291
243
  className: cn("tnt-querylistscene-list ".concat(className), {
292
244
  paginationSticky: paginationSticky,
293
245
  hasScrollToBottom: hasScrollToBottom
294
246
  })
295
- }, React.createElement(_Spin, {
247
+ }, /*#__PURE__*/React.createElement(_Spin, {
296
248
  spinning: loading
297
- }, React.createElement(Table, _extends({
249
+ }, /*#__PURE__*/React.createElement(Table, _extends({
298
250
  ref: this.tableRef
299
251
  }, expandProps, rest, columns ? {
300
252
  columns: columns
@@ -309,19 +261,17 @@ function (_React$PureComponent) {
309
261
  key: "componentDidMount",
310
262
  value: function componentDidMount() {
311
263
  var _this2 = this,
312
- _this$state$scroll;
313
-
264
+ _this$state$scroll;
314
265
  var _this$props4 = this.props,
315
- qlsProps = _this$props4.qlsProps,
316
- actions = _this$props4.actions;
317
- this.formData = _objectSpread({}, actions.getFormData() || {}, {}, qlsProps.memory ? actions.getPagination() : {});
318
-
266
+ qlsProps = _this$props4.qlsProps,
267
+ actions = _this$props4.actions;
268
+ this.formData = _objectSpread(_objectSpread({}, actions.getFormData() || {}), qlsProps.memory ? actions.getPagination() : {});
319
269
  if (!qlsProps.initSearch) {
320
270
  // 默认进来不请求
321
271
  this.fetchData(this.formData)["finally"](function () {
322
272
  // 轮询
323
273
  if (qlsProps.interval && !_this2.isUnmounted) {
324
- var doIntervalQuery = function doIntervalQuery(ms) {
274
+ var _doIntervalQuery = function doIntervalQuery(ms) {
325
275
  // 组件unmounted后,不执行轮训逻辑
326
276
  if (!_this2.isUnmounted) {
327
277
  _this2.timmer = setTimeout(function () {
@@ -331,23 +281,20 @@ function (_React$PureComponent) {
331
281
  isInterval: true,
332
282
  showLoading: false
333
283
  }).then(function () {
334
- doIntervalQuery(ms);
284
+ _doIntervalQuery(ms);
335
285
  });
336
286
  } else {
337
- doIntervalQuery(ms);
287
+ _doIntervalQuery(ms);
338
288
  }
339
289
  }, ms);
340
290
  }
341
291
  };
342
-
343
- doIntervalQuery(qlsProps.interval);
292
+ _doIntervalQuery(qlsProps.interval);
344
293
  }
345
294
  });
346
295
  }
347
-
348
- if ((_this$state$scroll = this.state.scroll) == null ? void 0 : _this$state$scroll.y) {
296
+ if ((_this$state$scroll = this.state.scroll) != null && _this$state$scroll.y) {
349
297
  window.addEventListener('resize', this.onWindowResize);
350
-
351
298
  if (this.tableRef.current) {
352
299
  // table内垂直滚动,需要动态设置分页组件上阴影样式
353
300
  var tableBody = findDOMNode(this.tableRef.current).querySelector('.ant-table-body');
@@ -370,9 +317,6 @@ function (_React$PureComponent) {
370
317
  this.timmer && clearTimeout(this.timmer);
371
318
  }
372
319
  }]);
373
-
374
- return QueryList;
375
320
  }(React.PureComponent);
376
-
377
321
  export { QueryList as default };
378
322
  ;