@vortex-ui/env-puzzle 2.0.0-beta.8 → 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 (198) hide show
  1. package/lib/b-map/b-map.d.ts +1 -1
  2. package/lib/b-map/b-map.js +100 -162
  3. package/lib/b-map/b-map.js.map +1 -1
  4. package/lib/b-map/custom-overlay.js +17 -37
  5. package/lib/b-map/custom-overlay.js.map +1 -1
  6. package/lib/b-map/drawing.js +11 -25
  7. package/lib/b-map/drawing.js.map +1 -1
  8. package/lib/b-map/index.d.ts +2 -2
  9. package/lib/b-map/index.js +4 -16
  10. package/lib/b-map/index.js.map +1 -1
  11. package/lib/b-map/js/marker-clusterer.js +42 -158
  12. package/lib/b-map/js/marker-clusterer.js.map +1 -1
  13. package/lib/b-map/lushu.js +17 -36
  14. package/lib/b-map/lushu.js.map +1 -1
  15. package/lib/b-map/marker-clusterer.js +6 -14
  16. package/lib/b-map/marker-clusterer.js.map +1 -1
  17. package/lib/b-map/marker.js +32 -70
  18. package/lib/b-map/marker.js.map +1 -1
  19. package/lib/b-map/polygon.js +5 -13
  20. package/lib/b-map/polygon.js.map +1 -1
  21. package/lib/b-map/style/css.js.map +1 -1
  22. package/lib/b-map/style/index.js.map +1 -1
  23. package/lib/create-modal/create-modal.js +149 -287
  24. package/lib/create-modal/create-modal.js.map +1 -1
  25. package/lib/create-modal/index.d.ts +1 -2
  26. package/lib/create-modal/index.js +2 -8
  27. package/lib/create-modal/index.js.map +1 -1
  28. package/lib/create-modal/style/css.js +0 -18
  29. package/lib/create-modal/style/css.js.map +1 -1
  30. package/lib/create-modal/style/index.css +2 -2
  31. package/lib/create-modal/style/index.d.ts +0 -9
  32. package/lib/create-modal/style/index.js +0 -18
  33. package/lib/create-modal/style/index.js.map +1 -1
  34. package/lib/create-modal/style/index.less +21 -27
  35. package/lib/global.less +0 -6
  36. package/lib/import-modal/import-modal.d.ts +2 -0
  37. package/lib/import-modal/import-modal.js +133 -192
  38. package/lib/import-modal/import-modal.js.map +1 -1
  39. package/lib/import-modal/index.js +2 -6
  40. package/lib/import-modal/index.js.map +1 -1
  41. package/lib/import-modal/style/css.js +0 -10
  42. package/lib/import-modal/style/css.js.map +1 -1
  43. package/lib/import-modal/style/index.d.ts +0 -5
  44. package/lib/import-modal/style/index.js +0 -10
  45. package/lib/import-modal/style/index.js.map +1 -1
  46. package/lib/import-modal/style/index.less +0 -1
  47. package/lib/index.js +1 -14
  48. package/lib/index.js.map +1 -1
  49. package/lib/interface/index.js.map +1 -1
  50. package/lib/mapv-Layer/Function.js +0 -2
  51. package/lib/mapv-Layer/Function.js.map +1 -1
  52. package/lib/mapv-Layer/index.js +2 -6
  53. package/lib/mapv-Layer/index.js.map +1 -1
  54. package/lib/mapv-Layer/mapv-Layer.js +19 -40
  55. package/lib/mapv-Layer/mapv-Layer.js.map +1 -1
  56. package/lib/mapv-Layer/style/css.js.map +1 -1
  57. package/lib/mapv-Layer/style/index.js.map +1 -1
  58. package/lib/percent/index.d.ts +1 -1
  59. package/lib/percent/index.js +2 -7
  60. package/lib/percent/index.js.map +1 -1
  61. package/lib/percent/interface.js.map +1 -1
  62. package/lib/percent/line-percent.js +20 -37
  63. package/lib/percent/line-percent.js.map +1 -1
  64. package/lib/percent/percent.js +20 -43
  65. package/lib/percent/percent.js.map +1 -1
  66. package/lib/percent/style/css.js.map +1 -1
  67. package/lib/percent/style/index.js.map +1 -1
  68. package/lib/scroll/index.js +2 -6
  69. package/lib/scroll/index.js.map +1 -1
  70. package/lib/scroll/scroll.d.ts +1 -1
  71. package/lib/scroll/scroll.js +19 -47
  72. package/lib/scroll/scroll.js.map +1 -1
  73. package/lib/scroll/style/css.js.map +1 -1
  74. package/lib/scroll/style/index.js.map +1 -1
  75. package/lib/scroll-select/index.js +2 -6
  76. package/lib/scroll-select/index.js.map +1 -1
  77. package/lib/scroll-select/scrollSelect.d.ts +2 -1
  78. package/lib/scroll-select/scrollSelect.js +141 -215
  79. package/lib/scroll-select/scrollSelect.js.map +1 -1
  80. package/lib/scroll-select/style/css.js +0 -2
  81. package/lib/scroll-select/style/css.js.map +1 -1
  82. package/lib/scroll-select/style/index.d.ts +0 -1
  83. package/lib/scroll-select/style/index.js +0 -2
  84. package/lib/scroll-select/style/index.js.map +1 -1
  85. package/lib/table/index.js +2 -6
  86. package/lib/table/index.js.map +1 -1
  87. package/lib/table/style/css.js +0 -2
  88. package/lib/table/style/css.js.map +1 -1
  89. package/lib/table/style/index.d.ts +0 -1
  90. package/lib/table/style/index.js +0 -2
  91. package/lib/table/style/index.js.map +1 -1
  92. package/lib/table/table.js +22 -54
  93. package/lib/table/table.js.map +1 -1
  94. package/lib/template/action.d.ts +3 -1
  95. package/lib/template/action.js +80 -116
  96. package/lib/template/action.js.map +1 -1
  97. package/lib/template/card-table.d.ts +4 -4
  98. package/lib/template/card-table.js +40 -82
  99. package/lib/template/card-table.js.map +1 -1
  100. package/lib/template/card.d.ts +1 -1
  101. package/lib/template/card.js +20 -38
  102. package/lib/template/card.js.map +1 -1
  103. package/lib/template/check-row.d.ts +2 -1
  104. package/lib/template/check-row.js +7 -12
  105. package/lib/template/check-row.js.map +1 -1
  106. package/lib/template/field.js +8 -24
  107. package/lib/template/field.js.map +1 -1
  108. package/lib/template/filter.js +19 -54
  109. package/lib/template/filter.js.map +1 -1
  110. package/lib/template/icon.js +4 -15
  111. package/lib/template/icon.js.map +1 -1
  112. package/lib/template/index.d.ts +2 -3
  113. package/lib/template/index.js +4 -12
  114. package/lib/template/index.js.map +1 -1
  115. package/lib/template/interface.js.map +1 -1
  116. package/lib/template/renderColumnButtons.js +62 -93
  117. package/lib/template/renderColumnButtons.js.map +1 -1
  118. package/lib/template/style/action.css +3 -2
  119. package/lib/template/style/action.less +10 -7
  120. package/lib/template/style/card.css +2 -2
  121. package/lib/template/style/card.less +2 -3
  122. package/lib/template/style/css.js +0 -36
  123. package/lib/template/style/css.js.map +1 -1
  124. package/lib/template/style/index.css +8 -13
  125. package/lib/template/style/index.d.ts +0 -18
  126. package/lib/template/style/index.js +0 -36
  127. package/lib/template/style/index.js.map +1 -1
  128. package/lib/template/style/index.less +3 -4
  129. package/lib/template/style/table.css +0 -6
  130. package/lib/template/style/table.less +6 -11
  131. package/lib/template/table.d.ts +5 -4
  132. package/lib/template/table.js +19 -37
  133. package/lib/template/table.js.map +1 -1
  134. package/lib/template/template.d.ts +2 -2
  135. package/lib/template/template.js +115 -193
  136. package/lib/template/template.js.map +1 -1
  137. package/lib/template/toolbar.d.ts +1 -1
  138. package/lib/template/toolbar.js +52 -56
  139. package/lib/template/toolbar.js.map +1 -1
  140. package/lib/to-map/container.js +48 -95
  141. package/lib/to-map/container.js.map +1 -1
  142. package/lib/to-map/draw-area.js +12 -32
  143. package/lib/to-map/draw-area.js.map +1 -1
  144. package/lib/to-map/index.d.ts +1 -1
  145. package/lib/to-map/index.js +2 -7
  146. package/lib/to-map/index.js.map +1 -1
  147. package/lib/to-map/style/css.js +0 -2
  148. package/lib/to-map/style/css.js.map +1 -1
  149. package/lib/to-map/style/index.d.ts +0 -1
  150. package/lib/to-map/style/index.js +0 -2
  151. package/lib/to-map/style/index.js.map +1 -1
  152. package/lib/to-map/to-map.js +20 -47
  153. package/lib/to-map/to-map.js.map +1 -1
  154. package/lib/upload/index.js +2 -6
  155. package/lib/upload/index.js.map +1 -1
  156. package/lib/upload/style/css.js +0 -5
  157. package/lib/upload/style/css.js.map +1 -1
  158. package/lib/upload/style/index.d.ts +0 -2
  159. package/lib/upload/style/index.js +0 -5
  160. package/lib/upload/style/index.js.map +1 -1
  161. package/lib/upload/upload.d.ts +3 -0
  162. package/lib/upload/upload.js +158 -237
  163. package/lib/upload/upload.js.map +1 -1
  164. package/lib/use-simple-res/demos/index.d.ts +2 -1
  165. package/lib/use-simple-res/demos/index.js +31 -59
  166. package/lib/use-simple-res/demos/index.js.map +1 -1
  167. package/lib/use-simple-res/index.js +60 -73
  168. package/lib/use-simple-res/index.js.map +1 -1
  169. package/lib/use-simple-res/style/css.js.map +1 -1
  170. package/lib/use-simple-res/style/index.js.map +1 -1
  171. package/lib/utils/dom-util.js +8 -27
  172. package/lib/utils/dom-util.js.map +1 -1
  173. package/lib/utils/request-util.d.ts +10 -1
  174. package/lib/utils/request-util.js +170 -45
  175. package/lib/utils/request-util.js.map +1 -1
  176. package/lib/utils/string-util.d.ts +2 -0
  177. package/lib/utils/string-util.js +34 -16
  178. package/lib/utils/string-util.js.map +1 -1
  179. package/lib/view-modal/index.d.ts +0 -1
  180. package/lib/view-modal/index.js +2 -8
  181. package/lib/view-modal/index.js.map +1 -1
  182. package/lib/view-modal/style/css.js +0 -12
  183. package/lib/view-modal/style/css.js.map +1 -1
  184. package/lib/view-modal/style/index.css +3 -41
  185. package/lib/view-modal/style/index.d.ts +0 -7
  186. package/lib/view-modal/style/index.js +0 -12
  187. package/lib/view-modal/style/index.js.map +1 -1
  188. package/lib/view-modal/style/index.less +3 -18
  189. package/lib/view-modal/view-modal.js +28 -75
  190. package/lib/view-modal/view-modal.js.map +1 -1
  191. package/package.json +37 -23
  192. package/lib/style/css.js +0 -13
  193. package/lib/style/css.js.map +0 -1
  194. package/lib/style/darkGreen.css +0 -631
  195. package/lib/style/darkGreen.less +0 -370
  196. package/lib/style/index.d.ts +0 -2
  197. package/lib/style/index.js +0 -13
  198. package/lib/style/index.js.map +0 -1
