@vortex-ui/env-puzzle 2.0.0-beta.9 → 3.0.0-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 (216) hide show
  1. package/README.md +46 -46
  2. package/lib/b-map/b-map.d.ts +1 -1
  3. package/lib/b-map/b-map.js +100 -162
  4. package/lib/b-map/b-map.js.map +1 -1
  5. package/lib/b-map/custom-overlay.js +17 -37
  6. package/lib/b-map/custom-overlay.js.map +1 -1
  7. package/lib/b-map/drawing.js +11 -25
  8. package/lib/b-map/drawing.js.map +1 -1
  9. package/lib/b-map/index.d.ts +2 -2
  10. package/lib/b-map/index.js +4 -16
  11. package/lib/b-map/index.js.map +1 -1
  12. package/lib/b-map/js/marker-clusterer.js +223 -339
  13. package/lib/b-map/js/marker-clusterer.js.map +1 -1
  14. package/lib/b-map/lushu.js +17 -36
  15. package/lib/b-map/lushu.js.map +1 -1
  16. package/lib/b-map/marker-clusterer.js +6 -14
  17. package/lib/b-map/marker-clusterer.js.map +1 -1
  18. package/lib/b-map/marker.js +32 -70
  19. package/lib/b-map/marker.js.map +1 -1
  20. package/lib/b-map/polygon.js +5 -13
  21. package/lib/b-map/polygon.js.map +1 -1
  22. package/lib/b-map/style/css.js.map +1 -1
  23. package/lib/b-map/style/index.js.map +1 -1
  24. package/lib/b-map/style/index.less +10 -10
  25. package/lib/create-modal/create-modal.js +150 -288
  26. package/lib/create-modal/create-modal.js.map +1 -1
  27. package/lib/create-modal/index.d.ts +1 -2
  28. package/lib/create-modal/index.js +2 -8
  29. package/lib/create-modal/index.js.map +1 -1
  30. package/lib/create-modal/style/css.js +0 -18
  31. package/lib/create-modal/style/css.js.map +1 -1
  32. package/lib/create-modal/style/index.css +2 -2
  33. package/lib/create-modal/style/index.d.ts +0 -9
  34. package/lib/create-modal/style/index.js +0 -18
  35. package/lib/create-modal/style/index.js.map +1 -1
  36. package/lib/create-modal/style/index.less +116 -119
  37. package/lib/global.less +5 -6
  38. package/lib/import-modal/import-modal.d.ts +2 -0
  39. package/lib/import-modal/import-modal.js +133 -192
  40. package/lib/import-modal/import-modal.js.map +1 -1
  41. package/lib/import-modal/index.js +2 -6
  42. package/lib/import-modal/index.js.map +1 -1
  43. package/lib/import-modal/style/css.js +0 -10
  44. package/lib/import-modal/style/css.js.map +1 -1
  45. package/lib/import-modal/style/index.d.ts +0 -5
  46. package/lib/import-modal/style/index.js +0 -10
  47. package/lib/import-modal/style/index.js.map +1 -1
  48. package/lib/import-modal/style/index.less +14 -15
  49. package/lib/index.js +1 -14
  50. package/lib/index.js.map +1 -1
  51. package/lib/interface/index.js.map +1 -1
  52. package/lib/mapv-Layer/Function.js +0 -2
  53. package/lib/mapv-Layer/Function.js.map +1 -1
  54. package/lib/mapv-Layer/index.js +2 -6
  55. package/lib/mapv-Layer/index.js.map +1 -1
  56. package/lib/mapv-Layer/mapv-Layer.js +19 -40
  57. package/lib/mapv-Layer/mapv-Layer.js.map +1 -1
  58. package/lib/mapv-Layer/style/css.js.map +1 -1
  59. package/lib/mapv-Layer/style/index.js.map +1 -1
  60. package/lib/percent/index.d.ts +1 -1
  61. package/lib/percent/index.js +2 -7
  62. package/lib/percent/index.js.map +1 -1
  63. package/lib/percent/interface.js.map +1 -1
  64. package/lib/percent/line-percent.js +20 -37
  65. package/lib/percent/line-percent.js.map +1 -1
  66. package/lib/percent/percent.js +20 -43
  67. package/lib/percent/percent.js.map +1 -1
  68. package/lib/percent/style/css.js.map +1 -1
  69. package/lib/percent/style/index.js.map +1 -1
  70. package/lib/percent/style/index.less +41 -41
  71. package/lib/scroll/index.js +2 -6
  72. package/lib/scroll/index.js.map +1 -1
  73. package/lib/scroll/scroll.d.ts +1 -1
  74. package/lib/scroll/scroll.js +19 -47
  75. package/lib/scroll/scroll.js.map +1 -1
  76. package/lib/scroll/style/css.js.map +1 -1
  77. package/lib/scroll/style/index.js.map +1 -1
  78. package/lib/scroll/style/index.less +3 -3
  79. package/lib/scroll-select/index.js +2 -6
  80. package/lib/scroll-select/index.js.map +1 -1
  81. package/lib/scroll-select/scrollSelect.d.ts +2 -1
  82. package/lib/scroll-select/scrollSelect.js +141 -215
  83. package/lib/scroll-select/scrollSelect.js.map +1 -1
  84. package/lib/scroll-select/style/css.js +0 -2
  85. package/lib/scroll-select/style/css.js.map +1 -1
  86. package/lib/scroll-select/style/index.d.ts +0 -1
  87. package/lib/scroll-select/style/index.js +0 -2
  88. package/lib/scroll-select/style/index.js.map +1 -1
  89. package/lib/scroll-select/style/index.less +7 -7
  90. package/lib/style/color.less +1 -1
  91. package/lib/table/index.js +2 -6
  92. package/lib/table/index.js.map +1 -1
  93. package/lib/table/style/css.js +0 -2
  94. package/lib/table/style/css.js.map +1 -1
  95. package/lib/table/style/index.d.ts +0 -1
  96. package/lib/table/style/index.js +0 -2
  97. package/lib/table/style/index.js.map +1 -1
  98. package/lib/table/table.js +22 -54
  99. package/lib/table/table.js.map +1 -1
  100. package/lib/template/action.d.ts +3 -1
  101. package/lib/template/action.js +80 -116
  102. package/lib/template/action.js.map +1 -1
  103. package/lib/template/card-table.d.ts +4 -4
  104. package/lib/template/card-table.js +40 -82
  105. package/lib/template/card-table.js.map +1 -1
  106. package/lib/template/card.d.ts +1 -1
  107. package/lib/template/card.js +20 -38
  108. package/lib/template/card.js.map +1 -1
  109. package/lib/template/check-row.d.ts +2 -1
  110. package/lib/template/check-row.js +7 -12
  111. package/lib/template/check-row.js.map +1 -1
  112. package/lib/template/field.js +8 -24
  113. package/lib/template/field.js.map +1 -1
  114. package/lib/template/filter.d.ts +0 -1
  115. package/lib/template/filter.js +25 -63
  116. package/lib/template/filter.js.map +1 -1
  117. package/lib/template/icon.js +4 -15
  118. package/lib/template/icon.js.map +1 -1
  119. package/lib/template/index.d.ts +2 -3
  120. package/lib/template/index.js +4 -12
  121. package/lib/template/index.js.map +1 -1
  122. package/lib/template/interface.js.map +1 -1
  123. package/lib/template/renderColumnButtons.js +64 -95
  124. package/lib/template/renderColumnButtons.js.map +1 -1
  125. package/lib/template/style/action.css +3 -2
  126. package/lib/template/style/action.less +74 -71
  127. package/lib/template/style/card.css +2 -2
  128. package/lib/template/style/card.less +87 -88
  129. package/lib/template/style/check-row.less +27 -27
  130. package/lib/template/style/css.js +0 -36
  131. package/lib/template/style/css.js.map +1 -1
  132. package/lib/template/style/field.less +11 -11
  133. package/lib/template/style/filter.css +0 -29
  134. package/lib/template/style/filter.less +46 -72
  135. package/lib/template/style/icon.less +7 -7
  136. package/lib/template/style/index.css +8 -42
  137. package/lib/template/style/index.d.ts +0 -18
  138. package/lib/template/style/index.js +0 -36
  139. package/lib/template/style/index.js.map +1 -1
  140. package/lib/template/style/index.less +48 -49
  141. package/lib/template/style/table.css +0 -6
  142. package/lib/template/style/table.less +79 -91
  143. package/lib/template/table.d.ts +5 -4
  144. package/lib/template/table.js +21 -43
  145. package/lib/template/table.js.map +1 -1
  146. package/lib/template/template.d.ts +3 -3
  147. package/lib/template/template.js +134 -258
  148. package/lib/template/template.js.map +1 -1
  149. package/lib/template/toolbar.d.ts +1 -1
  150. package/lib/template/toolbar.js +52 -56
  151. package/lib/template/toolbar.js.map +1 -1
  152. package/lib/to-map/container.js +48 -95
  153. package/lib/to-map/container.js.map +1 -1
  154. package/lib/to-map/draw-area.js +12 -32
  155. package/lib/to-map/draw-area.js.map +1 -1
  156. package/lib/to-map/index.d.ts +1 -1
  157. package/lib/to-map/index.js +2 -7
  158. package/lib/to-map/index.js.map +1 -1
  159. package/lib/to-map/style/css.js +0 -2
  160. package/lib/to-map/style/css.js.map +1 -1
  161. package/lib/to-map/style/index.d.ts +0 -1
  162. package/lib/to-map/style/index.js +0 -2
  163. package/lib/to-map/style/index.js.map +1 -1
  164. package/lib/to-map/style/index.less +86 -86
  165. package/lib/to-map/to-map.js +20 -47
  166. package/lib/to-map/to-map.js.map +1 -1
  167. package/lib/upload/index.js +2 -6
  168. package/lib/upload/index.js.map +1 -1
  169. package/lib/upload/style/css.js +0 -5
  170. package/lib/upload/style/css.js.map +1 -1
  171. package/lib/upload/style/index.d.ts +0 -2
  172. package/lib/upload/style/index.js +0 -5
  173. package/lib/upload/style/index.js.map +1 -1
  174. package/lib/upload/upload.d.ts +3 -0
  175. package/lib/upload/upload.js +158 -237
  176. package/lib/upload/upload.js.map +1 -1
  177. package/lib/use-simple-res/demos/index.d.ts +2 -1
  178. package/lib/use-simple-res/demos/index.js +31 -59
  179. package/lib/use-simple-res/demos/index.js.map +1 -1
  180. package/lib/use-simple-res/index.js +60 -73
  181. package/lib/use-simple-res/index.js.map +1 -1
  182. package/lib/use-simple-res/style/css.js.map +1 -1
  183. package/lib/use-simple-res/style/index.js.map +1 -1
  184. package/lib/utils/dom-util.js +8 -27
  185. package/lib/utils/dom-util.js.map +1 -1
  186. package/lib/utils/request-util.d.ts +10 -1
  187. package/lib/utils/request-util.js +170 -45
  188. package/lib/utils/request-util.js.map +1 -1
  189. package/lib/utils/string-util.d.ts +2 -0
  190. package/lib/utils/string-util.js +34 -16
  191. package/lib/utils/string-util.js.map +1 -1
  192. package/lib/view-modal/index.d.ts +0 -1
  193. package/lib/view-modal/index.js +2 -8
  194. package/lib/view-modal/index.js.map +1 -1
  195. package/lib/view-modal/style/css.js +0 -12
  196. package/lib/view-modal/style/css.js.map +1 -1
  197. package/lib/view-modal/style/index.css +3 -41
  198. package/lib/view-modal/style/index.d.ts +0 -7
  199. package/lib/view-modal/style/index.js +0 -12
  200. package/lib/view-modal/style/index.js.map +1 -1
  201. package/lib/view-modal/style/index.less +42 -57
  202. package/lib/view-modal/view-modal.js +28 -75
  203. package/lib/view-modal/view-modal.js.map +1 -1
  204. package/package.json +157 -143
  205. package/lib/style/css.js +0 -13
  206. package/lib/style/css.js.map +0 -1
  207. package/lib/style/darkGreen.css +0 -719
  208. package/lib/style/darkGreen.less +0 -482
  209. package/lib/style/index.d.ts +0 -2
  210. package/lib/style/index.js +0 -13
  211. package/lib/style/index.js.map +0 -1
  212. package/lib/template/vtx-search/index.d.ts +0 -2
  213. package/lib/template/vtx-search/index.js +0 -126
  214. package/lib/template/vtx-search/index.js.map +0 -1
  215. package/lib/template/vtx-search/style/index.css +0 -92
  216. package/lib/template/vtx-search/style/index.less +0 -92
