@pisell/materials 1.0.313 → 1.0.315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +4 -4
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +6 -6
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +5 -4
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +6 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +37 -40
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +3 -2
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +14 -23
- package/es/components/table/Actions/component/ExportImport/index.js +34 -17
- package/es/components/table/serve.d.ts +3 -5
- package/es/components/table/serve.js +5 -22
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +4 -3
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +6 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +20 -23
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +2 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +7 -4
- package/lib/components/table/Actions/component/ExportImport/index.js +23 -6
- package/lib/components/table/serve.d.ts +3 -5
- package/lib/components/table/serve.js +4 -18
- package/package.json +3 -3
|
@@ -47,6 +47,8 @@ var import_ExportTable = __toESM(require("./components/ExportTable"));
|
|
|
47
47
|
var import_function = require("./components/ExportTable/function");
|
|
48
48
|
var import_ImportLog = __toESM(require("./components/ImportLog"));
|
|
49
49
|
var import_ImportTable = __toESM(require("./components/ImportTable"));
|
|
50
|
+
var import_hooks = require("../../../../../hooks");
|
|
51
|
+
var import_model = require("../../../model");
|
|
50
52
|
var import_index = require("./index.less");
|
|
51
53
|
var Com = {
|
|
52
54
|
import: import_ImportTable.default,
|
|
@@ -55,14 +57,16 @@ var Com = {
|
|
|
55
57
|
import_log: import_ImportLog.default
|
|
56
58
|
};
|
|
57
59
|
var ExportImport = ({ exportImport }) => {
|
|
58
|
-
const { selectLists, formId, formCode } = exportImport;
|
|
59
60
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
60
61
|
const [file, setFile] = (0, import_react.useState)(null);
|
|
61
62
|
const [type, setType] = (0, import_react.useState)(import_status.defaultOptions.exportType);
|
|
62
63
|
const [value, setValue] = (0, import_react.useState)("");
|
|
63
64
|
const [errorStatus, setErrorStatus] = (0, import_react.useState)();
|
|
65
|
+
const { state } = (0, import_hooks.useSharedState)(import_model.Context);
|
|
66
|
+
const { dataSource: defaultDataSource, originDataSource } = state;
|
|
64
67
|
const context = (0, import_useEngineContext.default)();
|
|
65
68
|
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
69
|
+
console.log(defaultDataSource, originDataSource, "wh77");
|
|
66
70
|
const _items = (0, import_react.useMemo)(() => {
|
|
67
71
|
const result = Object.entries(import_status.exportImportOptions).map(([key, value2]) => {
|
|
68
72
|
return {
|
|
@@ -88,16 +92,18 @@ var ExportImport = ({ exportImport }) => {
|
|
|
88
92
|
return types.includes(value) ? 900 : import_status.defaultOptions.importValue ? 600 : 400;
|
|
89
93
|
}, [value]);
|
|
90
94
|
const _title = (0, import_react.useMemo)(() => {
|
|
91
|
-
if (exportImport == null ? void 0 : exportImport.title)
|
|
92
|
-
return exportImport.title;
|
|
93
95
|
if (!value)
|
|
94
96
|
return null;
|
|
97
|
+
const types = import_status.defaultOptions.okShowButtonTypes;
|
|
98
|
+
if (types.includes(value) && (exportImport == null ? void 0 : exportImport.title)) {
|
|
99
|
+
return `${import_status.exportImportOptions[value]}${exportImport.title}`;
|
|
100
|
+
}
|
|
95
101
|
return import_status.exportImportOptions[value];
|
|
96
102
|
}, [value, exportImport == null ? void 0 : exportImport.title]);
|
|
97
103
|
const _okText = (0, import_react.useMemo)(() => {
|
|
98
104
|
const types = import_status.defaultOptions.okShowButtonTypes;
|
|
99
105
|
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");
|
|
106
|
+
return value === import_status.defaultOptions.exportValue ? (0, import_locales.getText)("table-action-export-import-button") : (0, import_locales.getText)("table-action-export-import-button-import");
|
|
101
107
|
}
|
|
102
108
|
}, [value]);
|
|
103
109
|
const handleClick = (e) => {
|
|
@@ -122,6 +128,7 @@ var ExportImport = ({ exportImport }) => {
|
|
|
122
128
|
content: (0, import_locales.getText)("table-action-export-import-import-success"),
|
|
123
129
|
key: value
|
|
124
130
|
});
|
|
131
|
+
localStorage.setItem("dot", "true");
|
|
125
132
|
onCancel();
|
|
126
133
|
},
|
|
127
134
|
onError: (err) => {
|
|
@@ -130,15 +137,25 @@ var ExportImport = ({ exportImport }) => {
|
|
|
130
137
|
}
|
|
131
138
|
});
|
|
132
139
|
const onOk = async () => {
|
|
140
|
+
const { formId, formCode } = exportImport;
|
|
133
141
|
if (value === import_status.defaultOptions.exportValue) {
|
|
134
|
-
const
|
|
142
|
+
const _params = {
|
|
143
|
+
type,
|
|
144
|
+
dataSource: defaultDataSource
|
|
145
|
+
};
|
|
146
|
+
const result = await (0, import_function.batchExport)(_params, exportImport);
|
|
135
147
|
if (result) {
|
|
136
148
|
onCancel();
|
|
137
149
|
}
|
|
138
150
|
} else if (value === import_status.defaultOptions.importValue) {
|
|
139
151
|
const formData = new FormData();
|
|
140
152
|
formData.append("file", file);
|
|
141
|
-
|
|
153
|
+
if (formId) {
|
|
154
|
+
formData.append("form_id", formId);
|
|
155
|
+
}
|
|
156
|
+
if (formCode) {
|
|
157
|
+
formData.append("code", formCode);
|
|
158
|
+
}
|
|
142
159
|
if (formData) {
|
|
143
160
|
import_antd.message.loading({ content: "Loading...", key: value });
|
|
144
161
|
_batchImport.run(formData);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
declare type exportParams = {
|
|
2
2
|
ids?: Array<string | number>;
|
|
3
3
|
file_name?: string;
|
|
4
|
+
form_id?: string | number;
|
|
5
|
+
code?: string;
|
|
4
6
|
};
|
|
5
7
|
export declare const exportData: (params: exportParams) => Promise<any>;
|
|
6
|
-
export declare const batchExport: (params: any) => Promise<any>;
|
|
7
|
-
export declare const formIdExport: (form_id: string | number, params: exportParams) => Promise<any>;
|
|
8
|
-
export declare const formCodeExport: (code: string, params: exportParams) => Promise<any>;
|
|
9
8
|
export declare const batchImport: (params: any) => Promise<any>;
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const importFormIdTemplate: (form_id: string | number) => Promise<any>;
|
|
9
|
+
export declare const importTemplate: (params: exportParams) => Promise<any>;
|
|
12
10
|
export declare const historyData: (params: any) => Promise<any>;
|
|
13
11
|
export {};
|
|
@@ -19,37 +19,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/components/table/serve.ts
|
|
20
20
|
var serve_exports = {};
|
|
21
21
|
__export(serve_exports, {
|
|
22
|
-
batchExport: () => batchExport,
|
|
23
22
|
batchImport: () => batchImport,
|
|
24
23
|
exportData: () => exportData,
|
|
25
|
-
formCodeExport: () => formCodeExport,
|
|
26
|
-
formIdExport: () => formIdExport,
|
|
27
24
|
historyData: () => historyData,
|
|
28
|
-
|
|
29
|
-
importFormIdTemplate: () => importFormIdTemplate
|
|
25
|
+
importTemplate: () => importTemplate
|
|
30
26
|
});
|
|
31
27
|
module.exports = __toCommonJS(serve_exports);
|
|
32
28
|
var import_utils = require("./utils");
|
|
33
29
|
var exportData = (params) => {
|
|
34
|
-
return import_utils.request.getRequest().
|
|
30
|
+
return import_utils.request.getRequest().post(`/shop/form/data/export`, params);
|
|
35
31
|
};
|
|
36
|
-
var batchExport = (params) => {
|
|
37
|
-
return import_utils.request.getRequest().get(`/shop/form/data/export`, params);
|
|
38
|
-
};
|
|
39
|
-
var formIdExport = (form_id, params) => import_utils.request.getRequest().post(`/shop/form/data/export/${form_id}`, params);
|
|
40
|
-
var formCodeExport = (code, params) => import_utils.request.getRequest().get(`/shop/form/data/export/code/${code}`, params);
|
|
41
32
|
var batchImport = (params) => import_utils.request.getRequest().post("/shop/form/data/import", params);
|
|
42
|
-
var
|
|
43
|
-
var importFormIdTemplate = (form_id) => import_utils.request.getRequest().get(`/shop/form/data/download-template/id/${form_id}`);
|
|
33
|
+
var importTemplate = (params) => import_utils.request.getRequest().post("/shop/form/data/download-template", params);
|
|
44
34
|
var historyData = async (params) => await import_utils.request.getRequest().get("/shop/form/data/task", params);
|
|
45
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
36
|
0 && (module.exports = {
|
|
47
|
-
batchExport,
|
|
48
37
|
batchImport,
|
|
49
38
|
exportData,
|
|
50
|
-
formCodeExport,
|
|
51
|
-
formIdExport,
|
|
52
39
|
historyData,
|
|
53
|
-
|
|
54
|
-
importFormIdTemplate
|
|
40
|
+
importTemplate
|
|
55
41
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.315",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
64
64
|
"crypto-js": "^4.2.0",
|
|
65
65
|
"@pisell/utils": "1.0.27",
|
|
66
|
-
"@pisell/
|
|
67
|
-
"@pisell/
|
|
66
|
+
"@pisell/date-picker": "1.0.75",
|
|
67
|
+
"@pisell/icon": "0.0.10"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^18.0.0",
|