tntd 1.4.19 → 1.4.20

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 (170) hide show
  1. package/components/Layout/Avatar.js +4 -4
  2. package/components/Layout/EnterpriseLayout/Avatar.js +10 -7
  3. package/components/Layout/EnterpriseLayout/Language.js +5 -3
  4. package/components/Layout/EnterpriseLayout/Theme.js +6 -7
  5. package/components/Layout/EnterpriseLayout/index.js +1 -1
  6. package/components/Layout/HeaderActions.js +13 -10
  7. package/components/Layout/HeaderTabs.js +13 -14
  8. package/components/Layout/Layout.js +2 -0
  9. package/components/Layout/index.js +2 -1
  10. package/components/Layout/storage.js +12 -2
  11. package/components/Page/index.js +2 -2
  12. package/components/locale.js +7 -2
  13. package/dist/1.tntd.js +1 -12
  14. package/dist/stats.json +28424 -27998
  15. package/dist/tntd.css +1 -1
  16. package/dist/tntd.js +13 -7
  17. package/es/ArrayInput/icon.js +5 -5
  18. package/es/ArrayInput/index.js +76 -108
  19. package/es/AuthContext.js +1 -1
  20. package/es/Columns/index.js +31 -38
  21. package/es/DevelopmentLogin/LoginModal.js +32 -45
  22. package/es/DevelopmentLogin/index.js +13 -17
  23. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  24. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  25. package/es/Ellipsis/index.js +58 -69
  26. package/es/Handle/index.js +25 -35
  27. package/es/Icon/fonts/iconfont.js +7 -12
  28. package/es/Icon/index.js +10 -13
  29. package/es/Img/Contain.js +24 -29
  30. package/es/Img/Cover.js +40 -54
  31. package/es/Img/index.js +36 -45
  32. package/es/Layout/ActionsContext.js +3 -2
  33. package/es/Layout/AppList.js +37 -92
  34. package/es/Layout/Application.js +26 -72
  35. package/es/Layout/Avatar.js +32 -69
  36. package/es/Layout/CompatibleLanguage.js +39 -94
  37. package/es/Layout/EnterpriseLayout/Avatar.js +49 -79
  38. package/es/Layout/EnterpriseLayout/Language.js +19 -34
  39. package/es/Layout/EnterpriseLayout/Theme.js +23 -37
  40. package/es/Layout/EnterpriseLayout/index.js +14 -16
  41. package/es/Layout/GlobalNavigation/NavigationPopup.js +59 -170
  42. package/es/Layout/GlobalNavigation/index.js +20 -54
  43. package/es/Layout/Header.js +25 -46
  44. package/es/Layout/HeaderActions.js +52 -63
  45. package/es/Layout/HeaderNavs.js +20 -47
  46. package/es/Layout/HeaderTabs.js +61 -115
  47. package/es/Layout/Iconfont.js +1 -1
  48. package/es/Layout/Language.js +14 -32
  49. package/es/Layout/Layout.js +88 -108
  50. package/es/Layout/Logo.js +16 -32
  51. package/es/Layout/OrgAppList.js +62 -107
  52. package/es/Layout/SideMenu.js +63 -124
  53. package/es/Layout/Theme.js +23 -61
  54. package/es/Layout/index.js +29 -36
  55. package/es/Layout/paaslayout/CompactSideMenu.js +35 -74
  56. package/es/Layout/paaslayout/Header.js +22 -45
  57. package/es/Layout/paaslayout/Logo.js +3 -13
  58. package/es/Layout/paaslayout/SideMenu.js +39 -78
  59. package/es/Layout/paaslayout/index.js +75 -102
  60. package/es/Layout/storage.js +26 -9
  61. package/es/LoadingButton/index.js +15 -24
  62. package/es/Modal/index.js +38 -46
  63. package/es/Page/Box.js +34 -41
  64. package/es/Page/index.js +54 -68
  65. package/es/Page/utils.js +0 -5
  66. package/es/QueryForm/Field/Checkbox.js +5 -9
  67. package/es/QueryForm/Field/Select.js +31 -41
  68. package/es/QueryForm/Field/SelectInput.js +26 -41
  69. package/es/QueryForm/Field/fieldsMap.js +0 -1
  70. package/es/QueryForm/Field/index.js +41 -71
  71. package/es/QueryForm/createActions.js +6 -7
  72. package/es/QueryForm/index.js +76 -135
  73. package/es/QueryListScene/List.js +74 -128
  74. package/es/QueryListScene/QueryForm.js +46 -81
  75. package/es/QueryListScene/QueryListScene.js +25 -40
  76. package/es/QueryListScene/Title.js +3 -3
  77. package/es/QueryListScene/Toolbar.js +11 -12
  78. package/es/Select/DropDownWrap.js +29 -50
  79. package/es/Select/index.js +135 -231
  80. package/es/Table/ResizableTable/index.js +26 -40
  81. package/es/Table/index.js +18 -16
  82. package/es/Title/index.js +21 -23
  83. package/es/locale.js +9 -7
  84. package/es/utils/checkAuth.js +3 -5
  85. package/es/utils/findMenuInfoByPath.js +0 -4
  86. package/es/utils/index.js +12 -23
  87. package/lib/ArrayInput/icon.js +6 -6
  88. package/lib/ArrayInput/index.js +78 -127
  89. package/lib/AuthContext.js +1 -4
  90. package/lib/Columns/index.js +31 -47
  91. package/lib/DevelopmentLogin/LoginModal.js +32 -58
  92. package/lib/DevelopmentLogin/index.js +16 -27
  93. package/lib/Ellipsis/Svg/CopySVG.js +13 -15
  94. package/lib/Ellipsis/Svg/TickSVG.js +8 -10
  95. package/lib/Ellipsis/index.js +57 -80
  96. package/lib/Handle/index.js +25 -47
  97. package/lib/Icon/fonts/iconfont.js +7 -12
  98. package/lib/Icon/index.js +11 -20
  99. package/lib/Img/Contain.js +24 -34
  100. package/lib/Img/Cover.js +42 -65
  101. package/lib/Img/index.js +36 -51
  102. package/lib/Layout/ActionsContext.js +1 -4
  103. package/lib/Layout/AppList.js +40 -118
  104. package/lib/Layout/Application.js +26 -86
  105. package/lib/Layout/Avatar.js +35 -89
  106. package/lib/Layout/CompatibleLanguage.js +39 -110
  107. package/lib/Layout/EnterpriseLayout/Avatar.js +52 -101
  108. package/lib/Layout/EnterpriseLayout/Language.js +21 -49
  109. package/lib/Layout/EnterpriseLayout/Theme.js +22 -46
  110. package/lib/Layout/EnterpriseLayout/index.js +14 -23
  111. package/lib/Layout/GlobalNavigation/NavigationPopup.js +59 -186
  112. package/lib/Layout/GlobalNavigation/index.js +23 -74
  113. package/lib/Layout/Header.js +28 -63
  114. package/lib/Layout/HeaderActions.js +48 -74
  115. package/lib/Layout/HeaderNavs.js +23 -61
  116. package/lib/Layout/HeaderTabs.js +58 -126
  117. package/lib/Layout/Iconfont.js +1 -5
  118. package/lib/Layout/Language.js +17 -48
  119. package/lib/Layout/Layout.js +90 -128
  120. package/lib/Layout/Logo.js +19 -43
  121. package/lib/Layout/OrgAppList.js +64 -127
  122. package/lib/Layout/SideMenu.js +65 -143
  123. package/lib/Layout/Theme.js +23 -73
  124. package/lib/Layout/createActions.js +0 -5
  125. package/lib/Layout/images/index.js +0 -28
  126. package/lib/Layout/index.js +33 -57
  127. package/lib/Layout/paaslayout/CompactSideMenu.js +35 -84
  128. package/lib/Layout/paaslayout/Header.js +22 -55
  129. package/lib/Layout/paaslayout/Logo.js +3 -19
  130. package/lib/Layout/paaslayout/SideMenu.js +39 -87
  131. package/lib/Layout/paaslayout/index.js +77 -122
  132. package/lib/Layout/storage.js +29 -35
  133. package/lib/LoadingButton/index.js +15 -29
  134. package/lib/Modal/index.js +38 -53
  135. package/lib/Page/Box.js +34 -45
  136. package/lib/Page/index.js +54 -78
  137. package/lib/Page/utils.js +1 -9
  138. package/lib/QueryForm/Field/Checkbox.js +5 -13
  139. package/lib/QueryForm/Field/Select.js +33 -53
  140. package/lib/QueryForm/Field/SelectInput.js +28 -56
  141. package/lib/QueryForm/Field/fieldsMap.js +1 -15
  142. package/lib/QueryForm/Field/index.js +43 -81
  143. package/lib/QueryForm/createActions.js +6 -12
  144. package/lib/QueryForm/index.js +78 -157
  145. package/lib/QueryForm/useForm.js +0 -5
  146. package/lib/QueryListScene/List.js +76 -140
  147. package/lib/QueryListScene/QueryForm.js +46 -86
  148. package/lib/QueryListScene/QueryListScene.js +25 -46
  149. package/lib/QueryListScene/Title.js +3 -7
  150. package/lib/QueryListScene/Toolbar.js +11 -16
  151. package/lib/QueryListScene/createActions.js +0 -5
  152. package/lib/QueryListScene/index.js +0 -10
  153. package/lib/QueryListScene/useActions.js +0 -5
  154. package/lib/Select/DropDownWrap.js +31 -56
  155. package/lib/Select/index.js +135 -241
  156. package/lib/Table/ResizableTable/index.js +26 -48
  157. package/lib/Table/index.js +17 -28
  158. package/lib/Title/index.js +21 -28
  159. package/lib/index.js +35 -56
  160. package/lib/locale.js +11 -12
  161. package/lib/utils/checkAuth.js +4 -9
  162. package/lib/utils/findMenuInfoByPath.js +1 -8
  163. package/lib/utils/index.js +15 -42
  164. package/package.json +2 -2
  165. package/es/Layout/checkAuth.js +0 -29
  166. package/es/Layout/utils.js +0 -136
  167. package/lib/Layout/EnterpriseLayout/Header.js +0 -113
  168. package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
  169. package/lib/Layout/checkAuth.js +0 -39
  170. package/lib/Layout/utils.js +0 -166
