@pisell/materials 1.0.308 → 1.0.312
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 +18 -18
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +17 -17
- package/es/components/table/Actions/component/ColumnsSetting/PopoverContent.js +1 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +4 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +117 -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 +72 -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 +4 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +111 -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 +128 -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 +215 -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/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/serve.d.ts +13 -0
- package/es/components/table/serve.js +71 -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 +58 -1
- package/es/locales/zh-CN.d.ts +47 -0
- package/es/locales/zh-CN.js +58 -1
- package/es/locales/zh-TW.d.ts +47 -0
- package/es/locales/zh-TW.js +58 -1
- package/lib/components/table/Actions/component/ColumnsSetting/PopoverContent.js +1 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +4 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +131 -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 +71 -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 +56 -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 +4 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +122 -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 +112 -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/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/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 +2 -2
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
|
@@ -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;
|
|
@@ -0,0 +1,194 @@
|
|
|
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/index.tsx
|
|
30
|
+
var ExportImport_exports = {};
|
|
31
|
+
__export(ExportImport_exports, {
|
|
32
|
+
default: () => ExportImport_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ExportImport_exports);
|
|
35
|
+
var import_SwitchVertical01 = __toESM(require("@pisell/icon/es/SwitchVertical01"));
|
|
36
|
+
var import_ahooks = require("ahooks");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
40
|
+
var import_locales = require("../../../../../locales/index");
|
|
41
|
+
var import_serve = require("../../../serve");
|
|
42
|
+
var import_status = require("../../../status");
|
|
43
|
+
var import_utils = require("../../../utils");
|
|
44
|
+
var import_ButtonIcon = __toESM(require("../ButtonIcon"));
|
|
45
|
+
var import_ExportFile = __toESM(require("./components/ExportFile"));
|
|
46
|
+
var import_ExportTable = __toESM(require("./components/ExportTable"));
|
|
47
|
+
var import_function = require("./components/ExportTable/function");
|
|
48
|
+
var import_ImportLog = __toESM(require("./components/ImportLog"));
|
|
49
|
+
var import_ImportTable = __toESM(require("./components/ImportTable"));
|
|
50
|
+
var import_index = require("./index.less");
|
|
51
|
+
var Com = {
|
|
52
|
+
import: import_ImportTable.default,
|
|
53
|
+
export: import_ExportTable.default,
|
|
54
|
+
export_file: import_ExportFile.default,
|
|
55
|
+
import_log: import_ImportLog.default
|
|
56
|
+
};
|
|
57
|
+
var ExportImport = ({ exportImport }) => {
|
|
58
|
+
const { selectLists } = exportImport;
|
|
59
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
60
|
+
const [file, setFile] = (0, import_react.useState)(null);
|
|
61
|
+
const [type, setType] = (0, import_react.useState)(import_status.defaultOptions.exportType);
|
|
62
|
+
const [value, setValue] = (0, import_react.useState)("");
|
|
63
|
+
const [errorStatus, setErrorStatus] = (0, import_react.useState)();
|
|
64
|
+
const context = (0, import_useEngineContext.default)();
|
|
65
|
+
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
66
|
+
const _items = (0, import_react.useMemo)(() => {
|
|
67
|
+
const result = Object.entries(import_status.exportImportOptions).map(([key, value2]) => {
|
|
68
|
+
return {
|
|
69
|
+
key,
|
|
70
|
+
label: value2
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
return result;
|
|
74
|
+
}, []);
|
|
75
|
+
const Content = (0, import_react.useMemo)(() => {
|
|
76
|
+
if (!value)
|
|
77
|
+
return null;
|
|
78
|
+
return Com[value];
|
|
79
|
+
}, [value]);
|
|
80
|
+
const _footer = (0, import_react.useMemo)(() => {
|
|
81
|
+
const types = import_status.defaultOptions.footerHintTypes;
|
|
82
|
+
if (types.includes(value)) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}, [value]);
|
|
86
|
+
const _width = (0, import_react.useMemo)(() => {
|
|
87
|
+
const types = import_status.defaultOptions.footerHintTypes;
|
|
88
|
+
return types.includes(value) ? 900 : import_status.defaultOptions.importValue ? 600 : 400;
|
|
89
|
+
}, [value]);
|
|
90
|
+
const _title = (0, import_react.useMemo)(() => {
|
|
91
|
+
if (exportImport == null ? void 0 : exportImport.title)
|
|
92
|
+
return exportImport.title;
|
|
93
|
+
if (!value)
|
|
94
|
+
return null;
|
|
95
|
+
return import_status.exportImportOptions[value];
|
|
96
|
+
}, [value, exportImport == null ? void 0 : exportImport.title]);
|
|
97
|
+
const _okText = (0, import_react.useMemo)(() => {
|
|
98
|
+
const types = import_status.defaultOptions.okShowButtonTypes;
|
|
99
|
+
if (types.includes(value)) {
|
|
100
|
+
return import_status.defaultOptions.exportValue ? (0, import_locales.getText)("table-action-export-import-button") : (0, import_locales.getText)("table-action-export-import-button-import");
|
|
101
|
+
}
|
|
102
|
+
}, [value]);
|
|
103
|
+
const handleClick = (e) => {
|
|
104
|
+
const value2 = e.key;
|
|
105
|
+
setValue(value2);
|
|
106
|
+
setOpen(true);
|
|
107
|
+
};
|
|
108
|
+
const onCancel = () => {
|
|
109
|
+
setOpen(false);
|
|
110
|
+
setValue("");
|
|
111
|
+
setFile(null);
|
|
112
|
+
setErrorStatus(null);
|
|
113
|
+
setType(import_status.defaultOptions.exportType);
|
|
114
|
+
};
|
|
115
|
+
const _batchImport = (0, import_ahooks.useRequest)(import_serve.batchImport, {
|
|
116
|
+
manual: true,
|
|
117
|
+
debounceWait: 200,
|
|
118
|
+
onSuccess: () => {
|
|
119
|
+
setErrorStatus(null);
|
|
120
|
+
import_antd.message.destroy();
|
|
121
|
+
import_antd.message.success({
|
|
122
|
+
content: (0, import_locales.getText)("table-action-export-import-import-success"),
|
|
123
|
+
key: value
|
|
124
|
+
});
|
|
125
|
+
onCancel();
|
|
126
|
+
},
|
|
127
|
+
onError: (err) => {
|
|
128
|
+
import_antd.message.destroy();
|
|
129
|
+
setErrorStatus((err == null ? void 0 : err.message) || null);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
const onOk = async () => {
|
|
133
|
+
const form_id = "720";
|
|
134
|
+
if (value === import_status.defaultOptions.exportValue) {
|
|
135
|
+
const result = await (0, import_function.batchExport)(type, selectLists || []);
|
|
136
|
+
if (result) {
|
|
137
|
+
onCancel();
|
|
138
|
+
}
|
|
139
|
+
} else if (value === import_status.defaultOptions.importValue) {
|
|
140
|
+
const formData = new FormData();
|
|
141
|
+
formData.append("file", file);
|
|
142
|
+
formData.append("form_id", form_id);
|
|
143
|
+
if (formData) {
|
|
144
|
+
import_antd.message.loading({ content: "Loading...", key: value });
|
|
145
|
+
_batchImport.run(formData);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
150
|
+
import_antd.Dropdown,
|
|
151
|
+
{
|
|
152
|
+
menu: {
|
|
153
|
+
items: _items,
|
|
154
|
+
selectable: true,
|
|
155
|
+
onClick: handleClick
|
|
156
|
+
},
|
|
157
|
+
placement: "bottomRight"
|
|
158
|
+
},
|
|
159
|
+
/* @__PURE__ */ import_react.default.createElement(import_ButtonIcon.default, { isActive: false }, /* @__PURE__ */ import_react.default.createElement(import_SwitchVertical01.default, { style: { cursor: "pointer", fontSize: 18 } }))
|
|
160
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
161
|
+
import_antd.Modal,
|
|
162
|
+
{
|
|
163
|
+
title: _title,
|
|
164
|
+
footer: _footer,
|
|
165
|
+
width: _width,
|
|
166
|
+
okText: _okText,
|
|
167
|
+
open,
|
|
168
|
+
className: "export-import-modal",
|
|
169
|
+
onCancel,
|
|
170
|
+
bodyStyle: { padding: "0px" },
|
|
171
|
+
destroyOnClose: true,
|
|
172
|
+
onOk,
|
|
173
|
+
okButtonProps: {
|
|
174
|
+
disabled: value === import_status.defaultOptions.importValue && (!file || !!errorStatus)
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
178
|
+
Content,
|
|
179
|
+
{
|
|
180
|
+
exportImport,
|
|
181
|
+
errorStatus,
|
|
182
|
+
onChange: (e) => {
|
|
183
|
+
if (value === import_status.defaultOptions.importValue) {
|
|
184
|
+
setFile(e);
|
|
185
|
+
setErrorStatus(null);
|
|
186
|
+
} else if (value === import_status.defaultOptions.exportValue) {
|
|
187
|
+
setType(e);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
));
|
|
193
|
+
};
|
|
194
|
+
var ExportImport_default = ExportImport;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
.export-import-modal{
|
|
2
|
+
.pisell-lowcode-modal-header{
|
|
3
|
+
padding: 0 0 6px 0!important;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.pisell-lowcode-table-content{
|
|
7
|
+
.pisell-lowcode-table-cell{
|
|
8
|
+
padding: 16px!important;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.goods-list-page {
|
|
14
|
+
padding: 0 30px;
|
|
15
|
+
|
|
16
|
+
.header {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
padding: 22px 0;
|
|
21
|
+
font-size: 20px;
|
|
22
|
+
font-weight: 650;
|
|
23
|
+
line-height: 28px;
|
|
24
|
+
color: #252a2d;
|
|
25
|
+
|
|
26
|
+
.action-list {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
min-height: 40px;
|
|
30
|
+
|
|
31
|
+
.import-btn,
|
|
32
|
+
.export-btn {
|
|
33
|
+
height: 28px;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
font-weight: 650;
|
|
36
|
+
line-height: 28px;
|
|
37
|
+
color: #252a2d;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.content {
|
|
44
|
+
padding: 20px 0;
|
|
45
|
+
background: #ffffff;
|
|
46
|
+
border-radius: var(--small-border-radius);
|
|
47
|
+
|
|
48
|
+
.search-wrap {
|
|
49
|
+
width: 100%;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
padding: 10px 32px 0 32px;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
|
|
55
|
+
.search-input {
|
|
56
|
+
flex: 1;
|
|
57
|
+
margin-right: 20px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.phone-wrap {
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
align-items: flex-end;
|
|
63
|
+
|
|
64
|
+
.search-input {
|
|
65
|
+
width: 100%;
|
|
66
|
+
margin-bottom: 16px;
|
|
67
|
+
margin-right: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.cover-wrap {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
width: 64px;
|
|
78
|
+
height: 64px;
|
|
79
|
+
opacity: 1;
|
|
80
|
+
border-radius: 2px;
|
|
81
|
+
margin: 0 auto;
|
|
82
|
+
|
|
83
|
+
img {
|
|
84
|
+
width: 100%;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.goods-status {
|
|
89
|
+
display: inline-block;
|
|
90
|
+
min-width: 58px;
|
|
91
|
+
border-radius: 16px;
|
|
92
|
+
font-size: 13px;
|
|
93
|
+
|
|
94
|
+
text-align: center;
|
|
95
|
+
padding: 2px 8px;
|
|
96
|
+
|
|
97
|
+
&.release {
|
|
98
|
+
background: #6fa629;
|
|
99
|
+
color: #ffffff;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.pending {
|
|
103
|
+
background: #ec808d;
|
|
104
|
+
color: #fff;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.archived {
|
|
108
|
+
background: #e4e5e7;
|
|
109
|
+
color: #252a2d;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&.draft {
|
|
113
|
+
background: #a4e8f2;
|
|
114
|
+
color: #202223;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.spin {
|
|
121
|
+
:global {
|
|
122
|
+
.ant-spin {
|
|
123
|
+
max-height: 10000px !important;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.empty-wrap {
|
|
129
|
+
min-height: 550px;
|
|
130
|
+
|
|
131
|
+
.empty-content {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
height: 550px;
|
|
136
|
+
background: #ffffff;
|
|
137
|
+
border-radius: 4px;
|
|
138
|
+
|
|
139
|
+
.icon {
|
|
140
|
+
font-size: 170px;
|
|
141
|
+
margin-top: 70px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.title {
|
|
145
|
+
margin-top: 40px;
|
|
146
|
+
height: 22px;
|
|
147
|
+
font-size: 16px;
|
|
148
|
+
font-weight: 650;
|
|
149
|
+
line-height: 28px;
|
|
150
|
+
color: #252a2d;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.describe {
|
|
154
|
+
margin-top: 22px;
|
|
155
|
+
margin-bottom: 9px;
|
|
156
|
+
max-width: 390px;
|
|
157
|
+
height: 86px;
|
|
158
|
+
font-size: 14px;
|
|
159
|
+
|
|
160
|
+
font-weight: 400;
|
|
161
|
+
line-height: 22px;
|
|
162
|
+
color: #707070;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.footer {
|
|
168
|
+
margin-top: 30px;
|
|
169
|
+
height: 17px;
|
|
170
|
+
font-size: 12px;
|
|
171
|
+
|
|
172
|
+
font-weight: 400;
|
|
173
|
+
line-height: 17px;
|
|
174
|
+
color: #8c8c8c;
|
|
175
|
+
text-align: center;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.phone-wrap {
|
|
179
|
+
padding: 0 16px;
|
|
180
|
+
|
|
181
|
+
.content {
|
|
182
|
+
.search-wrap {
|
|
183
|
+
padding: 10px 16px 0 16px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.list-wrap {
|
|
187
|
+
padding: 16px;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.list-wrap {
|
|
193
|
+
padding: 20px 32px;
|
|
194
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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/utils/date.ts
|
|
30
|
+
var date_exports = {};
|
|
31
|
+
__export(date_exports, {
|
|
32
|
+
formatDate: () => formatDate
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(date_exports);
|
|
35
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
36
|
+
var import_locale = require("../../../../../../utils/locale");
|
|
37
|
+
var formatDate = (date, format) => {
|
|
38
|
+
if (!date) {
|
|
39
|
+
return date;
|
|
40
|
+
}
|
|
41
|
+
const lang = (0, import_locale.getCurrentLocale)();
|
|
42
|
+
let _format = format || ["HH:mm:ss DD/MM/YYYY", "YYYY-MM-DD HH:mm:ss"];
|
|
43
|
+
let type = lang === "en-US" || lang === "en" ? _format[0] : _format[1];
|
|
44
|
+
return (0, import_dayjs.default)(date).format(type);
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
formatDate
|
|
49
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
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/utils/download.ts
|
|
20
|
+
var download_exports = {};
|
|
21
|
+
__export(download_exports, {
|
|
22
|
+
default: () => download_default,
|
|
23
|
+
windowOpen: () => windowOpen
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(download_exports);
|
|
26
|
+
var windowOpen = (url, target) => {
|
|
27
|
+
let oWindow = window.open("", target || "_blank");
|
|
28
|
+
oWindow.location = url;
|
|
29
|
+
};
|
|
30
|
+
var download_default = (sUrl, fileName) => {
|
|
31
|
+
let isChrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1;
|
|
32
|
+
let isSafari = navigator.userAgent.toLowerCase().indexOf("safari") > -1;
|
|
33
|
+
if (/(iP)/g.test(navigator.userAgent)) {
|
|
34
|
+
alert(
|
|
35
|
+
"Your device does not support files downloading. Please try again in desktop browser."
|
|
36
|
+
);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if (isChrome || isSafari) {
|
|
40
|
+
let link = document.createElement("a");
|
|
41
|
+
link.href = sUrl;
|
|
42
|
+
if (link.download !== void 0) {
|
|
43
|
+
let _fileName = fileName || sUrl.substring(sUrl.lastIndexOf("/") + 1, sUrl.length);
|
|
44
|
+
link.download = _fileName;
|
|
45
|
+
}
|
|
46
|
+
if (document.createEvent) {
|
|
47
|
+
let e = document.createEvent("MouseEvents");
|
|
48
|
+
e.initEvent("click", true, true);
|
|
49
|
+
link.dispatchEvent(e);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (sUrl.indexOf("?") === -1) {
|
|
54
|
+
sUrl += "?download";
|
|
55
|
+
}
|
|
56
|
+
windowOpen(sUrl, "_self");
|
|
57
|
+
return true;
|
|
58
|
+
};
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
windowOpen
|
|
62
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
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/utils/file.ts
|
|
30
|
+
var file_exports = {};
|
|
31
|
+
__export(file_exports, {
|
|
32
|
+
copyText: () => copyText,
|
|
33
|
+
getFileDateName: () => getFileDateName
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(file_exports);
|
|
36
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_locales = require("../../../../../../locales/index");
|
|
39
|
+
var getFileDateName = () => {
|
|
40
|
+
return "-" + (0, import_dayjs.default)().format("YYYY-MM-DD-HH-mm-ss");
|
|
41
|
+
};
|
|
42
|
+
var copyText = (text) => {
|
|
43
|
+
let input = document.createElement("input");
|
|
44
|
+
input.setAttribute("value", text);
|
|
45
|
+
document.body.appendChild(input);
|
|
46
|
+
input.select();
|
|
47
|
+
document.execCommand("copy");
|
|
48
|
+
document.body.removeChild(input);
|
|
49
|
+
import_antd.message.success((0, import_locales.getText)("table-action-export-import-table-success-copy"));
|
|
50
|
+
};
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
copyText,
|
|
54
|
+
getFileDateName
|
|
55
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterType } from "../../filter/types";
|
|
3
|
-
import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, SortType } from "../types";
|
|
3
|
+
import { ColumnSettingType, DataSourceGroupType, ExportImportType, GallerySettingType, GridViewType, SortType } from "../types";
|
|
4
4
|
import "./index.less";
|
|
5
5
|
declare type ActionsProps = {
|
|
6
6
|
filter: FilterType;
|
|
@@ -12,6 +12,7 @@ declare type ActionsProps = {
|
|
|
12
12
|
buttons: any[];
|
|
13
13
|
view: GridViewType;
|
|
14
14
|
gallery: GallerySettingType;
|
|
15
|
+
exportImport?: ExportImportType;
|
|
15
16
|
};
|
|
16
|
-
declare const Actions: ({ filter, sort, columnSetting, dataSourceGroup, tableId, localPagination, buttons, view, gallery, }: ActionsProps) => React.JSX.Element | null;
|
|
17
|
+
declare const Actions: ({ filter, sort, columnSetting, dataSourceGroup, tableId, localPagination, buttons, view, gallery, exportImport, }: ActionsProps) => React.JSX.Element | null;
|
|
17
18
|
export default Actions;
|
|
@@ -32,17 +32,18 @@ __export(Actions_exports, {
|
|
|
32
32
|
default: () => Actions_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Actions_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
35
|
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_filter = __toESM(require("../../filter"));
|
|
38
38
|
var import_sort = __toESM(require("../../sort"));
|
|
39
|
+
var import_Buttons = __toESM(require("../Header/Buttons"));
|
|
39
40
|
var import_ColumnsSetting = __toESM(require("./component/ColumnsSetting"));
|
|
41
|
+
var import_ExportImport = __toESM(require("./component/ExportImport"));
|
|
42
|
+
var import_GallerySetting = __toESM(require("./component/GallerySetting"));
|
|
40
43
|
var import_Group = __toESM(require("./component/Group"));
|
|
41
|
-
var import_Buttons = __toESM(require("../Header/Buttons"));
|
|
42
44
|
var import_ViewMode = __toESM(require("./component/ViewMode"));
|
|
43
|
-
var import_GallerySetting = __toESM(require("./component/GallerySetting"));
|
|
44
|
-
var import_index = require("./index.less");
|
|
45
45
|
var import_useIsMobileTable = __toESM(require("../hooks/useIsMobileTable"));
|
|
46
|
+
var import_index = require("./index.less");
|
|
46
47
|
var Actions = ({
|
|
47
48
|
filter,
|
|
48
49
|
sort,
|
|
@@ -52,7 +53,8 @@ var Actions = ({
|
|
|
52
53
|
localPagination,
|
|
53
54
|
buttons,
|
|
54
55
|
view,
|
|
55
|
-
gallery
|
|
56
|
+
gallery,
|
|
57
|
+
exportImport
|
|
56
58
|
}) => {
|
|
57
59
|
const form = import_antd.Form.useFormInstance();
|
|
58
60
|
const isMobileBool = (0, import_useIsMobileTable.default)();
|
|
@@ -61,13 +63,14 @@ var Actions = ({
|
|
|
61
63
|
preserve: true
|
|
62
64
|
});
|
|
63
65
|
const showActions = (0, import_react.useMemo)(() => {
|
|
64
|
-
return (filter == null ? void 0 : filter.show) || (sort == null ? void 0 : sort.show) || (columnSetting == null ? void 0 : columnSetting.show) || (dataSourceGroup == null ? void 0 : dataSourceGroup.show) || view.multiple;
|
|
66
|
+
return (filter == null ? void 0 : filter.show) || (sort == null ? void 0 : sort.show) || (columnSetting == null ? void 0 : columnSetting.show) || (dataSourceGroup == null ? void 0 : dataSourceGroup.show) || view.multiple || (exportImport == null ? void 0 : exportImport.show);
|
|
65
67
|
}, [
|
|
66
68
|
filter == null ? void 0 : filter.show,
|
|
67
69
|
sort == null ? void 0 : sort.show,
|
|
68
70
|
columnSetting == null ? void 0 : columnSetting.show,
|
|
69
71
|
dataSourceGroup == null ? void 0 : dataSourceGroup.show,
|
|
70
|
-
view.multiple
|
|
72
|
+
view.multiple,
|
|
73
|
+
exportImport == null ? void 0 : exportImport.show
|
|
71
74
|
]);
|
|
72
75
|
return showActions ? /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-actions" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "left-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
73
76
|
import_filter.default,
|
|
@@ -87,6 +90,7 @@ var Actions = ({
|
|
|
87
90
|
}
|
|
88
91
|
},
|
|
89
92
|
view.multiple && /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "view_mode", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_ViewMode.default, { view })),
|
|
93
|
+
(exportImport == null ? void 0 : exportImport.show) ? /* @__PURE__ */ import_react.default.createElement(import_ExportImport.default, { exportImport }) : null,
|
|
90
94
|
(dataSourceGroup == null ? void 0 : dataSourceGroup.show) && viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "group_by", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_Group.default, { setting: dataSourceGroup })),
|
|
91
95
|
(columnSetting == null ? void 0 : columnSetting.show) && viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: ["column_setting"], noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_ColumnsSetting.default, null)),
|
|
92
96
|
(columnSetting == null ? void 0 : columnSetting.show) && viewMode === "gallery" && /* @__PURE__ */ import_react.default.createElement(import_GallerySetting.default, { setting: gallery, currentViewMode: viewMode }),
|
|
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
167
167
|
sort?: SortType | undefined;
|
|
168
168
|
mode: "" | "localStorage" | "remote";
|
|
169
169
|
currentViewMode: ModeType;
|
|
170
|
-
}) => ("
|
|
170
|
+
}) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
171
171
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
172
172
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
173
173
|
export {};
|