@pisell/materials 1.0.309 → 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 +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +14 -14
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +14 -14
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +5 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +137 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +86 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.js +41 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +97 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +5 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +131 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +147 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
- package/es/components/table/Actions/component/ExportImport/index.d.ts +8 -0
- package/es/components/table/Actions/component/ExportImport/index.js +216 -0
- package/es/components/table/Actions/component/ExportImport/index.less +194 -0
- package/es/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
- package/es/components/table/Actions/component/ExportImport/utils/date.js +19 -0
- package/es/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
- package/es/components/table/Actions/component/ExportImport/utils/download.js +39 -0
- package/es/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
- package/es/components/table/Actions/component/ExportImport/utils/file.js +21 -0
- package/es/components/table/Actions/index.d.ts +3 -2
- package/es/components/table/Actions/index.js +12 -8
- package/es/components/table/hooks/useTableSetting.d.ts +2 -1
- package/es/components/table/hooks/useTableSetting.js +2 -1
- package/es/components/table/index.js +15 -13
- package/es/components/table/serve.d.ts +13 -0
- package/es/components/table/serve.js +55 -0
- package/es/components/table/status.d.ts +19 -0
- package/es/components/table/status.js +26 -0
- package/es/components/table/types.d.ts +20 -0
- package/es/components/table/utils.d.ts +15 -0
- package/es/components/table/utils.js +26 -0
- package/es/components/virtual-keyboard/Time/index.js +1 -1
- package/es/locales/en-US.d.ts +47 -0
- package/es/locales/en-US.js +60 -1
- package/es/locales/zh-CN.d.ts +47 -0
- package/es/locales/zh-CN.js +60 -1
- package/es/locales/zh-TW.d.ts +47 -0
- package/es/locales/zh-TW.js +60 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +5 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +144 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +79 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.js +60 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +117 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +5 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +135 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +119 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +8 -0
- package/lib/components/table/Actions/component/ExportImport/index.js +194 -0
- package/lib/components/table/Actions/component/ExportImport/index.less +194 -0
- package/lib/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
- package/lib/components/table/Actions/component/ExportImport/utils/date.js +49 -0
- package/lib/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
- package/lib/components/table/Actions/component/ExportImport/utils/download.js +62 -0
- package/lib/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
- package/lib/components/table/Actions/component/ExportImport/utils/file.js +55 -0
- package/lib/components/table/Actions/index.d.ts +3 -2
- package/lib/components/table/Actions/index.js +11 -7
- package/lib/components/table/hooks/useTableSetting.d.ts +2 -1
- package/lib/components/table/hooks/useTableSetting.js +2 -1
- package/lib/components/table/index.js +14 -12
- package/lib/components/table/serve.d.ts +13 -0
- package/lib/components/table/serve.js +55 -0
- package/lib/components/table/status.d.ts +19 -0
- package/lib/components/table/status.js +55 -0
- package/lib/components/table/types.d.ts +20 -0
- package/lib/components/table/utils.d.ts +15 -0
- package/lib/components/table/utils.js +40 -0
- package/lib/components/virtual-keyboard/Time/index.js +1 -1
- package/lib/locales/en-US.d.ts +47 -0
- package/lib/locales/en-US.js +52 -1
- package/lib/locales/zh-CN.d.ts +47 -0
- package/lib/locales/zh-CN.js +52 -1
- package/lib/locales/zh-TW.d.ts +47 -0
- package/lib/locales/zh-TW.js +52 -1
- package/lowcode/table/meta.ts +84 -1
- package/lowcode/table/snippets.ts +8 -0
- package/package.json +4 -4
package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/table/Actions/component/ExportImport/components/ExportTable/function.ts
|
|
20
|
+
var function_exports = {};
|
|
21
|
+
__export(function_exports, {
|
|
22
|
+
batchExport: () => batchExport
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(function_exports);
|
|
25
|
+
var import_antd = require("antd");
|
|
26
|
+
var import_locales = require("../../../../../../../locales/index");
|
|
27
|
+
var import_serve = require("../../../../../serve");
|
|
28
|
+
var import_status = require("../../../../../status");
|
|
29
|
+
var import_file = require("../../utils/file");
|
|
30
|
+
var _batchExport = async (idCode, params) => {
|
|
31
|
+
const { formId, formCode } = idCode;
|
|
32
|
+
let res = null;
|
|
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) {
|
|
40
|
+
import_antd.message.success({
|
|
41
|
+
content: (0, import_locales.getText)("table-action-export-import-export-success"),
|
|
42
|
+
key: import_status.defaultOptions.exportValue
|
|
43
|
+
});
|
|
44
|
+
localStorage.setItem("dot", "true");
|
|
45
|
+
return true;
|
|
46
|
+
} else {
|
|
47
|
+
import_antd.message.destroy();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var batchExport = (type, exportImport) => {
|
|
51
|
+
const { selectLists } = exportImport;
|
|
52
|
+
let _name = (0, import_file.getFileDateName)();
|
|
53
|
+
if (type === import_status.defaultOptions.exportType) {
|
|
54
|
+
_name = `${(0, import_locales.getText)("table-action-export-import-current-page")}${_name}`;
|
|
55
|
+
return _batchExport(exportImport, {
|
|
56
|
+
ids: selectLists,
|
|
57
|
+
file_name: _name
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (type === "all-records") {
|
|
61
|
+
_name = `${(0, import_locales.getText)("table-action-export-import-all-records")}${_name}`;
|
|
62
|
+
return _batchExport(exportImport, {
|
|
63
|
+
file_name: _name
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (type === "selected-records") {
|
|
67
|
+
_name = `${(0, import_locales.getText)(
|
|
68
|
+
"table-action-export-import-selected-records"
|
|
69
|
+
)}(${(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
|
+
return _batchExport(exportImport, {
|
|
71
|
+
ids: selectLists,
|
|
72
|
+
file_name: _name
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
batchExport
|
|
79
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/Actions/component/ExportImport/components/ExportTable/index.tsx
|
|
30
|
+
var ExportTable_exports = {};
|
|
31
|
+
__export(ExportTable_exports, {
|
|
32
|
+
default: () => ExportTable_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ExportTable_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_locales = require("../../../../../../../locales/index");
|
|
38
|
+
var import_status = require("../../../../../status");
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var ExportTable = (props) => {
|
|
41
|
+
const { onChange, exportImport } = props;
|
|
42
|
+
const { selectLists } = exportImport;
|
|
43
|
+
const [type, setType] = (0, import_react.useState)(import_status.defaultOptions.exportType);
|
|
44
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "bulk-export-tool" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "header" }, (0, import_locales.getText)("table-action-export-import-export-range")), /* @__PURE__ */ import_react.default.createElement(
|
|
45
|
+
import_antd.Radio.Group,
|
|
46
|
+
{
|
|
47
|
+
onChange: (e) => {
|
|
48
|
+
setType(e.target.value);
|
|
49
|
+
onChange(e.target.value);
|
|
50
|
+
},
|
|
51
|
+
value: type
|
|
52
|
+
},
|
|
53
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction: "vertical" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: "current-page" }, (0, import_locales.getText)("table-action-export-import-current-page")), /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: "all-records" }, (0, import_locales.getText)("table-action-export-import-all-records")), /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: "selected-records", disabled: !(selectLists == null ? void 0 : selectLists.length) }, `${(0, import_locales.getText)(
|
|
54
|
+
"table-action-export-import-selected-records"
|
|
55
|
+
)} (${(0, import_locales.getText)("table-action-export-import-selected")} ${(0, import_locales.getText)(
|
|
56
|
+
"table-action-export-import-item"
|
|
57
|
+
)((selectLists == null ? void 0 : selectLists.length) || 0)})`))
|
|
58
|
+
));
|
|
59
|
+
};
|
|
60
|
+
var ExportTable_default = ExportTable;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/Actions/component/ExportImport/components/ImportLog/Detail.tsx
|
|
30
|
+
var Detail_exports = {};
|
|
31
|
+
__export(Detail_exports, {
|
|
32
|
+
default: () => Detail_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Detail_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_locales = require("../../../../../../../locales/index");
|
|
38
|
+
var import_date = require("../../utils/date");
|
|
39
|
+
var import_file = require("../../utils/file");
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var Detail = (props, ref) => {
|
|
42
|
+
const [list, setList] = (0, import_react.useState)([]);
|
|
43
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
44
|
+
const columns = [
|
|
45
|
+
{
|
|
46
|
+
title: (0, import_locales.getText)("table-action-export-import-log-name"),
|
|
47
|
+
dataIndex: "file_name"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: (0, import_locales.getText)("table-action-export-import-log-result"),
|
|
51
|
+
dataIndex: "result",
|
|
52
|
+
render: (text) => {
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_locales.getText)("table-action-export-import-log-ok")((text == null ? void 0 : text.success) || 0), (text == null ? void 0 : text.fail) ? (0, import_locales.getText)("table-action-export-import-log-err")((text == null ? void 0 : text.fail) || 0) : null);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
title: (0, import_locales.getText)("table-action-export-import-file-account"),
|
|
58
|
+
dataIndex: "account",
|
|
59
|
+
render: (text) => {
|
|
60
|
+
return text ? /* @__PURE__ */ import_react.default.createElement("div", null, `${(text == null ? void 0 : text.first_name) || ""} ${(text == null ? void 0 : text.last_name) || ""}`) : null;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: (0, import_locales.getText)("table-action-export-import-file-created"),
|
|
65
|
+
dataIndex: "created_at",
|
|
66
|
+
render: (text) => (0, import_date.formatDate)(text)
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
const modalContent = (0, import_react.useMemo)(() => {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "export-history-content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
72
|
+
import_antd.Table,
|
|
73
|
+
{
|
|
74
|
+
rowClassName: "antd-table-row",
|
|
75
|
+
columns,
|
|
76
|
+
dataSource: list,
|
|
77
|
+
pagination: false,
|
|
78
|
+
rowKey: (record) => record.id,
|
|
79
|
+
scroll: { x: true }
|
|
80
|
+
}
|
|
81
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "error-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "header" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("table-action-export-import-log-err-log")), /* @__PURE__ */ import_react.default.createElement(
|
|
82
|
+
"a",
|
|
83
|
+
{
|
|
84
|
+
onClick: () => {
|
|
85
|
+
var _a2, _b2, _c2;
|
|
86
|
+
let text = ((_c2 = (_b2 = (_a2 = list == null ? void 0 : list[0]) == null ? void 0 : _a2.result) == null ? void 0 : _b2.fail_msg) == null ? void 0 : _c2.join(",")) || "";
|
|
87
|
+
(0, import_file.copyText)(text);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
(0, import_locales.getText)("table-action-export-import-log-copy")
|
|
91
|
+
)), /* @__PURE__ */ import_react.default.createElement("div", { className: "box" }, (_c = (_b = (_a = list == null ? void 0 : list[0]) == null ? void 0 : _a.result) == null ? void 0 : _b.fail_msg) == null ? void 0 : _c.map((i, index) => {
|
|
92
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: index }, i);
|
|
93
|
+
}))));
|
|
94
|
+
}, [list]);
|
|
95
|
+
(0, import_react.useImperativeHandle)(ref, () => {
|
|
96
|
+
return {
|
|
97
|
+
open: (params) => {
|
|
98
|
+
setList((params == null ? void 0 : params.list) || []);
|
|
99
|
+
setOpen(true);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
import_antd.Modal,
|
|
105
|
+
{
|
|
106
|
+
open,
|
|
107
|
+
title: (0, import_locales.getText)("table-action-export-import-log-detail-title"),
|
|
108
|
+
width: 900,
|
|
109
|
+
footer: null,
|
|
110
|
+
destroyOnClose: true,
|
|
111
|
+
onCancel: () => setOpen(false),
|
|
112
|
+
className: "antd-modal-detail-modal"
|
|
113
|
+
},
|
|
114
|
+
modalContent
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
var Detail_default = (0, import_react.forwardRef)(Detail);
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/Actions/component/ExportImport/components/ImportLog/index.tsx
|
|
30
|
+
var ImportLog_exports = {};
|
|
31
|
+
__export(ImportLog_exports, {
|
|
32
|
+
default: () => ImportLog_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ImportLog_exports);
|
|
35
|
+
var import_ahooks = require("ahooks");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_useEngineContext = __toESM(require("../../../../../../../hooks/useEngineContext"));
|
|
39
|
+
var import_locales = require("../../../../../../../locales/index");
|
|
40
|
+
var import_serve = require("../../../../../serve");
|
|
41
|
+
var import_status = require("../../../../../status");
|
|
42
|
+
var import_utils = require("../../../../../utils");
|
|
43
|
+
var import_date = require("../../utils/date");
|
|
44
|
+
var import_Detail = __toESM(require("./Detail"));
|
|
45
|
+
var import_index = require("./index.less");
|
|
46
|
+
var defaultData = {
|
|
47
|
+
type: import_status.defaultOptions.importValue,
|
|
48
|
+
skip: 1,
|
|
49
|
+
num: 10
|
|
50
|
+
};
|
|
51
|
+
var ImportLog = (props) => {
|
|
52
|
+
const { formId, formCode } = props;
|
|
53
|
+
const detailRef = (0, import_react.useRef)(null);
|
|
54
|
+
const [list, setList] = (0, import_react.useState)([]);
|
|
55
|
+
const [defaultParams, setDefaultParams] = (0, import_react.useState)(defaultData);
|
|
56
|
+
const context = (0, import_useEngineContext.default)();
|
|
57
|
+
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
58
|
+
(0, import_react.useEffect)(() => {
|
|
59
|
+
let params = {};
|
|
60
|
+
if (formId) {
|
|
61
|
+
params.form_id = formId;
|
|
62
|
+
}
|
|
63
|
+
if (formCode) {
|
|
64
|
+
params.code = formCode;
|
|
65
|
+
}
|
|
66
|
+
setDefaultParams({
|
|
67
|
+
...defaultParams,
|
|
68
|
+
...params
|
|
69
|
+
});
|
|
70
|
+
}, [formId, formCode]);
|
|
71
|
+
const _historyList = (0, import_ahooks.useRequest)(import_serve.historyData, {
|
|
72
|
+
manual: true,
|
|
73
|
+
onSuccess: (res) => {
|
|
74
|
+
var _a;
|
|
75
|
+
if (res.code == 200) {
|
|
76
|
+
setList(((_a = res.data) == null ? void 0 : _a.list) || []);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
(0, import_react.useEffect)(() => {
|
|
81
|
+
_historyList.run(defaultParams);
|
|
82
|
+
}, []);
|
|
83
|
+
const columns = [
|
|
84
|
+
{
|
|
85
|
+
title: (0, import_locales.getText)("table-action-export-import-log-name"),
|
|
86
|
+
dataIndex: "file_name"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: (0, import_locales.getText)("table-action-export-import-log-result"),
|
|
90
|
+
dataIndex: "result",
|
|
91
|
+
render: (text, record) => {
|
|
92
|
+
var _a;
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_locales.getText)("table-action-export-import-log-ok")((text == null ? void 0 : text.success) || 0), ((_a = record == null ? void 0 : record.result) == null ? void 0 : _a.fail) ? (0, import_locales.getText)("table-action-export-import-log-err")((text == null ? void 0 : text.fail) || 0) : null, (text == null ? void 0 : text.fail) ? /* @__PURE__ */ import_react.default.createElement(
|
|
94
|
+
"a",
|
|
95
|
+
{
|
|
96
|
+
style: {
|
|
97
|
+
marginLeft: "10px"
|
|
98
|
+
},
|
|
99
|
+
onClick: () => {
|
|
100
|
+
var _a2, _b;
|
|
101
|
+
(_b = (_a2 = detailRef == null ? void 0 : detailRef.current) == null ? void 0 : _a2.open) == null ? void 0 : _b.call(_a2, {
|
|
102
|
+
list: [record]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
(0, import_locales.getText)("table-action-export-import-log-check")
|
|
107
|
+
) : null);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: (0, import_locales.getText)("table-action-export-import-file-account"),
|
|
112
|
+
dataIndex: "account",
|
|
113
|
+
render: (text) => {
|
|
114
|
+
return text ? /* @__PURE__ */ import_react.default.createElement("div", null, `${(text == null ? void 0 : text.first_name) || ""} ${(text == null ? void 0 : text.last_name) || ""}`) : null;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: (0, import_locales.getText)("table-action-export-import-file-created"),
|
|
119
|
+
dataIndex: "created_at",
|
|
120
|
+
render: (text) => (0, import_date.formatDate)(text)
|
|
121
|
+
}
|
|
122
|
+
];
|
|
123
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "export-history-content" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: _historyList == null ? void 0 : _historyList.loading }, /* @__PURE__ */ import_react.default.createElement("div", { className: "content-hint" }, (0, import_locales.getText)("table-action-export-import-log-hint"), /* @__PURE__ */ import_react.default.createElement("a", { onClick: () => _historyList.run(defaultParams) }, (0, import_locales.getText)("table-action-export-import-file-refresh"))), /* @__PURE__ */ import_react.default.createElement(
|
|
124
|
+
import_antd.Table,
|
|
125
|
+
{
|
|
126
|
+
rowClassName: "antd-table-row",
|
|
127
|
+
columns,
|
|
128
|
+
dataSource: list,
|
|
129
|
+
pagination: false,
|
|
130
|
+
rowKey: (record) => record.id,
|
|
131
|
+
scroll: { x: true }
|
|
132
|
+
}
|
|
133
|
+
))), /* @__PURE__ */ import_react.default.createElement(import_Detail.default, { ref: detailRef }));
|
|
134
|
+
};
|
|
135
|
+
var ImportLog_default = ImportLog;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.export-history {
|
|
2
|
+
font-size: 14px;
|
|
3
|
+
font-weight: 650;
|
|
4
|
+
color: #252a2d;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.antd-modal-detail-modal{
|
|
9
|
+
.pisell-lowcode-modal-header{
|
|
10
|
+
padding: 0 0 6px 0!important;
|
|
11
|
+
}
|
|
12
|
+
.pisell-lowcode-table-content{
|
|
13
|
+
.pisell-lowcode-table-cell{
|
|
14
|
+
padding: 16px!important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.export-history-content {
|
|
20
|
+
max-height: calc(100vh * 0.7 - 120px);
|
|
21
|
+
min-height: 200px;
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
overflow-x: hidden;
|
|
24
|
+
|
|
25
|
+
.content-hint {
|
|
26
|
+
margin-bottom: 10px;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
color: #8c8c8c;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.error-content {
|
|
34
|
+
margin-top: 20px;
|
|
35
|
+
.header {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-content: center;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.box {
|
|
42
|
+
margin-top: 10px;
|
|
43
|
+
padding: 10px;
|
|
44
|
+
border: 1px solid #d9d9d9;
|
|
45
|
+
border-radius: 2px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ExportImportType } from "../../../../../types";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
declare type ImportTableProps = {
|
|
5
|
+
onChange: any;
|
|
6
|
+
exportImport: ExportImportType;
|
|
7
|
+
errorStatus: string | null;
|
|
8
|
+
};
|
|
9
|
+
declare const ImportTable: (props: ImportTableProps) => React.JSX.Element;
|
|
10
|
+
export default ImportTable;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/Actions/component/ExportImport/components/ImportTable/index.tsx
|
|
30
|
+
var ImportTable_exports = {};
|
|
31
|
+
__export(ImportTable_exports, {
|
|
32
|
+
default: () => ImportTable_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ImportTable_exports);
|
|
35
|
+
var import_icons = require("@ant-design/icons");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_useEngineContext = __toESM(require("../../../../../../../hooks/useEngineContext"));
|
|
39
|
+
var import_locales = require("../../../../../../../locales/index");
|
|
40
|
+
var import_iconfont = __toESM(require("../../../../../../iconfont"));
|
|
41
|
+
var import_serve = require("../../../../../serve");
|
|
42
|
+
var import_status = require("../../../../../status");
|
|
43
|
+
var import_utils = require("../../../../../utils");
|
|
44
|
+
var import_download = __toESM(require("../../utils/download"));
|
|
45
|
+
var import_index = require("./index.less");
|
|
46
|
+
var loadingKey = import_status.defaultOptions.importValue;
|
|
47
|
+
var ImportTable = (props) => {
|
|
48
|
+
const { onChange, exportImport, errorStatus } = props;
|
|
49
|
+
const { formId, formCode } = exportImport;
|
|
50
|
+
const [file, setFile] = (0, import_react.useState)(null);
|
|
51
|
+
const context = (0, import_useEngineContext.default)();
|
|
52
|
+
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
53
|
+
const handleDownload = async () => {
|
|
54
|
+
var _a;
|
|
55
|
+
import_antd.message.loading({ content: "Loading...", key: loadingKey });
|
|
56
|
+
let res = null;
|
|
57
|
+
if (formId) {
|
|
58
|
+
res = await (0, import_serve.importFormIdTemplate)(formId);
|
|
59
|
+
} else if (formCode) {
|
|
60
|
+
res = await (0, import_serve.importCodeTemplate)(formCode);
|
|
61
|
+
}
|
|
62
|
+
(0, import_download.default)((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.url);
|
|
63
|
+
import_antd.message.success({
|
|
64
|
+
content: (0, import_locales.getText)("table-action-export-import-table-success-download"),
|
|
65
|
+
key: loadingKey
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const fileType = (0, import_react.useMemo)(() => {
|
|
69
|
+
if (file) {
|
|
70
|
+
return file.type.indexOf("/csv") !== -1 ? "csv" : "excel";
|
|
71
|
+
}
|
|
72
|
+
return "";
|
|
73
|
+
}, [file]);
|
|
74
|
+
const fileName = (0, import_react.useMemo)(() => {
|
|
75
|
+
if (file) {
|
|
76
|
+
return file.name;
|
|
77
|
+
}
|
|
78
|
+
return "";
|
|
79
|
+
}, [file]);
|
|
80
|
+
const _handleSelectFile = (e) => {
|
|
81
|
+
var _a;
|
|
82
|
+
let _file = ((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.files) ? e.target.files[0] : null;
|
|
83
|
+
if (_file) {
|
|
84
|
+
if (_file.name.indexOf(".csv") === -1 && _file.name.indexOf(".xls") === -1 && _file.name.indexOf(".xlsx") === -1) {
|
|
85
|
+
return import_antd.message.error(
|
|
86
|
+
(0, import_locales.getText)("table-action-export-import-table-error-file")
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
onChange(_file);
|
|
90
|
+
setFile(_file);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, errorStatus ? /* @__PURE__ */ import_react.default.createElement("div", { className: "error-hint" }, /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: "icontixingshixin", className: "error-icon" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "text" }, errorStatus)) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "import-title" }, (0, import_locales.getText)("table-action-export-import-table-text-click-download"), /* @__PURE__ */ import_react.default.createElement("a", { onClick: handleDownload }, (0, import_locales.getText)("table-action-export-import-table-text-product-template"))), file ? /* @__PURE__ */ import_react.default.createElement("div", { className: "file-list" }, /* @__PURE__ */ import_react.default.createElement(
|
|
94
|
+
import_iconfont.default,
|
|
95
|
+
{
|
|
96
|
+
type: fileType === "csv" ? "icon-csv" : "icon-excel",
|
|
97
|
+
className: "file-icon"
|
|
98
|
+
}
|
|
99
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "file-name" }, fileName), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, null, (0, import_locales.getText)("table-action-export-import-table-text-edit-file"), /* @__PURE__ */ import_react.default.createElement(
|
|
100
|
+
"input",
|
|
101
|
+
{
|
|
102
|
+
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
103
|
+
className: "upload-input",
|
|
104
|
+
type: "file",
|
|
105
|
+
onChange: _handleSelectFile,
|
|
106
|
+
value: ""
|
|
107
|
+
}
|
|
108
|
+
))) : /* @__PURE__ */ import_react.default.createElement("div", { className: "default-view" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "icon-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_icons.InboxOutlined, null)), /* @__PURE__ */ import_react.default.createElement("p", { className: "text" }, (0, import_locales.getText)("table-action-export-import-table-text-input-title")), /* @__PURE__ */ import_react.default.createElement("p", { className: "hint" }, (0, import_locales.getText)("table-action-export-import-table-text-input-describe")), /* @__PURE__ */ import_react.default.createElement(
|
|
109
|
+
"input",
|
|
110
|
+
{
|
|
111
|
+
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
112
|
+
className: "upload-input",
|
|
113
|
+
type: "file",
|
|
114
|
+
onChange: _handleSelectFile,
|
|
115
|
+
value: ""
|
|
116
|
+
}
|
|
117
|
+
)));
|
|
118
|
+
};
|
|
119
|
+
var ImportTable_default = ImportTable;
|