@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.
- package/README.md +46 -46
- package/lib/b-map/b-map.d.ts +1 -1
- package/lib/b-map/b-map.js +100 -162
- package/lib/b-map/b-map.js.map +1 -1
- package/lib/b-map/custom-overlay.js +17 -37
- package/lib/b-map/custom-overlay.js.map +1 -1
- package/lib/b-map/drawing.js +11 -25
- package/lib/b-map/drawing.js.map +1 -1
- package/lib/b-map/index.d.ts +2 -2
- package/lib/b-map/index.js +4 -16
- package/lib/b-map/index.js.map +1 -1
- package/lib/b-map/js/marker-clusterer.js +223 -339
- package/lib/b-map/js/marker-clusterer.js.map +1 -1
- package/lib/b-map/lushu.js +17 -36
- package/lib/b-map/lushu.js.map +1 -1
- package/lib/b-map/marker-clusterer.js +6 -14
- package/lib/b-map/marker-clusterer.js.map +1 -1
- package/lib/b-map/marker.js +32 -70
- package/lib/b-map/marker.js.map +1 -1
- package/lib/b-map/polygon.js +5 -13
- package/lib/b-map/polygon.js.map +1 -1
- package/lib/b-map/style/css.js.map +1 -1
- package/lib/b-map/style/index.js.map +1 -1
- package/lib/b-map/style/index.less +10 -10
- package/lib/create-modal/create-modal.js +150 -288
- package/lib/create-modal/create-modal.js.map +1 -1
- package/lib/create-modal/index.d.ts +1 -2
- package/lib/create-modal/index.js +2 -8
- package/lib/create-modal/index.js.map +1 -1
- package/lib/create-modal/style/css.js +0 -18
- package/lib/create-modal/style/css.js.map +1 -1
- package/lib/create-modal/style/index.css +2 -2
- package/lib/create-modal/style/index.d.ts +0 -9
- package/lib/create-modal/style/index.js +0 -18
- package/lib/create-modal/style/index.js.map +1 -1
- package/lib/create-modal/style/index.less +116 -119
- package/lib/global.less +5 -6
- package/lib/import-modal/import-modal.d.ts +2 -0
- package/lib/import-modal/import-modal.js +133 -192
- package/lib/import-modal/import-modal.js.map +1 -1
- package/lib/import-modal/index.js +2 -6
- package/lib/import-modal/index.js.map +1 -1
- package/lib/import-modal/style/css.js +0 -10
- package/lib/import-modal/style/css.js.map +1 -1
- package/lib/import-modal/style/index.d.ts +0 -5
- package/lib/import-modal/style/index.js +0 -10
- package/lib/import-modal/style/index.js.map +1 -1
- package/lib/import-modal/style/index.less +14 -15
- package/lib/index.js +1 -14
- package/lib/index.js.map +1 -1
- package/lib/interface/index.js.map +1 -1
- package/lib/mapv-Layer/Function.js +0 -2
- package/lib/mapv-Layer/Function.js.map +1 -1
- package/lib/mapv-Layer/index.js +2 -6
- package/lib/mapv-Layer/index.js.map +1 -1
- package/lib/mapv-Layer/mapv-Layer.js +19 -40
- package/lib/mapv-Layer/mapv-Layer.js.map +1 -1
- package/lib/mapv-Layer/style/css.js.map +1 -1
- package/lib/mapv-Layer/style/index.js.map +1 -1
- package/lib/percent/index.d.ts +1 -1
- package/lib/percent/index.js +2 -7
- package/lib/percent/index.js.map +1 -1
- package/lib/percent/interface.js.map +1 -1
- package/lib/percent/line-percent.js +20 -37
- package/lib/percent/line-percent.js.map +1 -1
- package/lib/percent/percent.js +20 -43
- package/lib/percent/percent.js.map +1 -1
- package/lib/percent/style/css.js.map +1 -1
- package/lib/percent/style/index.js.map +1 -1
- package/lib/percent/style/index.less +41 -41
- package/lib/scroll/index.js +2 -6
- package/lib/scroll/index.js.map +1 -1
- package/lib/scroll/scroll.d.ts +1 -1
- package/lib/scroll/scroll.js +19 -47
- package/lib/scroll/scroll.js.map +1 -1
- package/lib/scroll/style/css.js.map +1 -1
- package/lib/scroll/style/index.js.map +1 -1
- package/lib/scroll/style/index.less +3 -3
- package/lib/scroll-select/index.js +2 -6
- package/lib/scroll-select/index.js.map +1 -1
- package/lib/scroll-select/scrollSelect.d.ts +2 -1
- package/lib/scroll-select/scrollSelect.js +141 -215
- package/lib/scroll-select/scrollSelect.js.map +1 -1
- package/lib/scroll-select/style/css.js +0 -2
- package/lib/scroll-select/style/css.js.map +1 -1
- package/lib/scroll-select/style/index.d.ts +0 -1
- package/lib/scroll-select/style/index.js +0 -2
- package/lib/scroll-select/style/index.js.map +1 -1
- package/lib/scroll-select/style/index.less +7 -7
- package/lib/style/color.less +1 -1
- package/lib/table/index.js +2 -6
- package/lib/table/index.js.map +1 -1
- package/lib/table/style/css.js +0 -2
- package/lib/table/style/css.js.map +1 -1
- package/lib/table/style/index.d.ts +0 -1
- package/lib/table/style/index.js +0 -2
- package/lib/table/style/index.js.map +1 -1
- package/lib/table/table.js +22 -54
- package/lib/table/table.js.map +1 -1
- package/lib/template/action.d.ts +3 -1
- package/lib/template/action.js +80 -116
- package/lib/template/action.js.map +1 -1
- package/lib/template/card-table.d.ts +4 -4
- package/lib/template/card-table.js +40 -82
- package/lib/template/card-table.js.map +1 -1
- package/lib/template/card.d.ts +1 -1
- package/lib/template/card.js +20 -38
- package/lib/template/card.js.map +1 -1
- package/lib/template/check-row.d.ts +2 -1
- package/lib/template/check-row.js +7 -12
- package/lib/template/check-row.js.map +1 -1
- package/lib/template/field.js +8 -24
- package/lib/template/field.js.map +1 -1
- package/lib/template/filter.d.ts +0 -1
- package/lib/template/filter.js +25 -63
- package/lib/template/filter.js.map +1 -1
- package/lib/template/icon.js +4 -15
- package/lib/template/icon.js.map +1 -1
- package/lib/template/index.d.ts +2 -3
- package/lib/template/index.js +4 -12
- package/lib/template/index.js.map +1 -1
- package/lib/template/interface.js.map +1 -1
- package/lib/template/renderColumnButtons.js +64 -95
- package/lib/template/renderColumnButtons.js.map +1 -1
- package/lib/template/style/action.css +3 -2
- package/lib/template/style/action.less +74 -71
- package/lib/template/style/card.css +2 -2
- package/lib/template/style/card.less +87 -88
- package/lib/template/style/check-row.less +27 -27
- package/lib/template/style/css.js +0 -36
- package/lib/template/style/css.js.map +1 -1
- package/lib/template/style/field.less +11 -11
- package/lib/template/style/filter.css +0 -29
- package/lib/template/style/filter.less +46 -72
- package/lib/template/style/icon.less +7 -7
- package/lib/template/style/index.css +8 -42
- package/lib/template/style/index.d.ts +0 -18
- package/lib/template/style/index.js +0 -36
- package/lib/template/style/index.js.map +1 -1
- package/lib/template/style/index.less +48 -49
- package/lib/template/style/table.css +0 -6
- package/lib/template/style/table.less +79 -91
- package/lib/template/table.d.ts +5 -4
- package/lib/template/table.js +21 -43
- package/lib/template/table.js.map +1 -1
- package/lib/template/template.d.ts +3 -3
- package/lib/template/template.js +134 -258
- package/lib/template/template.js.map +1 -1
- package/lib/template/toolbar.d.ts +1 -1
- package/lib/template/toolbar.js +52 -56
- package/lib/template/toolbar.js.map +1 -1
- package/lib/to-map/container.js +48 -95
- package/lib/to-map/container.js.map +1 -1
- package/lib/to-map/draw-area.js +12 -32
- package/lib/to-map/draw-area.js.map +1 -1
- package/lib/to-map/index.d.ts +1 -1
- package/lib/to-map/index.js +2 -7
- package/lib/to-map/index.js.map +1 -1
- package/lib/to-map/style/css.js +0 -2
- package/lib/to-map/style/css.js.map +1 -1
- package/lib/to-map/style/index.d.ts +0 -1
- package/lib/to-map/style/index.js +0 -2
- package/lib/to-map/style/index.js.map +1 -1
- package/lib/to-map/style/index.less +86 -86
- package/lib/to-map/to-map.js +20 -47
- package/lib/to-map/to-map.js.map +1 -1
- package/lib/upload/index.js +2 -6
- package/lib/upload/index.js.map +1 -1
- package/lib/upload/style/css.js +0 -5
- package/lib/upload/style/css.js.map +1 -1
- package/lib/upload/style/index.d.ts +0 -2
- package/lib/upload/style/index.js +0 -5
- package/lib/upload/style/index.js.map +1 -1
- package/lib/upload/upload.d.ts +3 -0
- package/lib/upload/upload.js +158 -237
- package/lib/upload/upload.js.map +1 -1
- package/lib/use-simple-res/demos/index.d.ts +2 -1
- package/lib/use-simple-res/demos/index.js +31 -59
- package/lib/use-simple-res/demos/index.js.map +1 -1
- package/lib/use-simple-res/index.js +60 -73
- package/lib/use-simple-res/index.js.map +1 -1
- package/lib/use-simple-res/style/css.js.map +1 -1
- package/lib/use-simple-res/style/index.js.map +1 -1
- package/lib/utils/dom-util.js +8 -27
- package/lib/utils/dom-util.js.map +1 -1
- package/lib/utils/request-util.d.ts +10 -1
- package/lib/utils/request-util.js +170 -45
- package/lib/utils/request-util.js.map +1 -1
- package/lib/utils/string-util.d.ts +2 -0
- package/lib/utils/string-util.js +34 -16
- package/lib/utils/string-util.js.map +1 -1
- package/lib/view-modal/index.d.ts +0 -1
- package/lib/view-modal/index.js +2 -8
- package/lib/view-modal/index.js.map +1 -1
- package/lib/view-modal/style/css.js +0 -12
- package/lib/view-modal/style/css.js.map +1 -1
- package/lib/view-modal/style/index.css +3 -41
- package/lib/view-modal/style/index.d.ts +0 -7
- package/lib/view-modal/style/index.js +0 -12
- package/lib/view-modal/style/index.js.map +1 -1
- package/lib/view-modal/style/index.less +42 -57
- package/lib/view-modal/view-modal.js +28 -75
- package/lib/view-modal/view-modal.js.map +1 -1
- package/package.json +157 -143
- package/lib/style/css.js +0 -13
- package/lib/style/css.js.map +0 -1
- package/lib/style/darkGreen.css +0 -719
- package/lib/style/darkGreen.less +0 -482
- package/lib/style/index.d.ts +0 -2
- package/lib/style/index.js +0 -13
- package/lib/style/index.js.map +0 -1
- package/lib/template/vtx-search/index.d.ts +0 -2
- package/lib/template/vtx-search/index.js +0 -126
- package/lib/template/vtx-search/index.js.map +0 -1
- package/lib/template/vtx-search/style/index.css +0 -92
- package/lib/template/vtx-search/style/index.less +0 -92
package/lib/template/template.js
CHANGED
|
@@ -1,65 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
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 =
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
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
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
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(
|
|
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
|
-
}
|
|
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
|
-
|
|
122
|
+
tableProps = _this$props$tableProp === void 0 ? {} : _this$props$tableProp;
|
|
165
123
|
var _tableProps$columns = tableProps.columns,
|
|
166
|
-
|
|
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
|
-
|
|
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__*/
|
|
165
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee() {
|
|
212
166
|
var getDataSource, filter, pagination, res, total, rows;
|
|
213
|
-
return
|
|
214
|
-
while (1) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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, [[
|
|
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
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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(
|
|
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
|
-
|
|
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))))
|
|
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
|