@pisell/materials 1.0.312 → 1.0.313
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.js +17 -17
- package/build/lowcode/view.js +16 -16
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +2 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +25 -5
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +1 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +33 -19
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.js +1 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +2 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +25 -5
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +29 -10
- package/es/components/table/Actions/component/ExportImport/index.js +15 -14
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/serve.js +11 -27
- package/es/locales/en-US.d.ts +2 -1
- package/es/locales/en-US.js +5 -2
- package/es/locales/zh-CN.d.ts +2 -1
- package/es/locales/zh-CN.js +4 -1
- package/es/locales/zh-TW.d.ts +2 -1
- package/es/locales/zh-TW.js +4 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +2 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +18 -5
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +1 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +18 -10
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.js +5 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +2 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +18 -5
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +9 -2
- package/lib/components/table/Actions/component/ExportImport/index.js +5 -5
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/serve.js +1 -1
- package/lib/locales/en-US.d.ts +2 -1
- package/lib/locales/en-US.js +3 -2
- package/lib/locales/zh-CN.d.ts +2 -1
- package/lib/locales/zh-CN.js +2 -1
- package/lib/locales/zh-TW.d.ts +2 -1
- package/lib/locales/zh-TW.js +2 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
|
|
|
5
5
|
className: string;
|
|
6
6
|
defaultCurrent: number;
|
|
7
7
|
showTotal: (total: number, range: [number, number]) => string;
|
|
8
|
-
itemRender: (page: number, type: "
|
|
8
|
+
itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
9
|
responsive: boolean;
|
|
10
10
|
size: string;
|
|
11
11
|
};
|
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -15,12 +21,10 @@ import { request } from "../../../../../utils";
|
|
|
15
21
|
import { formatDate } from "../../utils/date";
|
|
16
22
|
import download from "../../utils/download";
|
|
17
23
|
import "./index.less";
|
|
18
|
-
var
|
|
24
|
+
var defaultData = {
|
|
19
25
|
type: defaultOptions.exportValue,
|
|
20
26
|
skip: 1,
|
|
21
|
-
num: 10
|
|
22
|
-
// code: "company",
|
|
23
|
-
form_id: 720
|
|
27
|
+
num: 10
|
|
24
28
|
};
|
|
25
29
|
var exportstatusoptions = {
|
|
26
30
|
pending: getText("table-action-export-import-file-pending"),
|
|
@@ -28,13 +32,29 @@ var exportstatusoptions = {
|
|
|
28
32
|
completed: getText("table-action-export-import-file-completed"),
|
|
29
33
|
complete: getText("table-action-export-import-file-completed")
|
|
30
34
|
};
|
|
31
|
-
var ExportFile = function ExportFile() {
|
|
35
|
+
var ExportFile = function ExportFile(props) {
|
|
36
|
+
var formId = props.formId,
|
|
37
|
+
formCode = props.formCode;
|
|
32
38
|
var _useState = useState([]),
|
|
33
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
40
|
list = _useState2[0],
|
|
35
41
|
setList = _useState2[1];
|
|
42
|
+
var _useState3 = useState(defaultData),
|
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
+
defaultParams = _useState4[0],
|
|
45
|
+
setDefaultParams = _useState4[1];
|
|
36
46
|
var context = useEngineContext();
|
|
37
47
|
request.setRequest(context.appHelper.utils.request);
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
var params = {};
|
|
50
|
+
if (formId) {
|
|
51
|
+
params.form_id = formId;
|
|
52
|
+
}
|
|
53
|
+
if (formCode) {
|
|
54
|
+
params.code = formCode;
|
|
55
|
+
}
|
|
56
|
+
setDefaultParams(_objectSpread(_objectSpread({}, defaultParams), params));
|
|
57
|
+
}, [formId, formCode]);
|
|
38
58
|
|
|
39
59
|
/**
|
|
40
60
|
* @title: 导出文件
|
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const batchExport: (type: string,
|
|
1
|
+
export declare const batchExport: (type: string, exportImport: any) => Promise<true | undefined> | undefined;
|
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -4,33 +4,48 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
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
5
|
import { message } from "antd";
|
|
6
6
|
import { getText } from "../../../../../../../locales/index";
|
|
7
|
-
import { formIdExport } from "../../../../../serve";
|
|
7
|
+
import { formIdExport, formCodeExport } from "../../../../../serve";
|
|
8
8
|
import { defaultOptions } from "../../../../../status";
|
|
9
9
|
import { getFileDateName } from "../../utils/file";
|
|
10
10
|
// 导出接口
|
|
11
11
|
var _batchExport = /*#__PURE__*/function () {
|
|
12
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
13
|
-
var
|
|
12
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(idCode, params) {
|
|
13
|
+
var _res;
|
|
14
|
+
var formId, formCode, res;
|
|
14
15
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15
16
|
while (1) switch (_context.prev = _context.next) {
|
|
16
17
|
case 0:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
status = _yield$formIdExport.status;
|
|
22
|
-
if (!status) {
|
|
18
|
+
formId = idCode.formId, formCode = idCode.formCode;
|
|
19
|
+
res = null;
|
|
20
|
+
console.log(formCode, formId, 'wh77');
|
|
21
|
+
if (!formId) {
|
|
23
22
|
_context.next = 9;
|
|
24
23
|
break;
|
|
25
24
|
}
|
|
25
|
+
_context.next = 6;
|
|
26
|
+
return formIdExport(formId, params);
|
|
27
|
+
case 6:
|
|
28
|
+
res = _context.sent;
|
|
29
|
+
_context.next = 10;
|
|
30
|
+
break;
|
|
31
|
+
case 9:
|
|
32
|
+
if (formCode) {
|
|
33
|
+
res = formCodeExport(formCode, params);
|
|
34
|
+
}
|
|
35
|
+
case 10:
|
|
36
|
+
if (!((_res = res) !== null && _res !== void 0 && _res.status)) {
|
|
37
|
+
_context.next = 16;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
26
40
|
message.success({
|
|
27
41
|
content: getText("table-action-export-import-export-success"),
|
|
28
42
|
key: defaultOptions.exportValue
|
|
29
43
|
});
|
|
44
|
+
localStorage.setItem("dot", "true");
|
|
30
45
|
return _context.abrupt("return", true);
|
|
31
|
-
case
|
|
46
|
+
case 16:
|
|
32
47
|
message.destroy();
|
|
33
|
-
case
|
|
48
|
+
case 17:
|
|
34
49
|
case "end":
|
|
35
50
|
return _context.stop();
|
|
36
51
|
}
|
|
@@ -42,29 +57,28 @@ var _batchExport = /*#__PURE__*/function () {
|
|
|
42
57
|
}();
|
|
43
58
|
|
|
44
59
|
// 导出格式化
|
|
45
|
-
export var batchExport = function batchExport(type,
|
|
46
|
-
|
|
47
|
-
var form_id = "720";
|
|
60
|
+
export var batchExport = function batchExport(type, exportImport) {
|
|
61
|
+
var selectLists = exportImport.selectLists;
|
|
48
62
|
var _name = getFileDateName();
|
|
49
63
|
// 当前页面
|
|
50
64
|
if (type === defaultOptions.exportType) {
|
|
51
65
|
_name = "".concat(getText("table-action-export-import-current-page")).concat(_name);
|
|
52
|
-
return _batchExport(
|
|
53
|
-
ids:
|
|
66
|
+
return _batchExport(exportImport, {
|
|
67
|
+
ids: selectLists,
|
|
54
68
|
file_name: _name
|
|
55
69
|
});
|
|
56
70
|
}
|
|
57
71
|
// 所有记录
|
|
58
72
|
if (type === "all-records") {
|
|
59
73
|
_name = "".concat(getText("table-action-export-import-all-records")).concat(_name);
|
|
60
|
-
return _batchExport(
|
|
74
|
+
return _batchExport(exportImport, {
|
|
61
75
|
file_name: _name
|
|
62
76
|
});
|
|
63
77
|
}
|
|
64
78
|
// 所选记录
|
|
65
79
|
if (type === "selected-records") {
|
|
66
|
-
_name = "".concat(getText("table-action-export-import-selected-records"), "(").concat(getText("table-action-export-import-selected"), " ").concat(selectLists === null || selectLists === void 0 ? void 0 : selectLists.length
|
|
67
|
-
return _batchExport(
|
|
80
|
+
_name = "".concat(getText("table-action-export-import-selected-records"), "(").concat(getText("table-action-export-import-selected"), " ").concat(getText("table-action-export-import-item")(selectLists === null || selectLists === void 0 ? void 0 : selectLists.length), ") ").concat(_name);
|
|
81
|
+
return _batchExport(exportImport, {
|
|
68
82
|
ids: selectLists,
|
|
69
83
|
file_name: _name
|
|
70
84
|
});
|
|
@@ -36,6 +36,6 @@ var ExportTable = function ExportTable(props) {
|
|
|
36
36
|
}, getText("table-action-export-import-all-records")), /*#__PURE__*/React.createElement(Radio, {
|
|
37
37
|
value: "selected-records",
|
|
38
38
|
disabled: !(selectLists !== null && selectLists !== void 0 && selectLists.length)
|
|
39
|
-
}, getText("table-action-export-import-selected-records"), "
|
|
39
|
+
}, "".concat(getText("table-action-export-import-selected-records"), " (").concat(getText("table-action-export-import-selected"), " ").concat(getText("table-action-export-import-item")((selectLists === null || selectLists === void 0 ? void 0 : selectLists.length) || 0), ")")))));
|
|
40
40
|
};
|
|
41
41
|
export default ExportTable;
|
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -15,21 +21,35 @@ import { request } from "../../../../../utils";
|
|
|
15
21
|
import { formatDate } from "../../utils/date";
|
|
16
22
|
import Detail from "./Detail";
|
|
17
23
|
import "./index.less";
|
|
18
|
-
var
|
|
24
|
+
var defaultData = {
|
|
19
25
|
type: defaultOptions.importValue,
|
|
20
26
|
skip: 1,
|
|
21
|
-
num: 10
|
|
22
|
-
// code: "company",
|
|
23
|
-
form_id: 720
|
|
27
|
+
num: 10
|
|
24
28
|
};
|
|
25
|
-
var ImportLog = function ImportLog() {
|
|
29
|
+
var ImportLog = function ImportLog(props) {
|
|
30
|
+
var formId = props.formId,
|
|
31
|
+
formCode = props.formCode;
|
|
26
32
|
var detailRef = useRef(null);
|
|
27
33
|
var _useState = useState([]),
|
|
28
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
35
|
list = _useState2[0],
|
|
30
36
|
setList = _useState2[1];
|
|
37
|
+
var _useState3 = useState(defaultData),
|
|
38
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
+
defaultParams = _useState4[0],
|
|
40
|
+
setDefaultParams = _useState4[1];
|
|
31
41
|
var context = useEngineContext();
|
|
32
42
|
request.setRequest(context.appHelper.utils.request);
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
var params = {};
|
|
45
|
+
if (formId) {
|
|
46
|
+
params.form_id = formId;
|
|
47
|
+
}
|
|
48
|
+
if (formCode) {
|
|
49
|
+
params.code = formCode;
|
|
50
|
+
}
|
|
51
|
+
setDefaultParams(_objectSpread(_objectSpread({}, defaultParams), params));
|
|
52
|
+
}, [formId, formCode]);
|
|
33
53
|
|
|
34
54
|
/**
|
|
35
55
|
* @title: 导入日志
|
|
@@ -14,7 +14,7 @@ import React, { useMemo, useState } from "react";
|
|
|
14
14
|
import useEngineContext from "../../../../../../../hooks/useEngineContext";
|
|
15
15
|
import { getText } from "../../../../../../../locales/index";
|
|
16
16
|
import IconFont from "../../../../../../iconfont";
|
|
17
|
-
import { importFormIdTemplate } from "../../../../../serve";
|
|
17
|
+
import { importCodeTemplate, importFormIdTemplate } from "../../../../../serve";
|
|
18
18
|
import { defaultOptions } from "../../../../../status";
|
|
19
19
|
import { request } from "../../../../../utils";
|
|
20
20
|
import download from "../../utils/download";
|
|
@@ -24,6 +24,9 @@ var ImportTable = function ImportTable(props) {
|
|
|
24
24
|
var onChange = props.onChange,
|
|
25
25
|
exportImport = props.exportImport,
|
|
26
26
|
errorStatus = props.errorStatus;
|
|
27
|
+
var formId = exportImport.formId,
|
|
28
|
+
formCode = exportImport.formCode;
|
|
29
|
+
|
|
27
30
|
// 当前上传列表
|
|
28
31
|
var _useState = useState(null),
|
|
29
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -33,7 +36,8 @@ var ImportTable = function ImportTable(props) {
|
|
|
33
36
|
request.setRequest(context.appHelper.utils.request);
|
|
34
37
|
var handleDownload = /*#__PURE__*/function () {
|
|
35
38
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
36
|
-
var
|
|
39
|
+
var _res, _res$data;
|
|
40
|
+
var res;
|
|
37
41
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38
42
|
while (1) switch (_context.prev = _context.next) {
|
|
39
43
|
case 0:
|
|
@@ -41,18 +45,33 @@ var ImportTable = function ImportTable(props) {
|
|
|
41
45
|
content: "Loading...",
|
|
42
46
|
key: loadingKey
|
|
43
47
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
res = null;
|
|
49
|
+
if (!formId) {
|
|
50
|
+
_context.next = 8;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
_context.next = 5;
|
|
54
|
+
return importFormIdTemplate(formId);
|
|
55
|
+
case 5:
|
|
56
|
+
res = _context.sent;
|
|
57
|
+
_context.next = 12;
|
|
58
|
+
break;
|
|
59
|
+
case 8:
|
|
60
|
+
if (!formCode) {
|
|
61
|
+
_context.next = 12;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
_context.next = 11;
|
|
65
|
+
return importCodeTemplate(formCode);
|
|
66
|
+
case 11:
|
|
67
|
+
res = _context.sent;
|
|
68
|
+
case 12:
|
|
69
|
+
download((_res = res) === null || _res === void 0 ? void 0 : (_res$data = _res.data) === null || _res$data === void 0 ? void 0 : _res$data.url);
|
|
51
70
|
message.success({
|
|
52
71
|
content: getText("table-action-export-import-table-success-download"),
|
|
53
72
|
key: loadingKey
|
|
54
73
|
});
|
|
55
|
-
case
|
|
74
|
+
case 14:
|
|
56
75
|
case "end":
|
|
57
76
|
return _context.stop();
|
|
58
77
|
}
|
|
@@ -8,7 +8,7 @@ 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
|
|
11
|
+
import ImportExport from "@pisell/icon/es/ImportExport";
|
|
12
12
|
import { useRequest } from "ahooks";
|
|
13
13
|
import { Dropdown, Modal, message } from "antd";
|
|
14
14
|
import React, { useMemo, useState } from "react";
|
|
@@ -32,7 +32,9 @@ var Com = {
|
|
|
32
32
|
};
|
|
33
33
|
var ExportImport = function ExportImport(_ref) {
|
|
34
34
|
var exportImport = _ref.exportImport;
|
|
35
|
-
var selectLists = exportImport.selectLists
|
|
35
|
+
var selectLists = exportImport.selectLists,
|
|
36
|
+
formId = exportImport.formId,
|
|
37
|
+
formCode = exportImport.formCode;
|
|
36
38
|
var _useState = useState(false),
|
|
37
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
40
|
open = _useState2[0],
|
|
@@ -126,26 +128,24 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
126
128
|
});
|
|
127
129
|
var onOk = /*#__PURE__*/function () {
|
|
128
130
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
129
|
-
var
|
|
131
|
+
var result, formData;
|
|
130
132
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
131
133
|
while (1) switch (_context.prev = _context.next) {
|
|
132
134
|
case 0:
|
|
133
|
-
// 模拟数据
|
|
134
|
-
form_id = "720";
|
|
135
135
|
if (!(value === defaultOptions.exportValue)) {
|
|
136
|
-
_context.next =
|
|
136
|
+
_context.next = 7;
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
|
-
_context.next =
|
|
140
|
-
return batchExport(type,
|
|
141
|
-
case
|
|
139
|
+
_context.next = 3;
|
|
140
|
+
return batchExport(type, exportImport);
|
|
141
|
+
case 3:
|
|
142
142
|
result = _context.sent;
|
|
143
143
|
if (result) {
|
|
144
144
|
onCancel();
|
|
145
145
|
}
|
|
146
|
-
_context.next =
|
|
146
|
+
_context.next = 8;
|
|
147
147
|
break;
|
|
148
|
-
case
|
|
148
|
+
case 7:
|
|
149
149
|
if (value === defaultOptions.importValue) {
|
|
150
150
|
formData = new FormData();
|
|
151
151
|
formData.append("file", file);
|
|
@@ -159,7 +159,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
159
159
|
_batchImport.run(formData);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
case
|
|
162
|
+
case 8:
|
|
163
163
|
case "end":
|
|
164
164
|
return _context.stop();
|
|
165
165
|
}
|
|
@@ -178,10 +178,10 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
178
178
|
placement: "bottomRight"
|
|
179
179
|
}, /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
180
180
|
isActive: false
|
|
181
|
-
}, /*#__PURE__*/React.createElement(
|
|
181
|
+
}, /*#__PURE__*/React.createElement(ImportExport, {
|
|
182
182
|
style: {
|
|
183
183
|
cursor: "pointer",
|
|
184
|
-
fontSize:
|
|
184
|
+
fontSize: 20
|
|
185
185
|
}
|
|
186
186
|
}))), /*#__PURE__*/React.createElement(Modal, {
|
|
187
187
|
title: _title,
|
|
@@ -196,6 +196,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
196
196
|
},
|
|
197
197
|
destroyOnClose: true,
|
|
198
198
|
onOk: onOk,
|
|
199
|
+
cancelText: getText("table-action-export-import-cancel"),
|
|
199
200
|
okButtonProps: {
|
|
200
201
|
disabled: value === defaultOptions.importValue && (!file || !!errorStatus)
|
|
201
202
|
}
|
|
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
167
167
|
sort?: SortType | undefined;
|
|
168
168
|
mode: "" | "localStorage" | "remote";
|
|
169
169
|
currentViewMode: ModeType;
|
|
170
|
-
}) => ("
|
|
170
|
+
}) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
|
|
171
171
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
172
172
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
173
173
|
export {};
|
|
@@ -27,13 +27,20 @@ export var batchImport = function batchImport(params) {
|
|
|
27
27
|
return request.getRequest().post('/shop/form/data/import', params);
|
|
28
28
|
};
|
|
29
29
|
// 根据code导入模版
|
|
30
|
-
export var importCodeTemplate =
|
|
31
|
-
|
|
30
|
+
export var importCodeTemplate = function importCodeTemplate(code) {
|
|
31
|
+
return request.getRequest().get("/shop/form/data/download-template/code/".concat(code));
|
|
32
|
+
};
|
|
33
|
+
// 根据form_id导入模版
|
|
34
|
+
export var importFormIdTemplate = function importFormIdTemplate(form_id) {
|
|
35
|
+
return request.getRequest().get("/shop/form/data/download-template/id/".concat(form_id));
|
|
36
|
+
};
|
|
37
|
+
export var historyData = /*#__PURE__*/function () {
|
|
38
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
32
39
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
40
|
while (1) switch (_context.prev = _context.next) {
|
|
34
41
|
case 0:
|
|
35
42
|
_context.next = 2;
|
|
36
|
-
return request.getRequest().get(
|
|
43
|
+
return request.getRequest().get('/shop/form/data/task', params);
|
|
37
44
|
case 2:
|
|
38
45
|
return _context.abrupt("return", _context.sent);
|
|
39
46
|
case 3:
|
|
@@ -42,30 +49,7 @@ export var importCodeTemplate = /*#__PURE__*/function () {
|
|
|
42
49
|
}
|
|
43
50
|
}, _callee);
|
|
44
51
|
}));
|
|
45
|
-
return function
|
|
52
|
+
return function historyData(_x) {
|
|
46
53
|
return _ref.apply(this, arguments);
|
|
47
54
|
};
|
|
48
|
-
}();
|
|
49
|
-
// 根据form_id导入模版
|
|
50
|
-
export var importFormIdTemplate = function importFormIdTemplate(form_id) {
|
|
51
|
-
return request.getRequest().get("/shop/form/data/download-template/id/".concat(form_id));
|
|
52
|
-
};
|
|
53
|
-
export var historyData = /*#__PURE__*/function () {
|
|
54
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
55
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
56
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
57
|
-
case 0:
|
|
58
|
-
_context2.next = 2;
|
|
59
|
-
return request.getRequest().get('/shop/form/data/task', params);
|
|
60
|
-
case 2:
|
|
61
|
-
return _context2.abrupt("return", _context2.sent);
|
|
62
|
-
case 3:
|
|
63
|
-
case "end":
|
|
64
|
-
return _context2.stop();
|
|
65
|
-
}
|
|
66
|
-
}, _callee2);
|
|
67
|
-
}));
|
|
68
|
-
return function historyData(_x2) {
|
|
69
|
-
return _ref2.apply(this, arguments);
|
|
70
|
-
};
|
|
71
55
|
}();
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare const _default: {
|
|
|
57
57
|
'table-action-export-import-all-records': string;
|
|
58
58
|
'table-action-export-import-selected-records': string;
|
|
59
59
|
'table-action-export-import-selected': string;
|
|
60
|
-
'table-action-export-import-item': string;
|
|
60
|
+
'table-action-export-import-item': (length: number) => string;
|
|
61
61
|
'table-action-export-import-product': string;
|
|
62
62
|
'table-action-export-import-table-text-input-title': string;
|
|
63
63
|
'table-action-export-import-table-text-input-describe': string;
|
|
@@ -71,6 +71,7 @@ declare const _default: {
|
|
|
71
71
|
'table-action-export-import-table-text-click-download': string;
|
|
72
72
|
'table-action-export-import-table-text-edit-file': string;
|
|
73
73
|
'table-action-export-import-button-import': string;
|
|
74
|
+
'table-action-export-import-cancel': string;
|
|
74
75
|
'table-action-export-import-file-completed': string;
|
|
75
76
|
'table-action-export-import-file-processing': string;
|
|
76
77
|
'table-action-export-import-file-pending': string;
|
package/es/locales/en-US.js
CHANGED
|
@@ -65,10 +65,12 @@ export default {
|
|
|
65
65
|
'table-action-export-import-button': 'Export',
|
|
66
66
|
'table-action-export-import-export-range': 'Export Range',
|
|
67
67
|
'table-action-export-import-current-page': 'Current Page',
|
|
68
|
-
'table-action-export-import-all-records': 'All
|
|
68
|
+
'table-action-export-import-all-records': 'All Records',
|
|
69
69
|
'table-action-export-import-selected-records': 'Selected Records',
|
|
70
70
|
'table-action-export-import-selected': 'Selected',
|
|
71
|
-
'table-action-export-import-item':
|
|
71
|
+
'table-action-export-import-item': function tableActionExportImportItem(length) {
|
|
72
|
+
return "".concat(length, " ").concat(length > 1 ? 'items' : 'item');
|
|
73
|
+
},
|
|
72
74
|
'table-action-export-import-product': 'Export Products',
|
|
73
75
|
// 导入
|
|
74
76
|
'table-action-export-import-table-text-input-title': 'Click or drag file to this area to upload',
|
|
@@ -83,6 +85,7 @@ export default {
|
|
|
83
85
|
'table-action-export-import-table-text-click-download': 'Click to download',
|
|
84
86
|
'table-action-export-import-table-text-edit-file': 'Replace file',
|
|
85
87
|
'table-action-export-import-button-import': 'Import',
|
|
88
|
+
'table-action-export-import-cancel': 'Cancel',
|
|
86
89
|
'table-action-export-import-file-completed': 'completed',
|
|
87
90
|
'table-action-export-import-file-processing': 'processing',
|
|
88
91
|
'table-action-export-import-file-pending': 'pending',
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare const _default: {
|
|
|
57
57
|
'table-action-export-import-all-records': string;
|
|
58
58
|
'table-action-export-import-selected-records': string;
|
|
59
59
|
'table-action-export-import-selected': string;
|
|
60
|
-
'table-action-export-import-item': string;
|
|
60
|
+
'table-action-export-import-item': (length: number) => string;
|
|
61
61
|
'table-action-export-import-product': string;
|
|
62
62
|
'table-action-export-import-table-text-input-title': string;
|
|
63
63
|
'table-action-export-import-table-text-input-describe': string;
|
|
@@ -71,6 +71,7 @@ declare const _default: {
|
|
|
71
71
|
'table-action-export-import-table-text-click-download': string;
|
|
72
72
|
'table-action-export-import-table-text-edit-file': string;
|
|
73
73
|
'table-action-export-import-button-import': string;
|
|
74
|
+
'table-action-export-import-cancel': string;
|
|
74
75
|
'table-action-export-import-file-completed': string;
|
|
75
76
|
'table-action-export-import-file-processing': string;
|
|
76
77
|
'table-action-export-import-file-pending': string;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -68,7 +68,9 @@ export default {
|
|
|
68
68
|
'table-action-export-import-all-records': '所有记录',
|
|
69
69
|
'table-action-export-import-selected-records': '所选记录',
|
|
70
70
|
'table-action-export-import-selected': '已选',
|
|
71
|
-
'table-action-export-import-item':
|
|
71
|
+
'table-action-export-import-item': function tableActionExportImportItem(length) {
|
|
72
|
+
return "".concat(length, " \u6761");
|
|
73
|
+
},
|
|
72
74
|
'table-action-export-import-product': '导出商品',
|
|
73
75
|
// 导入
|
|
74
76
|
'table-action-export-import-table-text-input-title': '单击或拖动文件到该区域进行上传',
|
|
@@ -83,6 +85,7 @@ export default {
|
|
|
83
85
|
'table-action-export-import-table-text-click-download': '点击下载',
|
|
84
86
|
'table-action-export-import-table-text-edit-file': '替换文件',
|
|
85
87
|
'table-action-export-import-button-import': '导入',
|
|
88
|
+
'table-action-export-import-cancel': '取消',
|
|
86
89
|
'table-action-export-import-file-completed': '已完成',
|
|
87
90
|
'table-action-export-import-file-processing': '处理中',
|
|
88
91
|
'table-action-export-import-file-pending': '待处理',
|
package/es/locales/zh-TW.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare const _default: {
|
|
|
57
57
|
'table-action-export-import-all-records': string;
|
|
58
58
|
'table-action-export-import-selected-records': string;
|
|
59
59
|
'table-action-export-import-selected': string;
|
|
60
|
-
'table-action-export-import-item': string;
|
|
60
|
+
'table-action-export-import-item': (length: number) => string;
|
|
61
61
|
'table-action-export-import-product': string;
|
|
62
62
|
'table-action-export-import-table-text-input-title': string;
|
|
63
63
|
'table-action-export-import-table-text-input-describe': string;
|
|
@@ -71,6 +71,7 @@ declare const _default: {
|
|
|
71
71
|
'table-action-export-import-table-text-click-download': string;
|
|
72
72
|
'table-action-export-import-table-text-edit-file': string;
|
|
73
73
|
'table-action-export-import-button-import': string;
|
|
74
|
+
'table-action-export-import-cancel': string;
|
|
74
75
|
'table-action-export-import-file-completed': string;
|
|
75
76
|
'table-action-export-import-file-processing': string;
|
|
76
77
|
'table-action-export-import-file-pending': string;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -68,7 +68,9 @@ export default {
|
|
|
68
68
|
'table-action-export-import-all-records': '所有記錄',
|
|
69
69
|
'table-action-export-import-selected-records': '所選記錄',
|
|
70
70
|
'table-action-export-import-selected': '已選',
|
|
71
|
-
'table-action-export-import-item':
|
|
71
|
+
'table-action-export-import-item': function tableActionExportImportItem(length) {
|
|
72
|
+
return "".concat(length, " \u689D");
|
|
73
|
+
},
|
|
72
74
|
'table-action-export-import-product': '導出商品',
|
|
73
75
|
// 导入
|
|
74
76
|
'table-action-export-import-table-text-input-title': '單擊或拖動文件到該區域進行上傳',
|
|
@@ -83,6 +85,7 @@ export default {
|
|
|
83
85
|
'table-action-export-import-table-text-click-download': '點擊下載',
|
|
84
86
|
'table-action-export-import-table-text-edit-file': '替換文件',
|
|
85
87
|
'table-action-export-import-button-import': '導入',
|
|
88
|
+
'table-action-export-import-cancel': '取消',
|
|
86
89
|
'table-action-export-import-file-completed': '已完成',
|
|
87
90
|
'table-action-export-import-file-processing': '處理中',
|
|
88
91
|
'table-action-export-import-file-pending': '待處理',
|
|
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
|
|
|
5
5
|
className: string;
|
|
6
6
|
defaultCurrent: number;
|
|
7
7
|
showTotal: (total: number, range: [number, number]) => string;
|
|
8
|
-
itemRender: (page: number, type: "
|
|
8
|
+
itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
9
|
responsive: boolean;
|
|
10
10
|
size: string;
|
|
11
11
|
};
|