@@ -1,123 +1,89 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports["default"] = void 0;
7
-
8
8
  require("antd/lib/spin/style");
9
-
10
9
  var _spin = _interopRequireDefault(require("antd/lib/spin"));
11
-
12
10
  var _react = _interopRequireWildcard(require("react"));
13
-
14
11
  var _reactDom = require("react-dom");
15
-
16
12
  var _classnames = _interopRequireDefault(require("classnames"));
17
-
18
13
  var _lodash = require("lodash");
19
-
20
14
  var _Table = _interopRequireDefault(require("../Table"));
21
-
22
15
  var _locale = require("../locale");
23
-
24
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
25
-
26
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
-
16
+ var _excluded = ["columns", "children", "pagination", "localPagination", "paginationSticky", "className", "qlsProps"];
17
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
-
30
- 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); }
31
-
32
- 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); }
33
-
20
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
34
21
  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; }
35
-
36
22
  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; }
37
-
38
- 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; }
39
-
40
- 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; }
41
-
42
- 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; }
43
-
23
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
44
26
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
45
-
46
- 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); } }
47
-
48
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
49
-
50
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
51
-
27
+ 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, _toPropertyKey(descriptor.key), descriptor); } }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
31
+ 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
34
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
52
35
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
53
-
54
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
-
56
- 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); }
57
-
58
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
59
-
60
- var QueryList =
61
- /*#__PURE__*/
62
- function (_React$PureComponent) {
36
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
38
+ var QueryList = /*#__PURE__*/function (_React$PureComponent) {
63
39
  _inherits(QueryList, _React$PureComponent);
64
-
40
+ var _super = _createSuper(QueryList);
65
41
  function QueryList(props) {
66
42
  var _props$scroll;
67
-
68
43
  var _this;
69
-
70
44
  _classCallCheck(this, QueryList);
71
-
72
- _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryList).call(this, props));
45
+ _this = _super.call(this, props);
73
46
  _this.onWindowResize = (0, _lodash.debounce)(function () {
74
47
  var scroll = _this.state.scroll;
75
-
76
48
  _this.setState({
77
- scroll: _objectSpread({}, scroll, {
49
+ scroll: _objectSpread(_objectSpread({}, scroll), {}, {
78
50
  y: window.innerHeight - (_this.initialTop || _this.props.top || 200)
79
51
  })
80
52
  });
81
53
  }, 50);
82
-
83
54
  _this.fetchData = function () {
84
55
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
85
-
86
56
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
87
- callback = _ref.callback,
88
- _ref$showLoading = _ref.showLoading,
89
- showLoading = _ref$showLoading === void 0 ? true : _ref$showLoading,
90
- isInterval = _ref.isInterval;
91
-
57
+ callback = _ref.callback,
58
+ _ref$showLoading = _ref.showLoading,
59
+ showLoading = _ref$showLoading === void 0 ? true : _ref$showLoading,
60
+ isInterval = _ref.isInterval;
92
61
  var _this$props = _this.props,
93
- query = _this$props.qlsProps.query,
94
- defaultExpandAllRows = _this$props.defaultExpandAllRows,
95
- rowKey = _this$props.rowKey,
96
- actions = _this$props.actions;
62
+ query = _this$props.qlsProps.query,
63
+ defaultExpandAllRows = _this$props.defaultExpandAllRows,
64
+ rowKey = _this$props.rowKey,
65
+ actions = _this$props.actions;
97
66
  var pagination = _this.state.pagination;
98
67
  var hasPagination = _this.props.pagination !== false;
99
-
100
68
  if (hasPagination) {
101
69
  params = _objectSpread({
102
70
  pageSize: pagination.pageSize,
103
71
  current: pagination.current
104
72
  }, params);
105
73
  }
106
-
107
74
  showLoading && _this.setState({
108
75
  loading: true
109
- }); // 当用户操作查询还未得到服务端响应前,不要执行轮询请求时序问题导致覆盖
76
+ });
110
77
 
78
+ // 当用户操作查询还未得到服务端响应前,不要执行轮询请求时序问题导致覆盖
111
79
  if (!isInterval) {
112
80
  _this.isFetching = true;
113
81
  }
114
-
115
82
  actions.setData('submittedFormData', params);
116
83
  return query((0, _lodash.pickBy)(params, function (val) {
117
84
  return val !== '' && val !== null && val !== undefined;
118
85
  })).then(function (result) {
119
86
  var dataSource = hasPagination ? result.data || [] : result;
120
-
121
87
  _this.setState(_objectSpread({
122
88
  loading: false,
123
89
  dataSource: dataSource,
@@ -142,50 +108,42 @@ function (_React$PureComponent) {
142
108
  callback && callback();
143
109
  });
144
110
  };
145
-
146
111
  _this.updateDataSource = function (dataSource) {
147
112
  _this.setState({
148
113
  dataSource: dataSource
149
114
  });
150
-
151
115
  _this.props.actions.setData('dataSource', dataSource);
152
116
  };
153
-
154
117
  _this.updatePagination = function (pagination) {
155
118
  _this.setState({
156
119
  pagination: pagination
157
120
  });
158
-
159
121
  _this.props.actions.setData('pagination', pagination);
160
122
  };
161
-
162
123
  _this.onFormChange = function (values) {
163
- _this.formData = (0, _lodash.pickBy)(_objectSpread({}, values, {
124
+ _this.formData = (0, _lodash.pickBy)(_objectSpread(_objectSpread({}, values), {}, {
164
125
  sorter: (0, _lodash.get)(_this.formData, 'sorter'),
165
126
  filters: (0, _lodash.get)(_this.formData, 'filters')
166
127
  }), function (val) {
167
128
  return val !== undefined;
168
129
  });
169
130
  };
170
-
171
131
  _this.onSearch = function (values) {
172
132
  var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
173
- callback = _ref2.callback,
174
- _ref2$showLoading = _ref2.showLoading,
175
- showLoading = _ref2$showLoading === void 0 ? true : _ref2$showLoading;
176
-
177
- _this.formData = _objectSpread({}, _this.formData, {}, values); // this.props.actions.setData('formData', this.formData);
178
-
133
+ callback = _ref2.callback,
134
+ _ref2$showLoading = _ref2.showLoading,
135
+ showLoading = _ref2$showLoading === void 0 ? true : _ref2$showLoading;
136
+ _this.formData = _objectSpread(_objectSpread({}, _this.formData), values);
137
+ // this.props.actions.setData('formData', this.formData);
179
138
  return _this.fetchData(_this.formData, {
180
139
  callback: callback,
181
140
  showLoading: showLoading
182
141
  });
183
142
  };
184
-
185
143
  _this.onTableChange = function (pagination, filters, sorter) {
186
144
  var _this$props2 = _this.props,
187
- actions = _this$props2.actions,
188
- localPagination = _this$props2.localPagination;
145
+ actions = _this$props2.actions,
146
+ localPagination = _this$props2.localPagination;
189
147
  var tableParams = {
190
148
  pageSize: pagination.pageSize,
191
149
  current: pagination.current,
@@ -193,17 +151,17 @@ function (_React$PureComponent) {
193
151
  sorter: (0, _lodash.isEmpty)(sorter) ? undefined : sorter
194
152
  };
195
153
  console.log('onTableChange...', actions.getSubmittedFormData(), _this.formData);
196
- Object.assign(_this.formData, tableParams); // 排序变化暂时不处理,因为有时可能是前端sorter不需要走请求
197
- // 所以暂时排序有使用者自己处理
154
+ Object.assign(_this.formData, tableParams);
198
155
 
156
+ // 排序变化暂时不处理,因为有时可能是前端sorter不需要走请求
157
+ // 所以暂时排序有使用者自己处理
199
158
  if (!localPagination) {
200
- _this.fetchData(_objectSpread({}, actions.getSubmittedFormData(), {}, tableParams));
201
-
159
+ _this.fetchData(_objectSpread(_objectSpread({}, actions.getSubmittedFormData()), tableParams));
202
160
  return;
203
161
  }
162
+ var dataSource = _this.state.dataSource;
204
163
 
205
- var dataSource = _this.state.dataSource; // 前端本地分页
206
-
164
+ // 前端本地分页
207
165
  if (localPagination) {
208
166
  _this.setState({
209
167
  dataSource: dataSource,
@@ -218,26 +176,21 @@ function (_React$PureComponent) {
218
176
  });
219
177
  }
220
178
  };
221
-
222
179
  _this.onTableBodyScroll = (0, _lodash.throttle)(function (evt) {
223
180
  console.log('onTableBodyScroll', evt.target.scrollTop);
224
-
225
181
  _this.updateIsScrollToBottom(evt.target);
226
182
  }, 50);
227
-
228
183
  _this.updateIsScrollToBottom = function (tableBody) {
229
184
  var isScrollToBottom = function isScrollToBottom(tableBody) {
230
185
  var scrollHeight = tableBody.scrollHeight,
231
- scrollTop = tableBody.scrollTop,
232
- offsetHeight = tableBody.offsetHeight;
186
+ scrollTop = tableBody.scrollTop,
187
+ offsetHeight = tableBody.offsetHeight;
233
188
  return scrollHeight === scrollTop + offsetHeight;
234
189
  };
235
-
236
190
  _this.setState({
237
191
  hasScrollToBottom: isScrollToBottom(tableBody)
238
192
  });
239
193
  };
240
-
241
194
  _this.state = {
242
195
  loading: false,
243
196
  dataSource: [],
@@ -247,48 +200,40 @@ function (_React$PureComponent) {
247
200
  total: 0
248
201
  },
249
202
  scroll: props.scroll,
250
- hasScrollToBottom: !((_props$scroll = props.scroll) == null ? void 0 : _props$scroll.y)
203
+ hasScrollToBottom: !((_props$scroll = props.scroll) != null && _props$scroll.y)
251
204
  };
252
- _this.tableRef = (0, _react.createRef)();
205
+ _this.tableRef = /*#__PURE__*/(0, _react.createRef)();
253
206
  var _actions = props.actions;
254
-
255
207
  _actions.on('search', _this.onSearch);
256
-
257
208
  _actions.on('setTableDataSource', _this.updateDataSource);
258
-
259
209
  _actions.on('setPagination', _this.updatePagination);
260
-
261
210
  _actions.on('setFormData', _this.onFormChange);
262
-
263
211
  return _this;
264
212
  }
265
-
266
213
  _createClass(QueryList, [{
267
214
  key: "render",
268
215
  value: function render() {
269
216
  var _this$props3 = this.props,
270
- columns = _this$props3.columns,
271
- children = _this$props3.children,
272
- pagination = _this$props3.pagination,
273
- _this$props3$localPag = _this$props3.localPagination,
274
- localPagination = _this$props3$localPag === void 0 ? false : _this$props3$localPag,
275
- _this$props3$paginati = _this$props3.paginationSticky,
276
- paginationSticky = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
277
- _this$props3$classNam = _this$props3.className,
278
- className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
279
- qlsProps = _this$props3.qlsProps,
280
- rest = _objectWithoutProperties(_this$props3, ["columns", "children", "pagination", "localPagination", "paginationSticky", "className", "qlsProps"]);
281
-
217
+ columns = _this$props3.columns,
218
+ children = _this$props3.children,
219
+ pagination = _this$props3.pagination,
220
+ _this$props3$localPag = _this$props3.localPagination,
221
+ localPagination = _this$props3$localPag === void 0 ? false : _this$props3$localPag,
222
+ _this$props3$paginati = _this$props3.paginationSticky,
223
+ paginationSticky = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
224
+ _this$props3$classNam = _this$props3.className,
225
+ className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
226
+ qlsProps = _this$props3.qlsProps,
227
+ rest = _objectWithoutProperties(_this$props3, _excluded);
282
228
  var _this$state = this.state,
283
- dataSource = _this$state.dataSource,
284
- loading = _this$state.loading,
285
- _this$state$expandedR = _this$state.expandedRowKeys,
286
- expandedRowKeys = _this$state$expandedR === void 0 ? [] : _this$state$expandedR,
287
- scroll = _this$state.scroll,
288
- hasScrollToBottom = _this$state.hasScrollToBottom;
229
+ dataSource = _this$state.dataSource,
230
+ loading = _this$state.loading,
231
+ _this$state$expandedR = _this$state.expandedRowKeys,
232
+ expandedRowKeys = _this$state$expandedR === void 0 ? [] : _this$state$expandedR,
233
+ scroll = _this$state.scroll,
234
+ hasScrollToBottom = _this$state.hasScrollToBottom;
289
235
  var hasPagination = typeof pagination !== 'undefined' ? pagination : true;
290
-
291
- var paginationInfo = _objectSpread({}, this.state.pagination, {
236
+ var paginationInfo = _objectSpread(_objectSpread({}, this.state.pagination), {}, {
292
237
  // size: 'small',
293
238
  showQuickJumper: true,
294
239
  showSizeChanger: true,
@@ -296,20 +241,18 @@ function (_React$PureComponent) {
296
241
  return (0, _locale.getText)('totalRecords', (0, _locale.getLanguage)(), total);
297
242
  }
298
243
  }, pagination || {});
299
-
300
244
  var expandProps = _objectSpread({}, rest.defaultExpandAllRows ? {
301
245
  expandedRowKeys: expandedRowKeys,
302
246
  onExpandedRowsChange: this.onExpandedRowsChange
303
247
  } : {});
304
-
305
- return _react["default"].createElement("div", {
248
+ return /*#__PURE__*/_react["default"].createElement("div", {
306
249
  className: (0, _classnames["default"])("tnt-querylistscene-list ".concat(className), {
307
250
  paginationSticky: paginationSticky,
308
251
  hasScrollToBottom: hasScrollToBottom
309
252
  })
310
- }, _react["default"].createElement(_spin["default"], {
253
+ }, /*#__PURE__*/_react["default"].createElement(_spin["default"], {
311
254
  spinning: loading
312
- }, _react["default"].createElement(_Table["default"], _extends({
255
+ }, /*#__PURE__*/_react["default"].createElement(_Table["default"], _extends({
313
256
  ref: this.tableRef
314
257
  }, expandProps, rest, columns ? {
315
258
  columns: columns
@@ -324,13 +267,11 @@ function (_React$PureComponent) {
324
267
  key: "componentDidMount",
325
268
  value: function componentDidMount() {
326
269
  var _this2 = this,
327
- _this$state$scroll;
328
-
270
+ _this$state$scroll;
329
271
  var _this$props4 = this.props,
330
- qlsProps = _this$props4.qlsProps,
331
- actions = _this$props4.actions;
332
- this.formData = _objectSpread({}, actions.getFormData() || {}, {}, qlsProps.memory ? actions.getPagination() : {});
333
-
272
+ qlsProps = _this$props4.qlsProps,
273
+ actions = _this$props4.actions;
274
+ this.formData = _objectSpread(_objectSpread({}, actions.getFormData() || {}), qlsProps.memory ? actions.getPagination() : {});
334
275
  if (!qlsProps.initSearch) {
335
276
  // 默认进来不请求
336
277
  this.fetchData(this.formData)["finally"](function () {
@@ -354,15 +295,12 @@ function (_React$PureComponent) {
354
295
  }, ms);
355
296
  }
356
297
  };
357
-
358
298
  doIntervalQuery(qlsProps.interval);
359
299
  }
360
300
  });
361
301
  }
362
-
363
- if ((_this$state$scroll = this.state.scroll) == null ? void 0 : _this$state$scroll.y) {
302
+ if ((_this$state$scroll = this.state.scroll) != null && _this$state$scroll.y) {
364
303
  window.addEventListener('resize', this.onWindowResize);
365
-
366
304
  if (this.tableRef.current) {
367
305
  // table内垂直滚动,需要动态设置分页组件上阴影样式
368
306
  var tableBody = (0, _reactDom.findDOMNode)(this.tableRef.current).querySelector('.ant-table-body');
@@ -385,9 +323,7 @@ function (_React$PureComponent) {
385
323
  this.timmer && clearTimeout(this.timmer);
386
324
  }
387
325
  }]);
388
-
389
326
  return QueryList;
390
327
  }(_react["default"].PureComponent);
391
-
392
328
  exports["default"] = QueryList;
393
329
  ;
@@ -1,147 +1,110 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports["default"] = void 0;
7
-
8
8
  var _react = _interopRequireDefault(require("react"));
9
-
10
9
  var _classnames2 = _interopRequireDefault(require("classnames"));
11
-
12
10
  var _QueryForm = _interopRequireDefault(require("../QueryForm"));
13
-
11
+ var _excluded = ["className", "actions", "extraActions", "extralActions", "qlsProps"];
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
- 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); }
17
-
18
- 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); }
19
-
13
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
20
14
  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; }
21
-
22
15
  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; }
23
-
24
- 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; }
25
-
26
- 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; }
27
-
28
- 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; }
29
-
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
19
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
-
32
- 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); } }
33
-
34
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
35
-
36
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
37
-
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, _toPropertyKey(descriptor.key), descriptor); } }
21
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
22
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
23
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
24
+ 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
26
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
27
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
38
28
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
-
40
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
-
42
- 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); }
43
-
44
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
-
29
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
46
31
  var clsPrefix = 'tnt-querylistscene-queryform';
47
-
48
- var QueryForm =
49
- /*#__PURE__*/
50
- function (_React$PureComponent) {
32
+ var QueryForm = /*#__PURE__*/function (_React$PureComponent) {
51
33
  _inherits(QueryForm, _React$PureComponent);
52
-
34
+ var _super = _createSuper(QueryForm);
53
35
  function QueryForm(props) {
54
36
  var _this;
55
-
56
37
  _classCallCheck(this, QueryForm);
57
-
58
- _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));
59
-
38
+ _this = _super.call(this, props);
60
39
  _this.onSearch = function () {
61
40
  var _this$props = _this.props,
62
- onSearch = _this$props.onSearch,
63
- actions = _this$props.actions;
41
+ onSearch = _this$props.onSearch,
42
+ actions = _this$props.actions;
64
43
  var values = actions.getFormData();
65
-
66
- var params = _objectSpread({}, values, {
44
+ var params = _objectSpread(_objectSpread({}, values), {}, {
67
45
  current: 1
68
- }); // memory 与 url解析setForm时 监听事件异步
69
-
46
+ });
70
47
 
48
+ // memory 与 url解析setForm时 监听事件异步
71
49
  actions.setData('formData', values);
72
50
  Promise.resolve().then(function () {
73
51
  onSearch && onSearch(params);
74
52
  actions.emit('search', params);
75
53
  });
76
54
  };
77
-
78
55
  _this.onReset = function () {
79
56
  var _this$props2 = _this.props,
80
- initialValues = _this$props2.initialValues,
81
- onReset = _this$props2.onReset,
82
- actions = _this$props2.actions;
57
+ initialValues = _this$props2.initialValues,
58
+ onReset = _this$props2.onReset,
59
+ actions = _this$props2.actions;
83
60
  actions.setFormData(initialValues, false);
84
61
  onReset && onReset(initialValues);
85
-
86
62
  _this.onSearch();
87
63
  };
88
-
89
64
  _this.onChange = function (newValues, changedInfo) {
90
65
  var _this$props3 = _this.props,
91
- onChange = _this$props3.onChange,
92
- actions = _this$props3.actions;
93
-
66
+ onChange = _this$props3.onChange,
67
+ actions = _this$props3.actions;
94
68
  for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
95
69
  rest[_key - 2] = arguments[_key];
96
70
  }
97
-
98
71
  onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
99
72
  actions.setFormData(newValues, false);
100
73
  };
101
-
102
74
  _this.setFormData = function (data, needSearch) {
103
75
  var actions = _this.props.actions;
104
76
  actions.setData('formData', data);
105
-
106
77
  _this.form.setValues(data);
107
-
108
78
  needSearch && _this.onSearch();
109
79
  };
110
-
111
80
  _this.resetFormData = function (needSearch) {
112
81
  var _this$props4 = _this.props,
113
- initialValues = _this$props4.initialValues,
114
- actions = _this$props4.actions;
82
+ initialValues = _this$props4.initialValues,
83
+ actions = _this$props4.actions;
115
84
  actions.setFormData(initialValues, needSearch);
116
-
117
85
  _this.form.resetValues();
118
86
  };
119
-
120
87
  var _actions = props.actions,
121
- form = props.form;
88
+ form = props.form;
122
89
  _this.form = form || _QueryForm["default"].createForm();
123
-
124
90
  _actions.on('setFormData', _this.setFormData);
125
-
126
91
  _actions.on('resetFormData', _this.resetFormData);
127
-
128
92
  return _this;
129
93
  }
130
-
131
94
  _createClass(QueryForm, [{
132
95
  key: "render",
133
96
  value: function render() {
134
97
  var _this$props5 = this.props,
135
- className = _this$props5.className,
136
- actions = _this$props5.actions,
137
- extraActions = _this$props5.extraActions,
138
- extralActions = _this$props5.extralActions,
139
- qlsProps = _this$props5.qlsProps,
140
- props = _objectWithoutProperties(_this$props5, ["className", "actions", "extraActions", "extralActions", "qlsProps"]);
141
-
142
- return _react["default"].createElement(_QueryForm["default"], _extends({}, props, {
98
+ className = _this$props5.className,
99
+ actions = _this$props5.actions,
100
+ extraActions = _this$props5.extraActions,
101
+ extralActions = _this$props5.extralActions,
102
+ qlsProps = _this$props5.qlsProps,
103
+ props = _objectWithoutProperties(_this$props5, _excluded);
104
+ return /*#__PURE__*/_react["default"].createElement(_QueryForm["default"], _extends({}, props, {
143
105
  form: this.form,
144
- className: (0, _classnames2["default"])(clsPrefix, _defineProperty({}, className, className)) // 前期拼写错误,导致需要兼容错误的api
106
+ className: (0, _classnames2["default"])(clsPrefix, _defineProperty({}, className, className))
107
+ // 前期拼写错误,导致需要兼容错误的api
145
108
  ,
146
109
  extraActions: extraActions || extralActions,
147
110
  onChange: this.onChange,
@@ -153,13 +116,12 @@ function (_React$PureComponent) {
153
116
  key: "componentDidMount",
154
117
  value: function componentDidMount() {
155
118
  var _this$props6 = this.props,
156
- _this$props6$initialV = _this$props6.initialValues,
157
- initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,
158
- actions = _this$props6.actions,
159
- qlsProps = _this$props6.qlsProps;
160
-
119
+ _this$props6$initialV = _this$props6.initialValues,
120
+ initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,
121
+ actions = _this$props6.actions,
122
+ qlsProps = _this$props6.qlsProps;
161
123
  if (qlsProps.memory) {
162
- actions.setFormData(_objectSpread({}, initialValues, {}, actions.getFormData()), false);
124
+ actions.setFormData(_objectSpread(_objectSpread({}, initialValues), actions.getFormData()), false);
163
125
  } else {
164
126
  actions.setData('formData', initialValues);
165
127
  }
@@ -172,10 +134,8 @@ function (_React$PureComponent) {
172
134
  actions.removeListener('resetFormData', this.resetFormData);
173
135
  }
174
136
  }]);
175
-
176
137
  return QueryForm;
177
138
  }(_react["default"].PureComponent);
178
-
179
139
  exports["default"] = QueryForm;
180
140
  ;
181
141
  QueryForm.Field = _QueryForm["default"].Field;