@@ -1,65 +1,42 @@
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); }
4
-
3
+ 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); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
- var React = _interopRequireWildcard(require("react"));
11
-
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var React = _react;
12
10
  var _action = _interopRequireDefault(require("./action"));
13
-
14
11
  var _filter = _interopRequireDefault(require("./filter"));
15
-
16
12
  var _table = _interopRequireDefault(require("./table"));
17
-
18
13
  var _cardTable = _interopRequireDefault(require("./card-table"));
19
-
20
14
  var _importModal = _interopRequireDefault(require("../import-modal"));
21
-
22
15
  var _vtxPageLayout = _interopRequireDefault(require("@vtx/components/lib/vtx-page-layout"));
23
-
24
16
  var _antd = require("antd");
25
-
26
- var _lodash = _interopRequireDefault(require("lodash"));
27
-
28
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
-
30
- 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); }
31
-
32
- 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; }
33
-
34
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
35
-
36
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
37
-
38
- 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); } }
39
-
40
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
-
44
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
-
46
- 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); }; }
47
-
48
- 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); }
49
-
50
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
51
-
52
- 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; } }
53
-
54
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
-
17
+ var _isEqual = _interopRequireDefault(require("lodash-es/isEqual"));
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
21
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
22
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
23
+ 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); } }
24
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
+ 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); }
27
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
28
+ 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); }
29
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
30
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
31
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
32
+ 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); }
33
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
56
34
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
57
35
  function adopt(value) {
58
36
  return value instanceof P ? value : new P(function (resolve) {
59
37
  resolve(value);
60
38
  });
61
39
  }
