@pisell/materials 2.2.22 → 2.2.24
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +4 -4
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +13 -13
- package/es/components/filter/components/Dropdown/index.less +5 -0
- package/es/components/filter/components/FilterButton/index.js +2 -3
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +33 -48
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -9
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +28 -43
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +45 -44
- package/es/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/index.js +31 -22
- package/es/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
- package/es/components/table/Actions/component/ExportImport/utils/index.js +11 -0
- package/es/components/table/Actions/index.js +1 -1
- package/es/components/table/Actions/index.less +4 -1
- package/es/components/table/serve.d.ts +3 -1
- package/es/components/table/serve.js +71 -9
- package/es/components/table/types.d.ts +17 -4
- package/lib/components/filter/components/Dropdown/index.less +5 -0
- package/lib/components/filter/components/FilterButton/index.js +1 -2
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +9 -22
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +3 -8
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +9 -22
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +5 -8
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/index.js +12 -4
- package/lib/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
- package/lib/components/table/Actions/component/ExportImport/utils/index.js +31 -0
- package/lib/components/table/Actions/index.js +1 -1
- package/lib/components/table/Actions/index.less +4 -1
- package/lib/components/table/serve.d.ts +3 -1
- package/lib/components/table/serve.js +38 -6
- package/lib/components/table/types.d.ts +17 -4
- package/lowcode/table/meta.ts +35 -8
- package/lowcode/table/snippets.ts +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -8,9 +13,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
14
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import { InboxOutlined } from
|
|
12
|
-
import { Button, message } from
|
|
13
|
-
import React, { useMemo, useState } from
|
|
16
|
+
import { InboxOutlined } from '@ant-design/icons';
|
|
17
|
+
import { Button, message } from 'antd';
|
|
18
|
+
import React, { useMemo, useState } from 'react';
|
|
14
19
|
import useEngineContext from "../../../../../../../hooks/useEngineContext";
|
|
15
20
|
import { getText } from "../../../../../../../locales/index";
|
|
16
21
|
import IconFont from "../../../../../../iconfont";
|
|
@@ -24,9 +29,9 @@ var ImportTable = function ImportTable(props) {
|
|
|
24
29
|
var onChange = props.onChange,
|
|
25
30
|
exportImport = props.exportImport,
|
|
26
31
|
errorStatus = props.errorStatus;
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
var templateFileUrl = exportImport.templateFileUrl,
|
|
33
|
+
apiUrl = exportImport.apiUrl,
|
|
34
|
+
otherParams = exportImport.otherParams;
|
|
30
35
|
|
|
31
36
|
// 当前上传列表
|
|
32
37
|
var _useState = useState(null),
|
|
@@ -48,32 +53,28 @@ var ImportTable = function ImportTable(props) {
|
|
|
48
53
|
break;
|
|
49
54
|
}
|
|
50
55
|
download(templateFileUrl);
|
|
51
|
-
_context.next =
|
|
56
|
+
_context.next = 11;
|
|
52
57
|
break;
|
|
53
58
|
case 4:
|
|
54
59
|
message.loading({
|
|
55
|
-
content:
|
|
60
|
+
content: 'Loading...',
|
|
56
61
|
key: loadingKey
|
|
57
62
|
});
|
|
58
|
-
params = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (formCode) {
|
|
63
|
-
params.code = formCode;
|
|
64
|
-
}
|
|
65
|
-
_context.next = 10;
|
|
63
|
+
params = _objectSpread({
|
|
64
|
+
url: apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.template
|
|
65
|
+
}, otherParams);
|
|
66
|
+
_context.next = 8;
|
|
66
67
|
return importTemplate(params);
|
|
67
|
-
case
|
|
68
|
+
case 8:
|
|
68
69
|
_yield$importTemplate = _context.sent;
|
|
69
70
|
data = _yield$importTemplate.data;
|
|
70
71
|
download(data === null || data === void 0 ? void 0 : data.url);
|
|
71
|
-
case
|
|
72
|
+
case 11:
|
|
72
73
|
message.success({
|
|
73
|
-
content: getText(
|
|
74
|
+
content: getText('table-action-export-import-table-success-download'),
|
|
74
75
|
key: loadingKey
|
|
75
76
|
});
|
|
76
|
-
case
|
|
77
|
+
case 12:
|
|
77
78
|
case "end":
|
|
78
79
|
return _context.stop();
|
|
79
80
|
}
|
|
@@ -85,62 +86,62 @@ var ImportTable = function ImportTable(props) {
|
|
|
85
86
|
}();
|
|
86
87
|
var fileType = useMemo(function () {
|
|
87
88
|
if (file) {
|
|
88
|
-
return file.type.indexOf(
|
|
89
|
+
return file.type.indexOf('/csv') !== -1 ? 'csv' : 'excel';
|
|
89
90
|
}
|
|
90
|
-
return
|
|
91
|
+
return '';
|
|
91
92
|
}, [file]);
|
|
92
93
|
var fileName = useMemo(function () {
|
|
93
94
|
if (file) {
|
|
94
95
|
return file.name;
|
|
95
96
|
}
|
|
96
|
-
return
|
|
97
|
+
return '';
|
|
97
98
|
}, [file]);
|
|
98
99
|
var _handleSelectFile = function _handleSelectFile(e) {
|
|
99
100
|
var _e$target;
|
|
100
101
|
var _file = e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.files ? e.target.files[0] : null;
|
|
101
102
|
if (_file) {
|
|
102
|
-
if (_file.name.indexOf(
|
|
103
|
-
return message.error(getText(
|
|
103
|
+
if (_file.name.indexOf('.csv') === -1 && _file.name.indexOf('.xls') === -1 && _file.name.indexOf('.xlsx') === -1) {
|
|
104
|
+
return message.error(getText('table-action-export-import-table-error-file'));
|
|
104
105
|
}
|
|
105
106
|
onChange(_file);
|
|
106
107
|
setFile(_file);
|
|
107
108
|
}
|
|
108
109
|
};
|
|
109
110
|
return /*#__PURE__*/React.createElement(React.Fragment, null, errorStatus ? /*#__PURE__*/React.createElement("div", {
|
|
110
|
-
className:
|
|
111
|
+
className: 'error-hint'
|
|
111
112
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
112
113
|
type: "icontixingshixin",
|
|
113
|
-
className:
|
|
114
|
+
className: 'error-icon'
|
|
114
115
|
}), /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className:
|
|
116
|
+
className: 'text'
|
|
116
117
|
}, errorStatus)) : null, /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className:
|
|
118
|
-
}, getText(
|
|
118
|
+
className: 'import-title'
|
|
119
|
+
}, getText('table-action-export-import-table-text-click-download'), /*#__PURE__*/React.createElement("a", {
|
|
119
120
|
onClick: handleDownload
|
|
120
|
-
}, getText(
|
|
121
|
-
className:
|
|
121
|
+
}, getText('table-action-export-import-table-text-product-template'))), file ? /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: 'file-list'
|
|
122
123
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
123
|
-
type: fileType ===
|
|
124
|
-
className:
|
|
124
|
+
type: fileType === 'csv' ? 'icon-csv' : 'icon-excel',
|
|
125
|
+
className: 'file-icon'
|
|
125
126
|
}), /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className:
|
|
127
|
-
}, fileName), /*#__PURE__*/React.createElement(Button, null, getText(
|
|
127
|
+
className: 'file-name'
|
|
128
|
+
}, fileName), /*#__PURE__*/React.createElement(Button, null, getText('table-action-export-import-table-text-edit-file'), /*#__PURE__*/React.createElement("input", {
|
|
128
129
|
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
129
|
-
className:
|
|
130
|
+
className: 'upload-input',
|
|
130
131
|
type: "file",
|
|
131
132
|
onChange: _handleSelectFile,
|
|
132
133
|
value: ""
|
|
133
134
|
}))) : /*#__PURE__*/React.createElement("div", {
|
|
134
|
-
className:
|
|
135
|
+
className: 'default-view'
|
|
135
136
|
}, /*#__PURE__*/React.createElement("div", {
|
|
136
|
-
className:
|
|
137
|
+
className: 'icon-wrap'
|
|
137
138
|
}, /*#__PURE__*/React.createElement(InboxOutlined, null)), /*#__PURE__*/React.createElement("p", {
|
|
138
|
-
className:
|
|
139
|
-
}, getText(
|
|
140
|
-
className:
|
|
141
|
-
}, getText(
|
|
139
|
+
className: 'text'
|
|
140
|
+
}, getText('table-action-export-import-table-text-input-title')), /*#__PURE__*/React.createElement("p", {
|
|
141
|
+
className: 'hint'
|
|
142
|
+
}, getText('table-action-export-import-table-text-input-describe')), /*#__PURE__*/React.createElement("input", {
|
|
142
143
|
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
143
|
-
className:
|
|
144
|
+
className: 'upload-input',
|
|
144
145
|
type: "file",
|
|
145
146
|
onChange: _handleSelectFile,
|
|
146
147
|
value: ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExportImportType } from '../../../types';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare type ExportImportProps = {
|
|
5
5
|
exportImport: ExportImportType;
|
|
6
6
|
};
|
|
@@ -8,10 +8,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
9
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import ImportExport from
|
|
12
|
-
import { useRequest } from
|
|
13
|
-
import { Dropdown, Modal, message } from
|
|
14
|
-
import React, { useMemo, useState } from
|
|
11
|
+
import ImportExport from '@pisell/icon/es/ImportExport';
|
|
12
|
+
import { useRequest } from 'ahooks';
|
|
13
|
+
import { Dropdown, Modal, message } from 'antd';
|
|
14
|
+
import React, { useMemo, useState } from 'react';
|
|
15
15
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
16
16
|
import { getText } from "../../../../../locales/index";
|
|
17
17
|
import { batchImport } from "../../../serve";
|
|
@@ -48,7 +48,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
48
48
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
49
49
|
type = _useState6[0],
|
|
50
50
|
setType = _useState6[1];
|
|
51
|
-
var _useState7 = useState(
|
|
51
|
+
var _useState7 = useState(''),
|
|
52
52
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
53
53
|
value = _useState8[0],
|
|
54
54
|
setValue = _useState8[1];
|
|
@@ -63,18 +63,24 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
63
63
|
var context = useEngineContext();
|
|
64
64
|
request.setRequest((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.request);
|
|
65
65
|
var _items = useMemo(function () {
|
|
66
|
+
var _Object$entries$map;
|
|
66
67
|
// 将对象转成数组
|
|
67
|
-
var result = Object.entries(exportImportOptions).map(function (_ref2) {
|
|
68
|
+
var result = (_Object$entries$map = Object.entries(exportImportOptions).map(function (_ref2) {
|
|
69
|
+
var _exportImport$hiddenK;
|
|
68
70
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
69
71
|
key = _ref3[0],
|
|
70
72
|
value = _ref3[1];
|
|
73
|
+
// 如果开启了隐藏字段则不显示该字段
|
|
74
|
+
if (Array.isArray(exportImport === null || exportImport === void 0 ? void 0 : exportImport.hiddenKeys) && exportImport !== null && exportImport !== void 0 && (_exportImport$hiddenK = exportImport.hiddenKeys) !== null && _exportImport$hiddenK !== void 0 && _exportImport$hiddenK.includes(key)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
71
77
|
return {
|
|
72
78
|
key: key,
|
|
73
79
|
label: value
|
|
74
80
|
};
|
|
75
|
-
});
|
|
81
|
+
})) === null || _Object$entries$map === void 0 ? void 0 : _Object$entries$map.filter(Boolean);
|
|
76
82
|
return result;
|
|
77
|
-
}, []);
|
|
83
|
+
}, [exportImport === null || exportImport === void 0 ? void 0 : exportImport.hiddenKeys]);
|
|
78
84
|
var Content = useMemo(function () {
|
|
79
85
|
var _value = value || defaultOptions.importValue;
|
|
80
86
|
return Com[_value];
|
|
@@ -93,18 +99,18 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
93
99
|
if (!value) return null;
|
|
94
100
|
var types = defaultOptions.okShowButtonTypes;
|
|
95
101
|
var lang = getCurrentLocale();
|
|
96
|
-
var isEn = lang ===
|
|
102
|
+
var isEn = lang === 'en-US' || lang === 'en';
|
|
97
103
|
|
|
98
104
|
// 导出导入标题
|
|
99
105
|
if (types.includes(value) && exportImport !== null && exportImport !== void 0 && exportImport.title) {
|
|
100
|
-
return "".concat(exportImportOptions[value]).concat(isEn ?
|
|
106
|
+
return "".concat(exportImportOptions[value]).concat(isEn ? ' ' : '').concat(exportImport.title);
|
|
101
107
|
}
|
|
102
108
|
return exportImportOptions[value];
|
|
103
109
|
}, [value, exportImport === null || exportImport === void 0 ? void 0 : exportImport.title]);
|
|
104
110
|
var _okText = useMemo(function () {
|
|
105
111
|
var types = defaultOptions.okShowButtonTypes;
|
|
106
112
|
if (types.includes(value)) {
|
|
107
|
-
return value === defaultOptions.exportValue ? getText(
|
|
113
|
+
return value === defaultOptions.exportValue ? getText('table-action-export-import-button') : getText('table-action-export-import-button-import');
|
|
108
114
|
}
|
|
109
115
|
}, [value]);
|
|
110
116
|
var handleClick = function handleClick(e) {
|
|
@@ -114,7 +120,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
114
120
|
};
|
|
115
121
|
var onCancel = function onCancel() {
|
|
116
122
|
setOpen(false);
|
|
117
|
-
setValue(
|
|
123
|
+
setValue('');
|
|
118
124
|
setFile(null);
|
|
119
125
|
setErrorStatus(null);
|
|
120
126
|
setType(defaultOptions.exportType);
|
|
@@ -126,7 +132,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
126
132
|
setErrorStatus(null);
|
|
127
133
|
message.destroy();
|
|
128
134
|
message.success({
|
|
129
|
-
content: getText(
|
|
135
|
+
content: getText('table-action-export-import-import-success'),
|
|
130
136
|
key: value
|
|
131
137
|
});
|
|
132
138
|
onCancel();
|
|
@@ -138,11 +144,11 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
138
144
|
});
|
|
139
145
|
var onOk = /*#__PURE__*/function () {
|
|
140
146
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
141
|
-
var
|
|
147
|
+
var apiUrl, otherParams, _params, result, formData, formId, formCode;
|
|
142
148
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
143
149
|
while (1) switch (_context.prev = _context.next) {
|
|
144
150
|
case 0:
|
|
145
|
-
|
|
151
|
+
apiUrl = exportImport.apiUrl, otherParams = exportImport.otherParams; // 导出
|
|
146
152
|
if (!(value === defaultOptions.exportValue)) {
|
|
147
153
|
_context.next = 9;
|
|
148
154
|
break;
|
|
@@ -164,16 +170,19 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
164
170
|
case 9:
|
|
165
171
|
if (value === defaultOptions.importValue) {
|
|
166
172
|
formData = new FormData();
|
|
167
|
-
formData.append(
|
|
173
|
+
formData.append('file', file);
|
|
174
|
+
formId = otherParams === null || otherParams === void 0 ? void 0 : otherParams.form_id;
|
|
175
|
+
formCode = otherParams === null || otherParams === void 0 ? void 0 : otherParams.code;
|
|
168
176
|
if (formId) {
|
|
169
|
-
formData.append(
|
|
177
|
+
formData.append('form_id', formId);
|
|
170
178
|
}
|
|
171
179
|
if (formCode) {
|
|
172
|
-
formData.append(
|
|
180
|
+
formData.append('code', formCode);
|
|
173
181
|
}
|
|
182
|
+
formData.append('url', (apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.export) || '');
|
|
174
183
|
if (formData) {
|
|
175
184
|
message.loading({
|
|
176
|
-
content:
|
|
185
|
+
content: 'Loading...',
|
|
177
186
|
key: value
|
|
178
187
|
});
|
|
179
188
|
_batchImport.run(formData);
|
|
@@ -200,7 +209,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
200
209
|
isActive: false
|
|
201
210
|
}, /*#__PURE__*/React.createElement(ImportExport, {
|
|
202
211
|
style: {
|
|
203
|
-
cursor:
|
|
212
|
+
cursor: 'pointer',
|
|
204
213
|
fontSize: 20
|
|
205
214
|
}
|
|
206
215
|
}))), /*#__PURE__*/React.createElement(Modal, {
|
|
@@ -212,11 +221,11 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
212
221
|
className: "export-import-modal",
|
|
213
222
|
onCancel: onCancel,
|
|
214
223
|
bodyStyle: {
|
|
215
|
-
padding:
|
|
224
|
+
padding: '0px'
|
|
216
225
|
},
|
|
217
226
|
destroyOnClose: true,
|
|
218
227
|
onOk: onOk,
|
|
219
|
-
cancelText: getText(
|
|
228
|
+
cancelText: getText('table-action-export-import-cancel'),
|
|
220
229
|
okButtonProps: {
|
|
221
230
|
disabled: value === defaultOptions.importValue && (!file || !!errorStatus)
|
|
222
231
|
}
|
|
@@ -43,7 +43,7 @@ var Actions = function Actions(_ref) {
|
|
|
43
43
|
})), /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
className: "right-wrap",
|
|
45
45
|
style: {
|
|
46
|
-
|
|
46
|
+
columnGap: isMobileBool ? 0 : 12
|
|
47
47
|
}
|
|
48
48
|
}, view.multiple && /*#__PURE__*/React.createElement(Form.Item, {
|
|
49
49
|
name: "view_mode",
|
|
@@ -3,9 +3,11 @@ declare type exportParams = {
|
|
|
3
3
|
file_name?: string;
|
|
4
4
|
form_id?: string | number;
|
|
5
5
|
code?: string;
|
|
6
|
+
url?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const exportData: (params: exportParams) => Promise<any>;
|
|
8
9
|
export declare const batchImport: (params: any) => Promise<any>;
|
|
9
10
|
export declare const importTemplate: (params: exportParams) => Promise<any>;
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const getExportFile: (params: any) => Promise<any>;
|
|
12
|
+
export declare const getImportLog: (params: any) => Promise<any>;
|
|
11
13
|
export {};
|
|
@@ -2,37 +2,99 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
2
|
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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
10
|
import { request } from "./utils";
|
|
11
|
+
|
|
12
|
+
// 兜底api地址
|
|
13
|
+
var defaultUrl = {
|
|
14
|
+
export: '/shop/form/data/export',
|
|
15
|
+
import: '/shop/form/data/import',
|
|
16
|
+
export_file: '/shop/form/data/task?type=export',
|
|
17
|
+
import_log: '/shop/form/data/task?type=import',
|
|
18
|
+
template: '/shop/form/data/download-template'
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @title: 格式化接口地址参数
|
|
22
|
+
* @description:
|
|
23
|
+
* @param {any} params
|
|
24
|
+
* @return {*}
|
|
25
|
+
* @Author: WangHan
|
|
26
|
+
* @Date: 2024-09-05 12:01
|
|
27
|
+
*/
|
|
28
|
+
var formatApiParams = function formatApiParams(params, type) {
|
|
29
|
+
var _url = (params === null || params === void 0 ? void 0 : params.url) || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]);
|
|
30
|
+
var _params = _objectSpread({}, params);
|
|
31
|
+
delete _params.url;
|
|
32
|
+
return {
|
|
33
|
+
url: _url,
|
|
34
|
+
params: _objectSpread({}, _params)
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
6
38
|
// 导出
|
|
7
39
|
export var exportData = function exportData(params) {
|
|
8
|
-
|
|
40
|
+
var _params = formatApiParams(params, 'export');
|
|
41
|
+
return request.getRequest().post(_params === null || _params === void 0 ? void 0 : _params.url, _params === null || _params === void 0 ? void 0 : _params.params);
|
|
9
42
|
};
|
|
10
43
|
|
|
11
44
|
// 导入
|
|
12
45
|
export var batchImport = function batchImport(params) {
|
|
13
|
-
|
|
46
|
+
var _params = formatApiParams(params, 'import');
|
|
47
|
+
return request.getRequest().post(_params === null || _params === void 0 ? void 0 : _params.url, params);
|
|
14
48
|
};
|
|
15
49
|
|
|
16
50
|
// 导入模版
|
|
17
51
|
export var importTemplate = function importTemplate(params) {
|
|
18
|
-
|
|
52
|
+
var _params = formatApiParams(params, 'template');
|
|
53
|
+
return request.getRequest().post(_params === null || _params === void 0 ? void 0 : _params.url, _params === null || _params === void 0 ? void 0 : _params.params);
|
|
19
54
|
};
|
|
20
|
-
|
|
55
|
+
|
|
56
|
+
// 导出文件
|
|
57
|
+
export var getExportFile = /*#__PURE__*/function () {
|
|
21
58
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
59
|
+
var _params;
|
|
22
60
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
23
61
|
while (1) switch (_context.prev = _context.next) {
|
|
24
62
|
case 0:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return _context.abrupt("return", _context.sent);
|
|
63
|
+
_params = formatApiParams(params, 'export_file');
|
|
64
|
+
_context.next = 3;
|
|
65
|
+
return request.getRequest().get(_params === null || _params === void 0 ? void 0 : _params.url, _params === null || _params === void 0 ? void 0 : _params.params);
|
|
29
66
|
case 3:
|
|
67
|
+
return _context.abrupt("return", _context.sent);
|
|
68
|
+
case 4:
|
|
30
69
|
case "end":
|
|
31
70
|
return _context.stop();
|
|
32
71
|
}
|
|
33
72
|
}, _callee);
|
|
34
73
|
}));
|
|
35
|
-
return function
|
|
74
|
+
return function getExportFile(_x) {
|
|
36
75
|
return _ref.apply(this, arguments);
|
|
37
76
|
};
|
|
77
|
+
}();
|
|
78
|
+
|
|
79
|
+
// 导入日志
|
|
80
|
+
export var getImportLog = /*#__PURE__*/function () {
|
|
81
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
82
|
+
var _params;
|
|
83
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
84
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
85
|
+
case 0:
|
|
86
|
+
_params = formatApiParams(params, 'import_log');
|
|
87
|
+
_context2.next = 3;
|
|
88
|
+
return request.getRequest().get(_params === null || _params === void 0 ? void 0 : _params.url, _params === null || _params === void 0 ? void 0 : _params.params);
|
|
89
|
+
case 3:
|
|
90
|
+
return _context2.abrupt("return", _context2.sent);
|
|
91
|
+
case 4:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee2);
|
|
96
|
+
}));
|
|
97
|
+
return function getImportLog(_x2) {
|
|
98
|
+
return _ref2.apply(this, arguments);
|
|
99
|
+
};
|
|
38
100
|
}();
|
|
@@ -161,22 +161,35 @@ declare type SortDetail = {
|
|
|
161
161
|
};
|
|
162
162
|
/** 导入导出模式 */
|
|
163
163
|
export declare type ExportImportModeType = "import" | "export" | "export_file" | "import_log";
|
|
164
|
+
/**
|
|
165
|
+
* @title: 导出导入api
|
|
166
|
+
* @description:
|
|
167
|
+
* @return {*}
|
|
168
|
+
* @Author: WangHan
|
|
169
|
+
* @Date: 2024-09-11 15:44
|
|
170
|
+
*/
|
|
171
|
+
export declare type ApiProps = {
|
|
172
|
+
export?: string;
|
|
173
|
+
import?: string;
|
|
174
|
+
export_file: string;
|
|
175
|
+
import_log?: string;
|
|
176
|
+
template?: string;
|
|
177
|
+
};
|
|
164
178
|
/**
|
|
165
179
|
* 导入导出配置
|
|
166
180
|
*/
|
|
167
181
|
export declare type ExportImportType = {
|
|
168
182
|
/** 是否展示 */
|
|
169
183
|
show: boolean;
|
|
170
|
-
/** 表id */
|
|
171
|
-
formId?: string;
|
|
172
|
-
/** 表key */
|
|
173
|
-
formCode?: string;
|
|
174
184
|
/** 当前所选项 */
|
|
175
185
|
selectLists: string[];
|
|
176
186
|
/** 导入模版链接 */
|
|
177
187
|
templateFileUrl: string;
|
|
178
188
|
/** 标题 */
|
|
179
189
|
title: string;
|
|
190
|
+
hiddenKeys?: string[];
|
|
191
|
+
apiUrl?: ApiProps;
|
|
192
|
+
otherParams?: any;
|
|
180
193
|
};
|
|
181
194
|
export declare type GridViewProps = {
|
|
182
195
|
columns: any;
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
[role="status"] {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
48
|
.filter-dropdown-container-wrap {
|
|
45
49
|
border-bottom: 1px solid var(--surface-surface-4, #e2e2e2);
|
|
@@ -73,4 +77,5 @@
|
|
|
73
77
|
.filter-dropdown-container-filter-wrap {
|
|
74
78
|
min-height: 80px;
|
|
75
79
|
}
|
|
80
|
+
|
|
76
81
|
}
|
|
@@ -73,8 +73,7 @@ var Filter = ({
|
|
|
73
73
|
content,
|
|
74
74
|
arrow: false,
|
|
75
75
|
getPopupContainer: () => ref.current,
|
|
76
|
-
|
|
77
|
-
transitionName: "test"
|
|
76
|
+
trigger: ["click"]
|
|
78
77
|
},
|
|
79
78
|
/* @__PURE__ */ import_react.default.createElement(import_antd.Button, { icon: /* @__PURE__ */ import_react.default.createElement(import_FilterLines.default, null), size: "large" }, isMobileBool ? null : (0, import_locales.getText)("table-action-filter-button"))
|
|
80
79
|
));
|