@pisell/materials 1.0.313 → 1.0.314
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- 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 +30 -39
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +14 -23
- package/es/components/table/Actions/component/ExportImport/index.js +15 -14
- package/es/components/table/serve.d.ts +3 -5
- package/es/components/table/serve.js +5 -22
- 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 -22
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +7 -4
- package/lib/components/table/Actions/component/ExportImport/index.js +8 -2
- package/lib/components/table/serve.d.ts +3 -5
- package/lib/components/table/serve.js +4 -18
- package/package.json +1 -1
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const batchExport: (type: string, exportImport: any) => Promise<true | undefined
|
|
1
|
+
export declare const batchExport: (type: string, exportImport: any) => Promise<true | undefined>;
|
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -4,37 +4,23 @@ 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 {
|
|
7
|
+
import { exportData } 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
|
|
14
|
-
var formId, formCode, res;
|
|
12
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
13
|
+
var _yield$exportData, status;
|
|
15
14
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16
15
|
while (1) switch (_context.prev = _context.next) {
|
|
17
16
|
case 0:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
17
|
+
_context.next = 2;
|
|
18
|
+
return exportData(params);
|
|
19
|
+
case 2:
|
|
20
|
+
_yield$exportData = _context.sent;
|
|
21
|
+
status = _yield$exportData.status;
|
|
22
|
+
if (!status) {
|
|
23
|
+
_context.next = 10;
|
|
38
24
|
break;
|
|
39
25
|
}
|
|
40
26
|
message.success({
|
|
@@ -43,44 +29,49 @@ var _batchExport = /*#__PURE__*/function () {
|
|
|
43
29
|
});
|
|
44
30
|
localStorage.setItem("dot", "true");
|
|
45
31
|
return _context.abrupt("return", true);
|
|
46
|
-
case
|
|
32
|
+
case 10:
|
|
47
33
|
message.destroy();
|
|
48
|
-
case
|
|
34
|
+
case 11:
|
|
49
35
|
case "end":
|
|
50
36
|
return _context.stop();
|
|
51
37
|
}
|
|
52
38
|
}, _callee);
|
|
53
39
|
}));
|
|
54
|
-
return function _batchExport(_x
|
|
40
|
+
return function _batchExport(_x) {
|
|
55
41
|
return _ref.apply(this, arguments);
|
|
56
42
|
};
|
|
57
43
|
}();
|
|
58
44
|
|
|
59
45
|
// 导出格式化
|
|
60
46
|
export var batchExport = function batchExport(type, exportImport) {
|
|
61
|
-
var selectLists = exportImport.selectLists
|
|
47
|
+
var selectLists = exportImport.selectLists,
|
|
48
|
+
formId = exportImport.formId,
|
|
49
|
+
formCode = exportImport.formCode;
|
|
62
50
|
var _name = getFileDateName();
|
|
51
|
+
var params = {};
|
|
52
|
+
if (formId) {
|
|
53
|
+
params.form_id = formId;
|
|
54
|
+
}
|
|
55
|
+
if (formCode) {
|
|
56
|
+
params.code = formCode;
|
|
57
|
+
}
|
|
58
|
+
if (type === defaultOptions.exportType || type === "selected-records") {
|
|
59
|
+
params.ids = selectLists || [];
|
|
60
|
+
}
|
|
63
61
|
// 当前页面
|
|
64
62
|
if (type === defaultOptions.exportType) {
|
|
65
63
|
_name = "".concat(getText("table-action-export-import-current-page")).concat(_name);
|
|
66
|
-
|
|
67
|
-
ids: selectLists,
|
|
68
|
-
file_name: _name
|
|
69
|
-
});
|
|
64
|
+
params.file_name = _name;
|
|
70
65
|
}
|
|
71
66
|
// 所有记录
|
|
72
67
|
if (type === "all-records") {
|
|
73
68
|
_name = "".concat(getText("table-action-export-import-all-records")).concat(_name);
|
|
74
|
-
|
|
75
|
-
file_name: _name
|
|
76
|
-
});
|
|
69
|
+
params.file_name = _name;
|
|
77
70
|
}
|
|
78
71
|
// 所选记录
|
|
79
72
|
if (type === "selected-records") {
|
|
80
73
|
_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
|
-
|
|
82
|
-
ids: selectLists,
|
|
83
|
-
file_name: _name
|
|
84
|
-
});
|
|
74
|
+
params.file_name = _name;
|
|
85
75
|
}
|
|
76
|
+
return _batchExport(params);
|
|
86
77
|
};
|
|
@@ -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 {
|
|
17
|
+
import { importTemplate } from "../../../../../serve";
|
|
18
18
|
import { defaultOptions } from "../../../../../status";
|
|
19
19
|
import { request } from "../../../../../utils";
|
|
20
20
|
import download from "../../utils/download";
|
|
@@ -36,42 +36,33 @@ var ImportTable = function ImportTable(props) {
|
|
|
36
36
|
request.setRequest(context.appHelper.utils.request);
|
|
37
37
|
var handleDownload = /*#__PURE__*/function () {
|
|
38
38
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
39
|
-
var _res
|
|
40
|
-
var res;
|
|
39
|
+
var _res$data;
|
|
40
|
+
var params, res;
|
|
41
41
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
42
42
|
while (1) switch (_context.prev = _context.next) {
|
|
43
43
|
case 0:
|
|
44
|
+
console.log("wh_export", exportImport);
|
|
44
45
|
message.loading({
|
|
45
46
|
content: "Loading...",
|
|
46
47
|
key: loadingKey
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
break;
|
|
49
|
+
params = {};
|
|
50
|
+
if (formId) {
|
|
51
|
+
params.form_id = formId;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
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;
|
|
53
|
+
if (formCode) {
|
|
54
|
+
params.code = formCode;
|
|
63
55
|
}
|
|
64
|
-
_context.next =
|
|
65
|
-
return
|
|
66
|
-
case
|
|
56
|
+
_context.next = 7;
|
|
57
|
+
return importTemplate(params);
|
|
58
|
+
case 7:
|
|
67
59
|
res = _context.sent;
|
|
68
|
-
|
|
69
|
-
download((_res = res) === null || _res === void 0 ? void 0 : (_res$data = _res.data) === null || _res$data === void 0 ? void 0 : _res$data.url);
|
|
60
|
+
download(res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.url);
|
|
70
61
|
message.success({
|
|
71
62
|
content: getText("table-action-export-import-table-success-download"),
|
|
72
63
|
key: loadingKey
|
|
73
64
|
});
|
|
74
|
-
case
|
|
65
|
+
case 10:
|
|
75
66
|
case "end":
|
|
76
67
|
return _context.stop();
|
|
77
68
|
}
|
|
@@ -32,9 +32,6 @@ var Com = {
|
|
|
32
32
|
};
|
|
33
33
|
var ExportImport = function ExportImport(_ref) {
|
|
34
34
|
var exportImport = _ref.exportImport;
|
|
35
|
-
var selectLists = exportImport.selectLists,
|
|
36
|
-
formId = exportImport.formId,
|
|
37
|
-
formCode = exportImport.formCode;
|
|
38
35
|
var _useState = useState(false),
|
|
39
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
40
37
|
open = _useState2[0],
|
|
@@ -117,10 +114,9 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
117
114
|
content: getText("table-action-export-import-import-success"),
|
|
118
115
|
key: value
|
|
119
116
|
});
|
|
117
|
+
localStorage.setItem("dot", "true");
|
|
120
118
|
onCancel();
|
|
121
|
-
// localStorage.setItem("dot", "true");
|
|
122
119
|
},
|
|
123
|
-
|
|
124
120
|
onError: function onError(err) {
|
|
125
121
|
message.destroy();
|
|
126
122
|
setErrorStatus((err === null || err === void 0 ? void 0 : err.message) || null);
|
|
@@ -128,29 +124,34 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
128
124
|
});
|
|
129
125
|
var onOk = /*#__PURE__*/function () {
|
|
130
126
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
131
|
-
var result, formData;
|
|
127
|
+
var formId, formCode, result, formData;
|
|
132
128
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
133
129
|
while (1) switch (_context.prev = _context.next) {
|
|
134
130
|
case 0:
|
|
131
|
+
formId = exportImport.formId, formCode = exportImport.formCode; // 导出
|
|
135
132
|
if (!(value === defaultOptions.exportValue)) {
|
|
136
|
-
_context.next =
|
|
133
|
+
_context.next = 8;
|
|
137
134
|
break;
|
|
138
135
|
}
|
|
139
|
-
_context.next =
|
|
136
|
+
_context.next = 4;
|
|
140
137
|
return batchExport(type, exportImport);
|
|
141
|
-
case
|
|
138
|
+
case 4:
|
|
142
139
|
result = _context.sent;
|
|
143
140
|
if (result) {
|
|
144
141
|
onCancel();
|
|
145
142
|
}
|
|
146
|
-
_context.next =
|
|
143
|
+
_context.next = 9;
|
|
147
144
|
break;
|
|
148
|
-
case
|
|
145
|
+
case 8:
|
|
149
146
|
if (value === defaultOptions.importValue) {
|
|
150
147
|
formData = new FormData();
|
|
151
148
|
formData.append("file", file);
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
if (formId) {
|
|
150
|
+
formData.append("form_id", formId);
|
|
151
|
+
}
|
|
152
|
+
if (formCode) {
|
|
153
|
+
formData.append("code", formCode);
|
|
154
|
+
}
|
|
154
155
|
if (formData) {
|
|
155
156
|
message.loading({
|
|
156
157
|
content: "Loading...",
|
|
@@ -159,7 +160,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
159
160
|
_batchImport.run(formData);
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
|
-
case
|
|
163
|
+
case 9:
|
|
163
164
|
case "end":
|
|
164
165
|
return _context.stop();
|
|
165
166
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
declare type exportParams = {
|
|
2
2
|
ids?: Array<string | number>;
|
|
3
3
|
file_name?: string;
|
|
4
|
+
form_id?: string | number;
|
|
5
|
+
code?: string;
|
|
4
6
|
};
|
|
5
7
|
export declare const exportData: (params: exportParams) => Promise<any>;
|
|
6
|
-
export declare const batchExport: (params: any) => Promise<any>;
|
|
7
|
-
export declare const formIdExport: (form_id: string | number, params: exportParams) => Promise<any>;
|
|
8
|
-
export declare const formCodeExport: (code: string, params: exportParams) => Promise<any>;
|
|
9
8
|
export declare const batchImport: (params: any) => Promise<any>;
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const importFormIdTemplate: (form_id: string | number) => Promise<any>;
|
|
9
|
+
export declare const importTemplate: (params: exportParams) => Promise<any>;
|
|
12
10
|
export declare const historyData: (params: any) => Promise<any>;
|
|
13
11
|
export {};
|
|
@@ -5,34 +5,17 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
5
5
|
import { request } from "./utils";
|
|
6
6
|
// 导出
|
|
7
7
|
export var exportData = function exportData(params) {
|
|
8
|
-
return request.getRequest().
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// 导出
|
|
12
|
-
export var batchExport = function batchExport(params) {
|
|
13
|
-
return request.getRequest().get("/shop/form/data/export", params);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// 根据表单id导出
|
|
17
|
-
export var formIdExport = function formIdExport(form_id, params) {
|
|
18
|
-
return request.getRequest().post("/shop/form/data/export/".concat(form_id), params);
|
|
19
|
-
};
|
|
20
|
-
// 根据表单code导出
|
|
21
|
-
export var formCodeExport = function formCodeExport(code, params) {
|
|
22
|
-
return request.getRequest().get("/shop/form/data/export/code/".concat(code), params);
|
|
8
|
+
return request.getRequest().post("/shop/form/data/export", params);
|
|
23
9
|
};
|
|
24
10
|
|
|
25
11
|
// 导入
|
|
26
12
|
export var batchImport = function batchImport(params) {
|
|
27
13
|
return request.getRequest().post('/shop/form/data/import', params);
|
|
28
14
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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));
|
|
15
|
+
|
|
16
|
+
// 导入模版
|
|
17
|
+
export var importTemplate = function importTemplate(params) {
|
|
18
|
+
return request.getRequest().post('/shop/form/data/download-template', params);
|
|
36
19
|
};
|
|
37
20
|
export var historyData = /*#__PURE__*/function () {
|
|
38
21
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const batchExport: (type: string, exportImport: any) => Promise<true | undefined
|
|
1
|
+
export declare const batchExport: (type: string, exportImport: any) => Promise<true | undefined>;
|
package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -27,16 +27,9 @@ var import_locales = require("../../../../../../../locales/index");
|
|
|
27
27
|
var import_serve = require("../../../../../serve");
|
|
28
28
|
var import_status = require("../../../../../status");
|
|
29
29
|
var import_file = require("../../utils/file");
|
|
30
|
-
var _batchExport = async (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
console.log(formCode, formId, "wh77");
|
|
34
|
-
if (formId) {
|
|
35
|
-
res = await (0, import_serve.formIdExport)(formId, params);
|
|
36
|
-
} else if (formCode) {
|
|
37
|
-
res = (0, import_serve.formCodeExport)(formCode, params);
|
|
38
|
-
}
|
|
39
|
-
if (res == null ? void 0 : res.status) {
|
|
30
|
+
var _batchExport = async (params) => {
|
|
31
|
+
let { status } = await (0, import_serve.exportData)(params);
|
|
32
|
+
if (status) {
|
|
40
33
|
import_antd.message.success({
|
|
41
34
|
content: (0, import_locales.getText)("table-action-export-import-export-success"),
|
|
42
35
|
key: import_status.defaultOptions.exportValue
|
|
@@ -48,30 +41,33 @@ var _batchExport = async (idCode, params) => {
|
|
|
48
41
|
}
|
|
49
42
|
};
|
|
50
43
|
var batchExport = (type, exportImport) => {
|
|
51
|
-
const { selectLists } = exportImport;
|
|
44
|
+
const { selectLists, formId, formCode } = exportImport;
|
|
52
45
|
let _name = (0, import_file.getFileDateName)();
|
|
46
|
+
let params = {};
|
|
47
|
+
if (formId) {
|
|
48
|
+
params.form_id = formId;
|
|
49
|
+
}
|
|
50
|
+
if (formCode) {
|
|
51
|
+
params.code = formCode;
|
|
52
|
+
}
|
|
53
|
+
if (type === import_status.defaultOptions.exportType || type === "selected-records") {
|
|
54
|
+
params.ids = selectLists || [];
|
|
55
|
+
}
|
|
53
56
|
if (type === import_status.defaultOptions.exportType) {
|
|
54
57
|
_name = `${(0, import_locales.getText)("table-action-export-import-current-page")}${_name}`;
|
|
55
|
-
|
|
56
|
-
ids: selectLists,
|
|
57
|
-
file_name: _name
|
|
58
|
-
});
|
|
58
|
+
params.file_name = _name;
|
|
59
59
|
}
|
|
60
60
|
if (type === "all-records") {
|
|
61
61
|
_name = `${(0, import_locales.getText)("table-action-export-import-all-records")}${_name}`;
|
|
62
|
-
|
|
63
|
-
file_name: _name
|
|
64
|
-
});
|
|
62
|
+
params.file_name = _name;
|
|
65
63
|
}
|
|
66
64
|
if (type === "selected-records") {
|
|
67
65
|
_name = `${(0, import_locales.getText)(
|
|
68
66
|
"table-action-export-import-selected-records"
|
|
69
67
|
)}(${(0, import_locales.getText)("table-action-export-import-selected")} ${(0, import_locales.getText)("table-action-export-import-item")(selectLists == null ? void 0 : selectLists.length)}) ${_name}`;
|
|
70
|
-
|
|
71
|
-
ids: selectLists,
|
|
72
|
-
file_name: _name
|
|
73
|
-
});
|
|
68
|
+
params.file_name = _name;
|
|
74
69
|
}
|
|
70
|
+
return _batchExport(params);
|
|
75
71
|
};
|
|
76
72
|
// Annotate the CommonJS export names for ESM import in node:
|
|
77
73
|
0 && (module.exports = {
|
|
@@ -52,13 +52,16 @@ var ImportTable = (props) => {
|
|
|
52
52
|
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
53
53
|
const handleDownload = async () => {
|
|
54
54
|
var _a;
|
|
55
|
+
console.log("wh_export", exportImport);
|
|
55
56
|
import_antd.message.loading({ content: "Loading...", key: loadingKey });
|
|
56
|
-
|
|
57
|
+
const params = {};
|
|
57
58
|
if (formId) {
|
|
58
|
-
|
|
59
|
-
} else if (formCode) {
|
|
60
|
-
res = await (0, import_serve.importCodeTemplate)(formCode);
|
|
59
|
+
params.form_id = formId;
|
|
61
60
|
}
|
|
61
|
+
if (formCode) {
|
|
62
|
+
params.code = formCode;
|
|
63
|
+
}
|
|
64
|
+
let res = await (0, import_serve.importTemplate)(params);
|
|
62
65
|
(0, import_download.default)((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.url);
|
|
63
66
|
import_antd.message.success({
|
|
64
67
|
content: (0, import_locales.getText)("table-action-export-import-table-success-download"),
|
|
@@ -55,7 +55,6 @@ var Com = {
|
|
|
55
55
|
import_log: import_ImportLog.default
|
|
56
56
|
};
|
|
57
57
|
var ExportImport = ({ exportImport }) => {
|
|
58
|
-
const { selectLists, formId, formCode } = exportImport;
|
|
59
58
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
60
59
|
const [file, setFile] = (0, import_react.useState)(null);
|
|
61
60
|
const [type, setType] = (0, import_react.useState)(import_status.defaultOptions.exportType);
|
|
@@ -122,6 +121,7 @@ var ExportImport = ({ exportImport }) => {
|
|
|
122
121
|
content: (0, import_locales.getText)("table-action-export-import-import-success"),
|
|
123
122
|
key: value
|
|
124
123
|
});
|
|
124
|
+
localStorage.setItem("dot", "true");
|
|
125
125
|
onCancel();
|
|
126
126
|
},
|
|
127
127
|
onError: (err) => {
|
|
@@ -130,6 +130,7 @@ var ExportImport = ({ exportImport }) => {
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
const onOk = async () => {
|
|
133
|
+
const { formId, formCode } = exportImport;
|
|
133
134
|
if (value === import_status.defaultOptions.exportValue) {
|
|
134
135
|
const result = await (0, import_function.batchExport)(type, exportImport);
|
|
135
136
|
if (result) {
|
|
@@ -138,7 +139,12 @@ var ExportImport = ({ exportImport }) => {
|
|
|
138
139
|
} else if (value === import_status.defaultOptions.importValue) {
|
|
139
140
|
const formData = new FormData();
|
|
140
141
|
formData.append("file", file);
|
|
141
|
-
|
|
142
|
+
if (formId) {
|
|
143
|
+
formData.append("form_id", formId);
|
|
144
|
+
}
|
|
145
|
+
if (formCode) {
|
|
146
|
+
formData.append("code", formCode);
|
|
147
|
+
}
|
|
142
148
|
if (formData) {
|
|
143
149
|
import_antd.message.loading({ content: "Loading...", key: value });
|
|
144
150
|
_batchImport.run(formData);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
declare type exportParams = {
|
|
2
2
|
ids?: Array<string | number>;
|
|
3
3
|
file_name?: string;
|
|
4
|
+
form_id?: string | number;
|
|
5
|
+
code?: string;
|
|
4
6
|
};
|
|
5
7
|
export declare const exportData: (params: exportParams) => Promise<any>;
|
|
6
|
-
export declare const batchExport: (params: any) => Promise<any>;
|
|
7
|
-
export declare const formIdExport: (form_id: string | number, params: exportParams) => Promise<any>;
|
|
8
|
-
export declare const formCodeExport: (code: string, params: exportParams) => Promise<any>;
|
|
9
8
|
export declare const batchImport: (params: any) => Promise<any>;
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const importFormIdTemplate: (form_id: string | number) => Promise<any>;
|
|
9
|
+
export declare const importTemplate: (params: exportParams) => Promise<any>;
|
|
12
10
|
export declare const historyData: (params: any) => Promise<any>;
|
|
13
11
|
export {};
|
|
@@ -19,37 +19,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/components/table/serve.ts
|
|
20
20
|
var serve_exports = {};
|
|
21
21
|
__export(serve_exports, {
|
|
22
|
-
batchExport: () => batchExport,
|
|
23
22
|
batchImport: () => batchImport,
|
|
24
23
|
exportData: () => exportData,
|
|
25
|
-
formCodeExport: () => formCodeExport,
|
|
26
|
-
formIdExport: () => formIdExport,
|
|
27
24
|
historyData: () => historyData,
|
|
28
|
-
|
|
29
|
-
importFormIdTemplate: () => importFormIdTemplate
|
|
25
|
+
importTemplate: () => importTemplate
|
|
30
26
|
});
|
|
31
27
|
module.exports = __toCommonJS(serve_exports);
|
|
32
28
|
var import_utils = require("./utils");
|
|
33
29
|
var exportData = (params) => {
|
|
34
|
-
return import_utils.request.getRequest().
|
|
30
|
+
return import_utils.request.getRequest().post(`/shop/form/data/export`, params);
|
|
35
31
|
};
|
|
36
|
-
var batchExport = (params) => {
|
|
37
|
-
return import_utils.request.getRequest().get(`/shop/form/data/export`, params);
|
|
38
|
-
};
|
|
39
|
-
var formIdExport = (form_id, params) => import_utils.request.getRequest().post(`/shop/form/data/export/${form_id}`, params);
|
|
40
|
-
var formCodeExport = (code, params) => import_utils.request.getRequest().get(`/shop/form/data/export/code/${code}`, params);
|
|
41
32
|
var batchImport = (params) => import_utils.request.getRequest().post("/shop/form/data/import", params);
|
|
42
|
-
var
|
|
43
|
-
var importFormIdTemplate = (form_id) => import_utils.request.getRequest().get(`/shop/form/data/download-template/id/${form_id}`);
|
|
33
|
+
var importTemplate = (params) => import_utils.request.getRequest().post("/shop/form/data/download-template", params);
|
|
44
34
|
var historyData = async (params) => await import_utils.request.getRequest().get("/shop/form/data/task", params);
|
|
45
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
36
|
0 && (module.exports = {
|
|
47
|
-
batchExport,
|
|
48
37
|
batchImport,
|
|
49
38
|
exportData,
|
|
50
|
-
formCodeExport,
|
|
51
|
-
formIdExport,
|
|
52
39
|
historyData,
|
|
53
|
-
|
|
54
|
-
importFormIdTemplate
|
|
40
|
+
importTemplate
|
|
55
41
|
});
|