62
-
63
40
  return new (P || (P = Promise))(function (resolve, reject) {
64
41
  function fulfilled(value) {
65
42
  try {
@@ -68,7 +45,6 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
68
45
  reject(e);
69
46
  }
70
47
  }
71
-
72
48
  function rejected(value) {
73
49
  try {
74
50
  step(generator["throw"](value));
@@ -76,46 +52,31 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
76
52
  reject(e);
77
53
  }
78
54
  }
79
-
80
55
  function step(result) {
81
56
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
82
57
  }
83
-
84
58
  step((generator = generator.apply(thisArg, _arguments || [])).next());
85
59
  });
86
60
  };
87
-
88
61
  var __rest = void 0 && (void 0).__rest || function (s, e) {
89
62
  var t = {};
90
-
91
- for (var p in s) {
92
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
93
- }
94
-
63
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
95
64
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
96
65
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
97
66
  }
98
67
  return t;
99
68
  };
100
-
101
69
  var TableLayout = _vtxPageLayout["default"].TableLayout;
102
70
  var DEFAULT_PAGINATION = {
103
71
  total: 0,
104
72
  current: 1,
105
73
  pageSize: 10
106
74
  };
107
-
108
75
  var Template = /*#__PURE__*/function (_Component) {
109
- _inherits(Template, _Component);
110
-
111
- var _super = _createSuper(Template);
112
-
113
76
  function Template(props) {
114
77
  var _this;
115
-
116
78
  _classCallCheck(this, Template);
117
-
118
- _this = _super.call(this, props);
79
+ _this = _callSuper(this, Template, [props]);
119
80
  _this.state = {
120
81
  filter: {},
121
82
  loading: false,
@@ -127,43 +88,40 @@ var Template = /*#__PURE__*/function (_Component) {
127
88
  showImport: false,
128
89
  showExportLoading: false
129
90
  };
130
- _this.requestDataSource = _this.requestDataSource.bind(_assertThisInitialized(_this));
91
+ _this.requestDataSource = _this.requestDataSource.bind(_this);
131
92
  return _this;
132
93
  }
133
-
134
- _createClass(Template, [{
94
+ _inherits(Template, _Component);
95
+ return _createClass(Template, [{
135
96
  key: "componentDidMount",
136
97
  value: function componentDidMount() {
137
98
  // 是否默认不请求
138
99
  if (this.props.autoRequest && ! /*#__PURE__*/React.isValidElement(this.props.tableProps) && this.props.tableProps.dataSource === undefined) {
139
100
  this.updateFilter();
140
- } // this.props.tableProps && this.setSelfColumns();
141
-
101
+ }
102
+ // this.props.tableProps && this.setSelfColumns();
142
103
  }
143
104
  }, {
144
105
  key: "componentDidUpdate",
145
106
  value: function componentDidUpdate(prevProps, prevState) {
146
- var _a, _b, _c, _d; // 比较差异
147
-
148
-
149
- if (! /*#__PURE__*/React.isValidElement((_a = this.props) === null || _a === void 0 ? void 0 : _a.tableProps) && !_lodash["default"].isEqual((_b = prevProps === null || prevProps === void 0 ? void 0 : prevProps.tableProps) === null || _b === void 0 ? void 0 : _b.columns, (_d = (_c = this.props) === null || _c === void 0 ? void 0 : _c.tableProps) === null || _d === void 0 ? void 0 : _d.columns)) {
107
+ var _a, _b, _c, _d;
108
+ // 比较差异
109
+ if (! /*#__PURE__*/React.isValidElement((_a = this.props) === null || _a === void 0 ? void 0 : _a.tableProps) && !(0, _isEqual["default"])((_b = prevProps === null || prevProps === void 0 ? void 0 : prevProps.tableProps) === null || _b === void 0 ? void 0 : _b.columns, (_d = (_c = this.props) === null || _c === void 0 ? void 0 : _c.tableProps) === null || _d === void 0 ? void 0 : _d.columns)) {
150
110
  this.props.tableProps && this.setSelfColumns();
151
111
  }
152
112
  }
153
113
  /**
154
114
  * 初始化columns, 给每个column加上是否显示的属性
155
115
  */
156
-
157
116
  }, {
158
117
  key: "setSelfColumns",
159
118
  value: function setSelfColumns() {
160
119
  var _a;
161
-
162
120
  if (! /*#__PURE__*/React.isValidElement((_a = this.props) === null || _a === void 0 ? void 0 : _a.tableProps)) {
163
121
  var _this$props$tableProp = this.props.tableProps,
164
- tableProps = _this$props$tableProp === void 0 ? {} : _this$props$tableProp;
122
+ tableProps = _this$props$tableProp === void 0 ? {} : _this$props$tableProp;
165
123
  var _tableProps$columns = tableProps.columns,
166
- columns = _tableProps$columns === void 0 ? [] : _tableProps$columns;
124
+ columns = _tableProps$columns === void 0 ? [] : _tableProps$columns;
167
125
  this.setState({
168
126
  selfColumns: columns.map(function (item) {
169
127
  return Object.assign(Object.assign({}, item), {
@@ -177,24 +135,20 @@ var Template = /*#__PURE__*/function (_Component) {
177
135
  key: "getPagination",
178
136
  value: function getPagination() {
179
137
  var _this$props$tableProp2 = this.props.tableProps,
180
- tableProps = _this$props$tableProp2 === void 0 ? {} : _this$props$tableProp2;
181
-
138
+ tableProps = _this$props$tableProp2 === void 0 ? {} : _this$props$tableProp2;
182
139
  if (! /*#__PURE__*/React.isValidElement(tableProps) && typeof (tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination) === 'boolean' && !(tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination)) {
183
140
  return true;
184
141
  }
185
-
186
142
  return false;
187
143
  }
188
144
  }, {
189
145
  key: "updateFilter",
190
146
  value: function updateFilter() {
191
147
  var _this2 = this;
192
-
193
148
  var _a;
194
-
195
149
  var pagination = this.state.pagination;
196
- var filter = (_a = this.filterRef) === null || _a === void 0 ? void 0 : _a.form.getFieldsValue(); // 更新查询条件并且把分页信息重置
197
-
150
+ var filter = (_a = this.filterRef) === null || _a === void 0 ? void 0 : _a.form.getFieldsValue();
151
+ // 更新查询条件并且把分页信息重置
198
152
  this.setState({
199
153
  filter: filter,
200
154
  pagination: this.getPagination() ? false : Object.assign(Object.assign({}, pagination), {
@@ -208,56 +162,48 @@ var Template = /*#__PURE__*/function (_Component) {
208
162
  }, {
209
163
  key: "requestDataSource",
210
164
  value: function requestDataSource(newPagination, newFilter) {
211
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
165
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee() {
212
166
  var getDataSource, filter, pagination, res, total, rows;
213
- return _regeneratorRuntime().wrap(function _callee$(_context) {
214
- while (1) {
215
- switch (_context.prev = _context.next) {
216
- case 0:
217
- getDataSource = this.props.getDataSource; // 从外面直接调
218
-
219
- filter = Object.assign(Object.assign({}, this.state.filter), newFilter);
220
- pagination = this.getPagination() ? false : Object.assign(Object.assign({}, this.state.pagination), newPagination);
221
- this.setState({
222
- loading: true
223
- });
224
- _context.prev = 4;
225
- _context.next = 7;
226
- return getDataSource(pagination, filter);
227
-
228
- case 7:
229
- res = _context.sent;
230
- total = res.total, rows = res.rows;
231
- this.setState({
232
- dataSource: rows,
233
- pagination: this.getPagination() ? false : Object.assign(Object.assign({}, pagination), {
234
- total: total
235
- })
236
- });
237
-
238
- case 10:
239
- _context.prev = 10;
240
- this.setState({
241
- loading: false,
242
- // 更新数据后, 清除选中的行
243
- selectedRows: [],
244
- selectedRowKeys: []
245
- });
246
- return _context.finish(10);
247
-
248
- case 13:
249
- case "end":
250
- return _context.stop();
251
- }
167
+ return _regenerator().w(function (_context) {
168
+ while (1) switch (_context.p = _context.n) {
169
+ case 0:
170
+ getDataSource = this.props.getDataSource; // 从外面直接调
171
+ filter = Object.assign(Object.assign({}, this.state.filter), newFilter);
172
+ pagination = this.getPagination() ? false : Object.assign(Object.assign({}, this.state.pagination), newPagination);
173
+ this.setState({
174
+ loading: true
175
+ });
176
+ _context.p = 1;
177
+ _context.n = 2;
178
+ return getDataSource(pagination, filter);
179
+ case 2:
180
+ res = _context.v;
181
+ total = res.total, rows = res.rows;
182
+ this.setState({
183
+ dataSource: rows,
184
+ pagination: this.getPagination() ? false : Object.assign(Object.assign({}, pagination), {
185
+ total: total
186
+ })
187
+ });
188
+ case 3:
189
+ _context.p = 3;
190
+ this.setState({
191
+ loading: false,
192
+ // 更新数据后, 清除选中的行
193
+ selectedRows: [],
194
+ selectedRowKeys: []
195
+ });
196
+ return _context.f(3);
197
+ case 4:
198
+ return _context.a(2);
252
199
  }
253
- }, _callee, this, [[4,, 10, 13]]);
200
+ }, _callee, this, [[1,, 3, 4]]);
254
201
  }));
255
202
  }
256
203
  }, {
257
204
  key: "setPagination",
258
205
  value: function setPagination(obj) {
259
206
  var _this3 = this;
260
-
261
207
  this.setState({
262
208
  pagination: this.getPagination() ? false : Object.assign(Object.assign({}, this.state.pagination), obj)
263
209
  }, function () {
@@ -276,46 +222,51 @@ var Template = /*#__PURE__*/function (_Component) {
276
222
  key: "render",
277
223
  value: function render() {
278
224
  var _this4 = this;
279
-
280
225
  var _this$state = this.state,
281
- filter = _this$state.filter,
282
- loading = _this$state.loading,
283
- dataSource = _this$state.dataSource,
284
- pagination = _this$state.pagination,
285
- selfColumns = _this$state.selfColumns,
286
- selectedRows = _this$state.selectedRows,
287
- selectedRowKeys = _this$state.selectedRowKeys,
288
- showExportLoading = _this$state.showExportLoading,
289
- showImport = _this$state.showImport;
226
+ filter = _this$state.filter,
227
+ loading = _this$state.loading,
228
+ dataSource = _this$state.dataSource,
229
+ pagination = _this$state.pagination,
230
+ selfColumns = _this$state.selfColumns,
231
+ selectedRows = _this$state.selectedRows,
232
+ selectedRowKeys = _this$state.selectedRowKeys,
233
+ showExportLoading = _this$state.showExportLoading,
234
+ showImport = _this$state.showImport;
290
235
  var _this$props = this.props,
291
- tableProps = _this$props.tableProps,
292
- actionProps = _this$props.actionProps,
293
- children = _this$props.children,
294
- _onReset = _this$props.onReset,
295
- statisticsProps = _this$props.statisticsProps,
296
- style = _this$props.style,
297
- showAll = _this$props.showAll,
298
- importErrorColumns = _this$props.importErrorColumns;
299
-
236
+ tableProps = _this$props.tableProps,
237
+ actionProps = _this$props.actionProps,
238
+ children = _this$props.children,
239
+ _onReset = _this$props.onReset,
240
+ statisticsProps = _this$props.statisticsProps,
241
+ style = _this$props.style,
242
+ showAll = _this$props.showAll,
243
+ importErrorColumns = _this$props.importErrorColumns;
300
244
  var _a = tableProps,
301
- _a$columns = _a.columns,
302
- columns = _a$columns === void 0 ? [] : _a$columns,
303
- _onRefresh = _a.onRefresh,
304
- tableRestProps = __rest(_a, ["columns", "onRefresh"]); // fix: 操作按钮里无法获取state
305
-
306
-
245
+ _a$columns = _a.columns,
246
+ columns = _a$columns === void 0 ? [] : _a$columns,
247
+ _onRefresh = _a.onRefresh,
248
+ tableRestProps = __rest(_a, ["columns", "onRefresh"]);
249
+ // fix: 操作按钮里无法获取state
307
250
  var columnsToShow = columns.map(function (item, index) {
308
251
  var _a;
309
-
310
252
  return Object.assign(Object.assign({}, item), {
311
253
  key: item.dataIndex || "".concat(index),
312
254
  isShow: (_a = selfColumns === null || selfColumns === void 0 ? void 0 : selfColumns[index]) === null || _a === void 0 ? void 0 : _a.isShow
313
255
  });
314
256
  });
257
+ var getTop = function getTop() {
258
+ if (statisticsProps && /*#__PURE__*/React.isValidElement(statisticsProps)) {
259
+ return 104;
260
+ } else if (children) {
261
+ return undefined;
262
+ } else {
263
+ return 0;
264
+ }
265
+ };
315
266
  return /*#__PURE__*/React.createElement("div", {
316
267
  className: "env-template",
317
268
  style: style
318
- }, /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement(_filter["default"], {
269
+ }, /*#__PURE__*/React.createElement(TableLayout.Page, null, children ? (/*#__PURE__*/React.createElement(TableLayout.Search, null, /*#__PURE__*/React.createElement(_filter["default"], {
319
270
  ref: function ref(_ref) {
320
271
  return _this4.filterRef = _ref;
321
272
  },
@@ -324,13 +275,21 @@ var Template = /*#__PURE__*/function (_Component) {
324
275
  },
325
276
  onReset: function onReset() {
326
277
  _this4.filterRef.form.resetFields();
327
-
328
278
  _onReset && _onReset();
329
-
330
279
  _this4.updateFilter();
331
280
  },
332
- showAll: showAll,
333
- buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
281
+ showAll: showAll
282
+ }, children))) : null, children ? (/*#__PURE__*/React.createElement(TableLayout.Content, null, /*#__PURE__*/React.createElement(TableLayout.Card, null, statisticsProps && /*#__PURE__*/React.isValidElement(statisticsProps) ? statisticsProps : null), /*#__PURE__*/React.createElement(TableLayout.Table, {
283
+ top: getTop()
284
+ }, tableProps && Object.prototype.toString.call(tableProps) === '[object Object]' && (! /*#__PURE__*/React.isValidElement(tableProps) ? (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'list' || !(tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) ? (/*#__PURE__*/React.createElement(_table["default"], Object.assign({
285
+ loading: loading,
286
+ bordered: tableProps === null || tableProps === void 0 ? void 0 : tableProps.bordered,
287
+ onRefresh: function onRefresh() {
288
+ _onRefresh ? _onRefresh() : _this4.requestDataSource();
289
+ },
290
+ rowKey: "id"
291
+ }, tableRestProps, {
292
+ buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
334
293
  dataSource: dataSource,
335
294
  filter: filter,
336
295
  selectRows: selectedRows,
@@ -356,92 +315,20 @@ var Template = /*#__PURE__*/function (_Component) {
356
315
  saveColumns: tableProps.saveColumns,
357
316
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
358
317
  isCardTheme: false
359
- })))
360
- }, children) : null, children ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableLayout.Card, null, statisticsProps && /*#__PURE__*/React.isValidElement(statisticsProps) ? statisticsProps : null), /*#__PURE__*/React.createElement(React.Fragment, null, tableProps && Object.prototype.toString.call(tableProps) === '[object Object]' && (! /*#__PURE__*/React.isValidElement(tableProps) ? (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'list' || !(tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) ? /*#__PURE__*/React.createElement(_table["default"], Object.assign({
361
- loading: loading,
362
- bordered: tableProps === null || tableProps === void 0 ? void 0 : tableProps.bordered,
363
- onRefresh: function onRefresh() {
364
- _onRefresh ? _onRefresh() : _this4.requestDataSource();
365
- },
366
- rowKey: "id"
367
- }, tableRestProps, {
368
- // buttonGroup={
369
- // actionProps
370
- // && Object.prototype.toString.call(
371
- // actionProps,
372
- // ) === '[object Object]' && (
373
- // <>
374
- // <Action
375
- // {...actionProps}
376
- // dataSource={
377
- // dataSource
378
- // }
379
- // filter={filter}
380
- // selectRows={
381
- // selectedRows
382
- // }
383
- // onSelectedRows={(
384
- // selectedRowKeys,
385
- // selectedRows,
386
- // ) => {
387
- // this.setState(
388
- // {
389
- // selectedRowKeys,
390
- // selectedRows,
391
- // },
392
- // );
393
- // }}
394
- // setShowExportLoading={(
395
- // showExportLoading: boolean,
396
- // ) => {
397
- // this.setState(
398
- // {
399
- // showExportLoading,
400
- // },
401
- // );
402
- // }}
403
- // setShowImport={(
404
- // showImport: boolean,
405
- // ) => {
406
- // this.setState(
407
- // {
408
- // showImport,
409
- // },
410
- // );
411
- // }}
412
- // requestDataSource={
413
- // this
414
- // .requestDataSource
415
- // }
416
- // {...{
417
- // columnsVisibility:
418
- // tableProps.columnsVisibility,
419
- // saveColumns:
420
- // tableProps.saveColumns,
421
- // selectable:
422
- // tableProps?.selectable,
423
- // isCardTheme: false,
424
- // }}
425
- // />
426
- // </>
427
- // )
428
- // }
318
+ })))),
429
319
  rowSelection: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable) ? Object.assign(Object.assign({
430
320
  selectedRowKeys: selectedRowKeys
431
321
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
432
322
  onChange: function onChange(selectedRowKeys, selectedRows) {
433
323
  var _a;
434
-
435
324
  _this4.setState({
436
325
  selectedRowKeys: selectedRowKeys,
437
326
  selectedRows: selectedRows
438
327
  });
439
-
440
328
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
441
329
  }
442
330
  }) : undefined,
443
331
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
444
- showSizeChanger: false,
445
332
  onChange: function onChange(current, pageSize) {
446
333
  _this4.setPagination({
447
334
  current: current,
@@ -452,8 +339,8 @@ var Template = /*#__PURE__*/function (_Component) {
452
339
  dataSource: tableProps.dataSource || dataSource,
453
340
  columns: columnsToShow,
454
341
  hideColumnSetting: typeof tableProps.columnsVisibility === 'boolean' ? !tableProps.columnsVisibility : false
455
- })) : (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'card' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_cardTable["default"], {
456
- buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
342
+ }))) : (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'card' ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_cardTable["default"], {
343
+ buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && (/*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
457
344
  dataSource: dataSource,
458
345
  filter: filter,
459
346
  selectRows: selectedRows,
@@ -479,9 +366,8 @@ var Template = /*#__PURE__*/function (_Component) {
479
366
  saveColumns: tableProps.saveColumns,
480
367
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
481
368
  isCardTheme: true
482
- })),
369
+ }))),
483
370
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
484
- showSizeChanger: false,
485
371
  onChange: function onChange(current, pageSize) {
486
372
  _this4.setPagination({
487
373
  current: current,
@@ -497,20 +383,20 @@ var Template = /*#__PURE__*/function (_Component) {
497
383
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
498
384
  onChange: function onChange(selectedRowKeys, selectedRows) {
499
385
  var _a;
500
-
501
386
  _this4.setState({
502
387
  selectedRowKeys: selectedRowKeys,
503
388
  selectedRows: selectedRows
504
389
  });
505
-
506
390
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
507
391
  }
508
392
  }) : undefined
509
- })) : /*#__PURE__*/React.createElement(React.Fragment, null) : /*#__PURE__*/React.createElement(React.Fragment, null, tableProps)))) : /*#__PURE__*/React.createElement(React.Fragment, null, tableProps && Object.prototype.toString.call(tableProps) === '[object Object]' && (! /*#__PURE__*/React.isValidElement(tableProps) ? (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'list' || !(tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) ? /*#__PURE__*/React.createElement(_table["default"], Object.assign({
393
+ }))) : (/*#__PURE__*/React.createElement(React.Fragment, null)) : (/*#__PURE__*/React.createElement(React.Fragment, null, tableProps)))))) : (/*#__PURE__*/React.createElement(TableLayout.Table, {
394
+ top: getTop()
395
+ }, tableProps && Object.prototype.toString.call(tableProps) === '[object Object]' && (! /*#__PURE__*/React.isValidElement(tableProps) ? (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'list' || !(tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) ? (/*#__PURE__*/React.createElement(_table["default"], Object.assign({
510
396
  loading: loading,
511
397
  bordered: tableProps === null || tableProps === void 0 ? void 0 : tableProps.bordered
512
398
  }, tableRestProps, {
513
- buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
399
+ buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
514
400
  dataSource: dataSource,
515
401
  filter: filter,
516
402
  selectRows: selectedRows,
@@ -536,24 +422,21 @@ var Template = /*#__PURE__*/function (_Component) {
536
422
  saveColumns: tableProps.saveColumns,
537
423
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
538
424
  isCardTheme: false
539
- }))),
425
+ })))),
540
426
  rowSelection: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable) ? Object.assign(Object.assign({
541
427
  selectedRowKeys: selectedRowKeys
542
428
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
543
429
  onChange: function onChange(selectedRowKeys, selectedRows) {
544
430
  var _a;
545
-
546
431
  _this4.setState({
547
432
  selectedRowKeys: selectedRowKeys,
548
433
  selectedRows: selectedRows
549
434
  });
550
-
551
435
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
552
436
  }
553
437
  }) : undefined,
554
438
  rowKey: "id",
555
439
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
556
- showSizeChanger: false,
557
440
  onChange: function onChange(current, pageSize) {
558
441
  _this4.setPagination({
559
442
  current: current,
@@ -567,8 +450,8 @@ var Template = /*#__PURE__*/function (_Component) {
567
450
  onRefresh: function onRefresh() {
568
451
  _onRefresh ? _onRefresh() : _this4.requestDataSource();
569
452
  }
570
- })) : (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'card' ? /*#__PURE__*/React.createElement(_cardTable["default"], {
571
- buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
453
+ }))) : (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'card' ? (/*#__PURE__*/React.createElement(_cardTable["default"], {
454
+ buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && (/*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
572
455
  dataSource: dataSource,
573
456
  filter: filter,
574
457
  selectRows: selectedRows,
@@ -594,9 +477,8 @@ var Template = /*#__PURE__*/function (_Component) {
594
477
  saveColumns: tableProps.saveColumns,
595
478
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
596
479
  isCardTheme: true
597
- })),
480
+ }))),
598
481
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
599
- showSizeChanger: false,
600
482
  onChange: function onChange(current, pageSize) {
601
483
  _this4.setPagination({
602
484
  current: current,
@@ -612,28 +494,26 @@ var Template = /*#__PURE__*/function (_Component) {
612
494
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
613
495
  onChange: function onChange(selectedRowKeys, selectedRows) {
614
496
  var _a;
615
-
616
497
  _this4.setState({
617
498
  selectedRowKeys: selectedRowKeys,
618
499
  selectedRows: selectedRows
619
500
  });
620
-
621
501
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
622
502
  }
623
503
  }) : undefined
624
- }) : /*#__PURE__*/React.createElement(React.Fragment, null) : /*#__PURE__*/React.createElement(React.Fragment, null, tableProps)))), showImport && /*#__PURE__*/React.createElement(_importModal["default"], {
504
+ })) : (/*#__PURE__*/React.createElement(React.Fragment, null)) : (/*#__PURE__*/React.createElement(React.Fragment, null, tableProps)))))), showImport && (/*#__PURE__*/React.createElement(_importModal["default"], {
505
+ errorKey: actionProps.importErrorKey || 'msg',
625
506
  onOk: function onOk() {
626
507
  _this4.setState({
627
508
  showImport: false
628
- }); // 刷新页面
629
-
630
-
509
+ });
510
+ // 刷新页面
631
511
  _this4.requestDataSource();
632
-
633
512
  actionProps.onImport && actionProps.onImport();
634
513
  },
635
514
  importUrl: actionProps.uploadUrl,
636
515
  templateSrc: actionProps.templateSrc,
516
+ operation: actionProps.operation,
637
517
  visible: showImport,
638
518
  onCancel: function onCancel() {
639
519
  _this4.setState({
@@ -641,20 +521,16 @@ var Template = /*#__PURE__*/function (_Component) {
641
521
  });
642
522
  },
643
523
  columns: importErrorColumns
644
- }), showExportLoading ? /*#__PURE__*/React.createElement(_antd.Spin, {
524
+ })), showExportLoading ? (/*#__PURE__*/React.createElement(_antd.Spin, {
645
525
  size: "large",
646
526
  tip: "\u5BFC\u51FA\u6587\u4EF6\u4E2D...",
647
527
  className: "env-template-action-loading"
648
- }) : null);
528
+ })) : null);
649
529
  }
650
530
  }]);
651
-
652
- return Template;
653
- }(React.Component);
654
-
531
+ }(_react.Component);
655
532
  Template.defaultProps = {
656
533
  autoRequest: true
657
534
  };
658
- var _default = Template;
659
- exports["default"] = _default;
535
+ var _default = exports["default"] = Template;
660
536
  //# sourceMappingURL=template.js.map