@pisell/materials 2.2.2 → 2.2.4
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 +13 -13
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/MultipleContainersSortList/index.d.ts +5 -5
- package/es/components/MultipleContainersSortList/index.js +10 -10
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/filter/components/FilterItem/index.js +5 -2
- package/es/components/filter/components/QuickFilter/index.js +2 -1
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/sort/index.js +3 -1
- package/es/components/sort/index.less +3 -0
- package/es/components/sort/types.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +143 -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 +7 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +87 -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 +7 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +137 -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 +149 -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 +236 -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/component/Group/PopoverContent.d.ts +2 -2
- package/es/components/table/Actions/component/Group/PopoverContent.js +11 -7
- package/es/components/table/Actions/index.d.ts +3 -2
- package/es/components/table/Actions/index.js +12 -8
- package/es/components/table/BasicTable/index.js +11 -1
- package/es/components/table/Table/index.js +6 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- 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/model.d.ts +2 -0
- package/es/components/table/model.js +15 -1
- package/es/components/table/serve.d.ts +11 -0
- package/es/components/table/serve.js +38 -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 +21 -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 +46 -0
- package/es/locales/en-US.js +59 -1
- package/es/locales/zh-CN.d.ts +46 -0
- package/es/locales/zh-CN.js +59 -1
- package/es/locales/zh-TW.d.ts +46 -0
- package/es/locales/zh-TW.js +59 -1
- package/lib/components/MultipleContainersSortList/index.d.ts +5 -5
- package/lib/components/MultipleContainersSortList/index.js +16 -11
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/filter/components/FilterItem/index.js +11 -2
- package/lib/components/filter/components/QuickFilter/index.js +2 -1
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/sort/index.js +4 -9
- package/lib/components/sort/index.less +3 -0
- package/lib/components/sort/types.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +150 -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 +7 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +78 -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 +7 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +141 -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 +124 -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 +213 -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/component/Group/PopoverContent.d.ts +2 -2
- package/lib/components/table/Actions/component/Group/PopoverContent.js +2 -1
- package/lib/components/table/Actions/index.d.ts +3 -2
- package/lib/components/table/Actions/index.js +11 -7
- package/lib/components/table/BasicTable/index.js +9 -0
- package/lib/components/table/Table/index.js +6 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- 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/model.d.ts +2 -0
- package/lib/components/table/model.js +11 -1
- package/lib/components/table/serve.d.ts +11 -0
- package/lib/components/table/serve.js +41 -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 +21 -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 +46 -0
- package/lib/locales/en-US.js +51 -1
- package/lib/locales/zh-CN.d.ts +46 -0
- package/lib/locales/zh-CN.js +51 -1
- package/lib/locales/zh-TW.d.ts +46 -0
- package/lib/locales/zh-TW.js +51 -1
- package/lowcode/table/meta.ts +117 -1
- package/lowcode/table/snippets.ts +14 -0
- package/package.json +3 -3
|
@@ -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,141 @@
|
|
|
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 { exportImport } = props;
|
|
53
|
+
const { formId, formCode } = exportImport;
|
|
54
|
+
const detailRef = (0, import_react.useRef)(null);
|
|
55
|
+
const [list, setList] = (0, import_react.useState)([]);
|
|
56
|
+
const [defaultParams, setDefaultParams] = (0, import_react.useState)(defaultData);
|
|
57
|
+
const context = (0, import_useEngineContext.default)();
|
|
58
|
+
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
59
|
+
(0, import_react.useEffect)(() => {
|
|
60
|
+
let params = {};
|
|
61
|
+
if (formId) {
|
|
62
|
+
params.form_id = formId;
|
|
63
|
+
}
|
|
64
|
+
if (formCode) {
|
|
65
|
+
params.code = formCode;
|
|
66
|
+
}
|
|
67
|
+
setDefaultParams({
|
|
68
|
+
...defaultParams,
|
|
69
|
+
...params
|
|
70
|
+
});
|
|
71
|
+
}, [formId, formCode]);
|
|
72
|
+
const _historyList = (0, import_ahooks.useRequest)(import_serve.historyData, {
|
|
73
|
+
manual: true,
|
|
74
|
+
onSuccess: (res) => {
|
|
75
|
+
var _a;
|
|
76
|
+
if (res.code == 200) {
|
|
77
|
+
setList(((_a = res.data) == null ? void 0 : _a.list) || []);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const init = () => {
|
|
82
|
+
if ((defaultParams == null ? void 0 : defaultParams.form_id) || (defaultParams == null ? void 0 : defaultParams.code)) {
|
|
83
|
+
_historyList.run(defaultParams);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
(0, import_react.useEffect)(() => {
|
|
87
|
+
init();
|
|
88
|
+
}, [defaultParams]);
|
|
89
|
+
const columns = [
|
|
90
|
+
{
|
|
91
|
+
title: (0, import_locales.getText)("table-action-export-import-log-name"),
|
|
92
|
+
dataIndex: "file_name"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: (0, import_locales.getText)("table-action-export-import-log-result"),
|
|
96
|
+
dataIndex: "result",
|
|
97
|
+
render: (text, record) => {
|
|
98
|
+
var _a;
|
|
99
|
+
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(
|
|
100
|
+
"a",
|
|
101
|
+
{
|
|
102
|
+
style: {
|
|
103
|
+
marginLeft: "10px"
|
|
104
|
+
},
|
|
105
|
+
onClick: () => {
|
|
106
|
+
var _a2, _b;
|
|
107
|
+
(_b = (_a2 = detailRef == null ? void 0 : detailRef.current) == null ? void 0 : _a2.open) == null ? void 0 : _b.call(_a2, {
|
|
108
|
+
list: [record]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
(0, import_locales.getText)("table-action-export-import-log-check")
|
|
113
|
+
) : null);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
title: (0, import_locales.getText)("table-action-export-import-file-account"),
|
|
118
|
+
dataIndex: "account",
|
|
119
|
+
render: (text) => {
|
|
120
|
+
return text ? /* @__PURE__ */ import_react.default.createElement("div", null, `${(text == null ? void 0 : text.first_name) || ""} ${(text == null ? void 0 : text.last_name) || ""}`) : null;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
title: (0, import_locales.getText)("table-action-export-import-file-created"),
|
|
125
|
+
dataIndex: "created_at",
|
|
126
|
+
render: (text) => (0, import_date.formatDate)(text)
|
|
127
|
+
}
|
|
128
|
+
];
|
|
129
|
+
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: () => init() }, (0, import_locales.getText)("table-action-export-import-file-refresh"))), /* @__PURE__ */ import_react.default.createElement(
|
|
130
|
+
import_antd.Table,
|
|
131
|
+
{
|
|
132
|
+
rowClassName: "antd-table-row",
|
|
133
|
+
columns,
|
|
134
|
+
dataSource: list,
|
|
135
|
+
pagination: false,
|
|
136
|
+
rowKey: (record) => record.id,
|
|
137
|
+
scroll: { x: true }
|
|
138
|
+
}
|
|
139
|
+
))), /* @__PURE__ */ import_react.default.createElement(import_Detail.default, { ref: detailRef }));
|
|
140
|
+
};
|
|
141
|
+
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,124 @@
|
|
|
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, templateFileUrl } = 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
|
+
if (templateFileUrl) {
|
|
55
|
+
(0, import_download.default)(templateFileUrl);
|
|
56
|
+
} else {
|
|
57
|
+
import_antd.message.loading({ content: "Loading...", key: loadingKey });
|
|
58
|
+
const params = {};
|
|
59
|
+
if (formId) {
|
|
60
|
+
params.form_id = formId;
|
|
61
|
+
}
|
|
62
|
+
if (formCode) {
|
|
63
|
+
params.code = formCode;
|
|
64
|
+
}
|
|
65
|
+
let { data } = await (0, import_serve.importTemplate)(params);
|
|
66
|
+
(0, import_download.default)(data == null ? void 0 : data.url);
|
|
67
|
+
}
|
|
68
|
+
import_antd.message.success({
|
|
69
|
+
content: (0, import_locales.getText)("table-action-export-import-table-success-download"),
|
|
70
|
+
key: loadingKey
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const fileType = (0, import_react.useMemo)(() => {
|
|
74
|
+
if (file) {
|
|
75
|
+
return file.type.indexOf("/csv") !== -1 ? "csv" : "excel";
|
|
76
|
+
}
|
|
77
|
+
return "";
|
|
78
|
+
}, [file]);
|
|
79
|
+
const fileName = (0, import_react.useMemo)(() => {
|
|
80
|
+
if (file) {
|
|
81
|
+
return file.name;
|
|
82
|
+
}
|
|
83
|
+
return "";
|
|
84
|
+
}, [file]);
|
|
85
|
+
const _handleSelectFile = (e) => {
|
|
86
|
+
var _a;
|
|
87
|
+
let _file = ((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.files) ? e.target.files[0] : null;
|
|
88
|
+
if (_file) {
|
|
89
|
+
if (_file.name.indexOf(".csv") === -1 && _file.name.indexOf(".xls") === -1 && _file.name.indexOf(".xlsx") === -1) {
|
|
90
|
+
return import_antd.message.error(
|
|
91
|
+
(0, import_locales.getText)("table-action-export-import-table-error-file")
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
onChange(_file);
|
|
95
|
+
setFile(_file);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
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(
|
|
99
|
+
import_iconfont.default,
|
|
100
|
+
{
|
|
101
|
+
type: fileType === "csv" ? "icon-csv" : "icon-excel",
|
|
102
|
+
className: "file-icon"
|
|
103
|
+
}
|
|
104
|
+
), /* @__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(
|
|
105
|
+
"input",
|
|
106
|
+
{
|
|
107
|
+
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
108
|
+
className: "upload-input",
|
|
109
|
+
type: "file",
|
|
110
|
+
onChange: _handleSelectFile,
|
|
111
|
+
value: ""
|
|
112
|
+
}
|
|
113
|
+
))) : /* @__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(
|
|
114
|
+
"input",
|
|
115
|
+
{
|
|
116
|
+
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
117
|
+
className: "upload-input",
|
|
118
|
+
type: "file",
|
|
119
|
+
onChange: _handleSelectFile,
|
|
120
|
+
value: ""
|
|
121
|
+
}
|
|
122
|
+
)));
|
|
123
|
+
};
|
|
124
|
+
var ImportTable_default = ImportTable;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.default-view {
|
|
2
|
+
margin: 16px 0;
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
text-align: center;
|
|
7
|
+
background: #f5f5f5;
|
|
8
|
+
border: 1px dashed #d9d9d9;
|
|
9
|
+
border-radius: 2px;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
-webkit-transition: border-color 0.3s;
|
|
12
|
+
transition: border-color 0.3s;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
padding: 0 16px;
|
|
15
|
+
|
|
16
|
+
.icon-wrap {
|
|
17
|
+
color: var(--theme-light-color);
|
|
18
|
+
font-size: 42px;
|
|
19
|
+
margin: 16px 0 0 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.text {
|
|
23
|
+
margin: 16px 0 0 0;
|
|
24
|
+
color: rgba(0, 0, 0, 0.85);
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.hint {
|
|
29
|
+
color: rgba(0, 0, 0, 0.45);
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.upload-input {
|
|
35
|
+
position: absolute;
|
|
36
|
+
left: 0;
|
|
37
|
+
top: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.error-hint {
|
|
45
|
+
display: flex;
|
|
46
|
+
width: 100%;
|
|
47
|
+
border-radius: 4px;
|
|
48
|
+
padding: 15px 20px;
|
|
49
|
+
border: 1px solid #ee827a;
|
|
50
|
+
background: #fff5e9;
|
|
51
|
+
margin-bottom: 20px;
|
|
52
|
+
|
|
53
|
+
.error-icon {
|
|
54
|
+
color: #ee827a;
|
|
55
|
+
font-size: 20px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.text {
|
|
59
|
+
margin-left: 10px;
|
|
60
|
+
flex: 1 1;
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.file-list {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 115px;
|
|
71
|
+
border: 1px dashed #d9d9d9;
|
|
72
|
+
border-radius: 2px;
|
|
73
|
+
margin: 16px 0;
|
|
74
|
+
padding: 0 30px;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
|
|
77
|
+
.file-icon {
|
|
78
|
+
font-size: 50px;
|
|
79
|
+
color: var(--theme-color);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.file-name {
|
|
83
|
+
text-align: left;
|
|
84
|
+
flex: 1;
|
|
85
|
+
max-width: 300px;
|
|
86
|
+
margin-left: 20px;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.import-title{
|
|
94
|
+
a{
|
|
95
|
+
margin-left: 10px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ExportImportType } from "../../../types";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
declare type ExportImportProps = {
|
|
5
|
+
exportImport: ExportImportType;
|
|
6
|
+
};
|
|
7
|
+
declare const ExportImport: ({ exportImport }: ExportImportProps) => React.JSX.Element;
|
|
8
|
+
export default ExportImport;
|