@@ -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,43 +222,38 @@ 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
  });
315
-
316
257
  var getTop = function getTop() {
317
258
  if (statisticsProps && /*#__PURE__*/React.isValidElement(statisticsProps)) {
318
259
  return 104;
@@ -322,11 +263,10 @@ var Template = /*#__PURE__*/function (_Component) {
322
263
  return 0;
323
264
  }
324
265
  };
325
-
326
266
  return /*#__PURE__*/React.createElement("div", {
327
267
  className: "env-template",
328
268
  style: style
329
- }, /*#__PURE__*/React.createElement(TableLayout.Page, null, children ? /*#__PURE__*/React.createElement(TableLayout.Search, null, /*#__PURE__*/React.createElement(_filter["default"], {
269
+ }, /*#__PURE__*/React.createElement(TableLayout.Page, null, children ? (/*#__PURE__*/React.createElement(TableLayout.Search, null, /*#__PURE__*/React.createElement(_filter["default"], {
330
270
  ref: function ref(_ref) {
331
271
  return _this4.filterRef = _ref;
332
272
  },
@@ -335,15 +275,13 @@ var Template = /*#__PURE__*/function (_Component) {
335
275
  },
336
276
  onReset: function onReset() {
337
277
  _this4.filterRef.form.resetFields();
338
-
339
278
  _onReset && _onReset();
340
-
341
279
  _this4.updateFilter();
342
280
  },
343
281
  showAll: showAll
344
- }, 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, {
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, {
345
283
  top: getTop()
346
- }, 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({
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({
347
285
  loading: loading,
348
286
  bordered: tableProps === null || tableProps === void 0 ? void 0 : tableProps.bordered,
349
287
  onRefresh: function onRefresh() {
@@ -351,7 +289,7 @@ var Template = /*#__PURE__*/function (_Component) {
351
289
  },
352
290
  rowKey: "id"
353
291
  }, tableRestProps, {
354
- buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
292
+ buttonGroup: actionProps && Object.prototype.toString.call(actionProps) === '[object Object]' && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_action["default"], Object.assign({}, actionProps, {
355
293
  dataSource: dataSource,
356
294
  filter: filter,
357
295
  selectRows: selectedRows,
@@ -377,23 +315,20 @@ var Template = /*#__PURE__*/function (_Component) {
377
315
  saveColumns: tableProps.saveColumns,
378
316
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
379
317
  isCardTheme: false
380
- }))),
318
+ })))),
381
319
  rowSelection: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable) ? Object.assign(Object.assign({
382
320
  selectedRowKeys: selectedRowKeys
383
321
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
384
322
  onChange: function onChange(selectedRowKeys, selectedRows) {
385
323
  var _a;
386
-
387
324
  _this4.setState({
388
325
  selectedRowKeys: selectedRowKeys,
389
326
  selectedRows: selectedRows
390
327
  });
391
-
392
328
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
393
329
  }
394
330
  }) : undefined,
395
331
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
396
- showSizeChanger: false,
397
332
  onChange: function onChange(current, pageSize) {
398
333
  _this4.setPagination({
399
334
  current: current,
@@ -404,8 +339,8 @@ var Template = /*#__PURE__*/function (_Component) {
404
339
  dataSource: tableProps.dataSource || dataSource,
405
340
  columns: columnsToShow,
406
341
  hideColumnSetting: typeof tableProps.columnsVisibility === 'boolean' ? !tableProps.columnsVisibility : false
407
- })) : (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'card' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_cardTable["default"], {
408
- 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, {
409
344
  dataSource: dataSource,
410
345
  filter: filter,
411
346
  selectRows: selectedRows,
@@ -431,9 +366,8 @@ var Template = /*#__PURE__*/function (_Component) {
431
366
  saveColumns: tableProps.saveColumns,
432
367
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
433
368
  isCardTheme: true
434
- })),
369
+ }))),
435
370
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
436
- showSizeChanger: false,
437
371
  onChange: function onChange(current, pageSize) {
438
372
  _this4.setPagination({
439
373
  current: current,
@@ -449,22 +383,20 @@ var Template = /*#__PURE__*/function (_Component) {
449
383
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
450
384
  onChange: function onChange(selectedRowKeys, selectedRows) {
451
385
  var _a;
452
-
453
386
  _this4.setState({
454
387
  selectedRowKeys: selectedRowKeys,
455
388
  selectedRows: selectedRows
456
389
  });
457
-
458
390
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
459
391
  }
460
392
  }) : undefined
461
- })) : /*#__PURE__*/React.createElement(React.Fragment, null) : /*#__PURE__*/React.createElement(React.Fragment, null, tableProps)))) : /*#__PURE__*/React.createElement(TableLayout.Table, {
393
+ }))) : (/*#__PURE__*/React.createElement(React.Fragment, null)) : (/*#__PURE__*/React.createElement(React.Fragment, null, tableProps)))))) : (/*#__PURE__*/React.createElement(TableLayout.Table, {
462
394
  top: getTop()
463
- }, 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({
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({
464
396
  loading: loading,
465
397
  bordered: tableProps === null || tableProps === void 0 ? void 0 : tableProps.bordered
466
398
  }, tableRestProps, {
467
- 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, {
468
400
  dataSource: dataSource,
469
401
  filter: filter,
470
402
  selectRows: selectedRows,
@@ -490,24 +422,21 @@ var Template = /*#__PURE__*/function (_Component) {
490
422
  saveColumns: tableProps.saveColumns,
491
423
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
492
424
  isCardTheme: false
493
- }))),
425
+ })))),
494
426
  rowSelection: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable) ? Object.assign(Object.assign({
495
427
  selectedRowKeys: selectedRowKeys
496
428
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
497
429
  onChange: function onChange(selectedRowKeys, selectedRows) {
498
430
  var _a;
499
-
500
431
  _this4.setState({
501
432
  selectedRowKeys: selectedRowKeys,
502
433
  selectedRows: selectedRows
503
434
  });
504
-
505
435
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
506
436
  }
507
437
  }) : undefined,
508
438
  rowKey: "id",
509
439
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
510
- showSizeChanger: false,
511
440
  onChange: function onChange(current, pageSize) {
512
441
  _this4.setPagination({
513
442
  current: current,
@@ -521,8 +450,8 @@ var Template = /*#__PURE__*/function (_Component) {
521
450
  onRefresh: function onRefresh() {
522
451
  _onRefresh ? _onRefresh() : _this4.requestDataSource();
523
452
  }
524
- })) : (tableProps === null || tableProps === void 0 ? void 0 : tableProps.theme) === 'card' ? /*#__PURE__*/React.createElement(_cardTable["default"], {
525
- 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, {
526
455
  dataSource: dataSource,
527
456
  filter: filter,
528
457
  selectRows: selectedRows,
@@ -548,9 +477,8 @@ var Template = /*#__PURE__*/function (_Component) {
548
477
  saveColumns: tableProps.saveColumns,
549
478
  selectable: tableProps === null || tableProps === void 0 ? void 0 : tableProps.selectable,
550
479
  isCardTheme: true
551
- })),
480
+ }))),
552
481
  pagination: this.getPagination() ? false : Object.assign(Object.assign(Object.assign({}, pagination), tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination), {
553
- showSizeChanger: false,
554
482
  onChange: function onChange(current, pageSize) {
555
483
  _this4.setPagination({
556
484
  current: current,
@@ -566,28 +494,26 @@ var Template = /*#__PURE__*/function (_Component) {
566
494
  }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection), {
567
495
  onChange: function onChange(selectedRowKeys, selectedRows) {
568
496
  var _a;
569
-
570
497
  _this4.setState({
571
498
  selectedRowKeys: selectedRowKeys,
572
499
  selectedRows: selectedRows
573
500
  });
574
-
575
501
  (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection) === null || _a === void 0 ? void 0 : _a.onChange(selectedRowKeys, selectedRows);
576
502
  }
577
503
  }) : undefined
578
- }) : /*#__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',
579
506
  onOk: function onOk() {
580
507
  _this4.setState({
581
508
  showImport: false
582
- }); // 刷新页面
583
-
584
-
509
+ });
510
+ // 刷新页面
585
511
  _this4.requestDataSource();
586
-
587
512
  actionProps.onImport && actionProps.onImport();
588
513
  },
589
514
  importUrl: actionProps.uploadUrl,
590
515
  templateSrc: actionProps.templateSrc,
516
+ operation: actionProps.operation,
591
517
  visible: showImport,
592
518
  onCancel: function onCancel() {
593
519
  _this4.setState({
@@ -595,20 +521,16 @@ var Template = /*#__PURE__*/function (_Component) {
595
521
  });
596
522
  },
597
523
  columns: importErrorColumns
598
- }), showExportLoading ? /*#__PURE__*/React.createElement(_antd.Spin, {
524
+ })), showExportLoading ? (/*#__PURE__*/React.createElement(_antd.Spin, {
599
525
  size: "large",
600
526
  tip: "\u5BFC\u51FA\u6587\u4EF6\u4E2D...",
601
527
  className: "env-template-action-loading"
602
- }) : null);
528
+ })) : null);
603
529
  }
604
530
  }]);
605
-
606
- return Template;
607
- }(React.Component);
608
-
531
+ }(_react.Component);
609
532
  Template.defaultProps = {
610
533
  autoRequest: true
611
534
  };
612
- var _default = Template;
613
- exports["default"] = _default;
535
+ var _default = exports["default"] = Template;
614
536
  //# sourceMappingURL=template.js.map