@pisell/materials 1.0.398 → 1.0.400
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 +13 -13
- package/build/lowcode/assets-dev.json +4 -4
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +16 -57
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +19 -60
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/pisellModal/index.d.ts +5 -20
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +30 -26
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +3 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +25 -21
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +34 -31
- package/es/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/index.js +30 -24
- package/es/components/table/BasicTable/index.js +1 -1
- package/es/components/table/Table/index.d.ts +2 -2
- package/es/components/table/Table/index.js +66 -41
- package/es/components/table/View/index.d.ts +2 -2
- package/es/components/table/View/index.js +20 -16
- package/es/components/table/hooks/useTableSetting.js +3 -2
- package/es/components/table/index.js +8 -5
- package/es/components/table/index.less +4 -0
- package/es/components/table/serve.d.ts +1 -0
- package/es/components/table/serve.js +38 -7
- package/es/components/table/types.d.ts +2 -0
- package/lib/components/pisellModal/index.d.ts +5 -20
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +6 -2
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +2 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +6 -2
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +4 -2
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/index.js +11 -6
- package/lib/components/table/BasicTable/index.js +1 -1
- package/lib/components/table/Table/index.d.ts +2 -2
- package/lib/components/table/Table/index.js +59 -33
- package/lib/components/table/View/index.d.ts +2 -2
- package/lib/components/table/View/index.js +23 -19
- package/lib/components/table/hooks/useTableSetting.js +3 -2
- package/lib/components/table/index.js +5 -4
- package/lib/components/table/index.less +4 -0
- package/lib/components/table/serve.d.ts +1 -0
- package/lib/components/table/serve.js +24 -4
- package/lib/components/table/types.d.ts +2 -0
- package/lowcode/table/meta.ts +19 -0
- package/lowcode/table/snippets.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.707 4.293a1 1 0 0 1 0 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l5.293 5.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L16.586 13H5a1 1 0 1 1 0-2h11.586l-5.293-5.293a1 1 0 0 1 0-1.414Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm11.258-3.976a2 2 0 0 0-2.225 1.308 1 1 0 1 1-1.886-.664 4 4 0 0 1 7.773 1.333c0 1.53-1.135 2.54-1.945 3.081a8.044 8.044 0 0 1-1.686.848l-.035.013-.011.003-.004.002h-.002L11.92 13l.316.949a1 1 0 0 1-.633-1.897l.016-.006.074-.027a6.051 6.051 0 0 0 1.172-.6c.69-.46 1.055-.95 1.055-1.419v-.001a2 2 0 0 0-1.662-1.975ZM11 17a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.293 3.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L8 6.414V20a1 1 0 1 1-2 0V6.414L3.707 8.707a1 1 0 0 1-1.414-1.414l4-4ZM16 17.586V4a1 1 0 1 1 2 0v13.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L16 17.586Z"/></svg>
|
|
@@ -32,27 +32,12 @@ export interface PisellModalProps extends ModalProps {
|
|
|
32
32
|
}
|
|
33
33
|
declare const PisellModal: {
|
|
34
34
|
(props: PisellModalProps): React.JSX.Element;
|
|
35
|
-
confirm: (props: import("./components/functions").PisellModalFuncProps) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
info: (props: import("./components/functions").PisellModalFuncProps) => {
|
|
40
|
-
destroy: () => void;
|
|
41
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
42
|
-
};
|
|
43
|
-
error: (props: import("./components/functions").PisellModalFuncProps) => {
|
|
44
|
-
destroy: () => void;
|
|
45
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
46
|
-
};
|
|
35
|
+
confirm: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
36
|
+
info: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
37
|
+
error: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
47
38
|
warn: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
48
|
-
warning: (props: import("./components/functions").PisellModalFuncProps) =>
|
|
49
|
-
|
|
50
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
51
|
-
};
|
|
52
|
-
success: (props: import("./components/functions").PisellModalFuncProps) => {
|
|
53
|
-
destroy: () => void;
|
|
54
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
55
|
-
};
|
|
39
|
+
warning: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
40
|
+
success: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
56
41
|
Information: (props: import("./components/Information").InformationProps) => React.JSX.Element;
|
|
57
42
|
};
|
|
58
43
|
export default PisellModal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExportImportType } from '../../../../../types';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare const ExportFile: (props: {
|
|
5
5
|
exportImport: ExportImportType;
|
|
6
6
|
}) => React.JSX.Element;
|
|
@@ -10,9 +10,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { useRequest } from
|
|
14
|
-
import { Spin, Table } from
|
|
15
|
-
import React, { useEffect, useState } from
|
|
13
|
+
import { useRequest } from 'ahooks';
|
|
14
|
+
import { Spin, Table } from 'antd';
|
|
15
|
+
import React, { useEffect, useState } from 'react';
|
|
16
16
|
import useEngineContext from "../../../../../../../hooks/useEngineContext";
|
|
17
17
|
import { getText } from "../../../../../../../locales/index";
|
|
18
18
|
import { historyData } from "../../../../../serve";
|
|
@@ -27,15 +27,16 @@ var defaultData = {
|
|
|
27
27
|
num: 10
|
|
28
28
|
};
|
|
29
29
|
var exportStatusOptions = {
|
|
30
|
-
pending: getText(
|
|
31
|
-
processing: getText(
|
|
32
|
-
completed: getText(
|
|
33
|
-
complete: getText(
|
|
30
|
+
pending: getText('table-action-export-import-file-pending'),
|
|
31
|
+
processing: getText('table-action-export-import-file-processing'),
|
|
32
|
+
completed: getText('table-action-export-import-file-completed'),
|
|
33
|
+
complete: getText('table-action-export-import-file-completed')
|
|
34
34
|
};
|
|
35
35
|
var ExportFile = function ExportFile(props) {
|
|
36
36
|
var exportImport = props.exportImport;
|
|
37
37
|
var formId = exportImport.formId,
|
|
38
|
-
formCode = exportImport.formCode
|
|
38
|
+
formCode = exportImport.formCode,
|
|
39
|
+
apiUrl = exportImport.apiUrl;
|
|
39
40
|
var _useState = useState([]),
|
|
40
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
42
|
list = _useState2[0],
|
|
@@ -75,59 +76,62 @@ var ExportFile = function ExportFile(props) {
|
|
|
75
76
|
});
|
|
76
77
|
var init = function init() {
|
|
77
78
|
if (defaultParams !== null && defaultParams !== void 0 && defaultParams.form_id || defaultParams !== null && defaultParams !== void 0 && defaultParams.code) {
|
|
78
|
-
|
|
79
|
+
var _defaultParams = _objectSpread(_objectSpread({}, defaultParams), {}, {
|
|
80
|
+
url: apiUrl
|
|
81
|
+
});
|
|
82
|
+
_historyList.run(_defaultParams);
|
|
79
83
|
}
|
|
80
84
|
};
|
|
81
85
|
useEffect(function () {
|
|
82
86
|
init();
|
|
83
87
|
}, [defaultParams]);
|
|
84
88
|
var columns = [{
|
|
85
|
-
title: getText(
|
|
86
|
-
dataIndex:
|
|
89
|
+
title: getText('table-action-export-import-file-name'),
|
|
90
|
+
dataIndex: 'file_name',
|
|
87
91
|
render: function render(text, record) {
|
|
88
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, record.status ==
|
|
92
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, record.status == 'completed' || record.status == 'complete' ? /*#__PURE__*/React.createElement("a", {
|
|
89
93
|
onClick: function onClick() {
|
|
90
94
|
download(record.url, text);
|
|
91
95
|
}
|
|
92
96
|
}, text) : /*#__PURE__*/React.createElement("span", null, text));
|
|
93
97
|
}
|
|
94
98
|
}, {
|
|
95
|
-
title: getText(
|
|
96
|
-
dataIndex:
|
|
99
|
+
title: getText('table-action-export-import-file-content'),
|
|
100
|
+
dataIndex: 'setting',
|
|
97
101
|
render: function render(text, record) {
|
|
98
102
|
var _text$params, _text$params$ids, _record$result;
|
|
99
|
-
return /*#__PURE__*/React.createElement("div", null, text !== null && text !== void 0 && (_text$params = text.params) !== null && _text$params !== void 0 && (_text$params$ids = _text$params.ids) !== null && _text$params$ids !== void 0 && _text$params$ids.length ? getText(
|
|
103
|
+
return /*#__PURE__*/React.createElement("div", null, text !== null && text !== void 0 && (_text$params = text.params) !== null && _text$params !== void 0 && (_text$params$ids = _text$params.ids) !== null && _text$params$ids !== void 0 && _text$params$ids.length ? getText('table-action-export-import-file-content-part') : getText('table-action-export-import-file-content-all'), ' ', getText('table-action-export-import-file-record')("".concat((record === null || record === void 0 ? void 0 : (_record$result = record.result) === null || _record$result === void 0 ? void 0 : _record$result.total) || 0)));
|
|
100
104
|
}
|
|
101
105
|
}, {
|
|
102
|
-
title: getText(
|
|
103
|
-
dataIndex:
|
|
106
|
+
title: getText('table-action-export-import-file-status'),
|
|
107
|
+
dataIndex: 'status',
|
|
104
108
|
render: function render(text) {
|
|
105
109
|
return exportStatusOptions[text];
|
|
106
110
|
}
|
|
107
111
|
}, {
|
|
108
|
-
title: getText(
|
|
109
|
-
dataIndex:
|
|
112
|
+
title: getText('table-action-export-import-file-account'),
|
|
113
|
+
dataIndex: 'account',
|
|
110
114
|
render: function render(text) {
|
|
111
|
-
return text ? /*#__PURE__*/React.createElement("div", null, "".concat((text === null || text === void 0 ? void 0 : text.first_name) ||
|
|
115
|
+
return text ? /*#__PURE__*/React.createElement("div", null, "".concat((text === null || text === void 0 ? void 0 : text.first_name) || '', " ").concat((text === null || text === void 0 ? void 0 : text.last_name) || '')) : null;
|
|
112
116
|
}
|
|
113
117
|
}, {
|
|
114
|
-
title: getText(
|
|
115
|
-
dataIndex:
|
|
118
|
+
title: getText('table-action-export-import-file-created'),
|
|
119
|
+
dataIndex: 'created_at',
|
|
116
120
|
render: function render(text) {
|
|
117
121
|
return formatDate(text);
|
|
118
122
|
}
|
|
119
123
|
}];
|
|
120
124
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
121
|
-
className:
|
|
125
|
+
className: 'export-history-content'
|
|
122
126
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
123
127
|
spinning: _historyList === null || _historyList === void 0 ? void 0 : _historyList.loading
|
|
124
128
|
}, /*#__PURE__*/React.createElement("div", {
|
|
125
|
-
className:
|
|
126
|
-
}, getText(
|
|
129
|
+
className: 'content-hint'
|
|
130
|
+
}, getText('table-action-export-import-file-hint'), /*#__PURE__*/React.createElement("a", {
|
|
127
131
|
onClick: function onClick() {
|
|
128
132
|
return init();
|
|
129
133
|
}
|
|
130
|
-
}, getText(
|
|
134
|
+
}, getText('table-action-export-import-file-refresh'))), /*#__PURE__*/React.createElement(Table, {
|
|
131
135
|
rowClassName: "antd-table-row",
|
|
132
136
|
columns: columns,
|
|
133
137
|
dataSource: list,
|
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -45,7 +45,8 @@ var _batchExport = /*#__PURE__*/function () {
|
|
|
45
45
|
export var batchExport = function batchExport(exportParams, exportImport) {
|
|
46
46
|
var selectLists = exportImport.selectLists,
|
|
47
47
|
formId = exportImport.formId,
|
|
48
|
-
formCode = exportImport.formCode
|
|
48
|
+
formCode = exportImport.formCode,
|
|
49
|
+
apiUrl = exportImport.apiUrl;
|
|
49
50
|
var _name = getFileDateName();
|
|
50
51
|
var params = {};
|
|
51
52
|
if (formId) {
|
|
@@ -54,6 +55,7 @@ export var batchExport = function batchExport(exportParams, exportImport) {
|
|
|
54
55
|
if (formCode) {
|
|
55
56
|
params.code = formCode;
|
|
56
57
|
}
|
|
58
|
+
params.url = apiUrl;
|
|
57
59
|
console.log("exportParams", exportParams);
|
|
58
60
|
var type = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.type) || defaultOptions.exportType;
|
|
59
61
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExportImportType } from '../../../../../types';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare const ImportLog: (props: {
|
|
5
5
|
exportImport: ExportImportType;
|
|
6
6
|
}) => React.JSX.Element;
|
|
@@ -10,9 +10,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { useRequest } from
|
|
14
|
-
import { Spin, Table } from
|
|
15
|
-
import React, { useEffect, useRef, useState } from
|
|
13
|
+
import { useRequest } from 'ahooks';
|
|
14
|
+
import { Spin, Table } from 'antd';
|
|
15
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
16
16
|
import useEngineContext from "../../../../../../../hooks/useEngineContext";
|
|
17
17
|
import { getText } from "../../../../../../../locales/index";
|
|
18
18
|
import { historyData } from "../../../../../serve";
|
|
@@ -29,7 +29,8 @@ var defaultData = {
|
|
|
29
29
|
var ImportLog = function ImportLog(props) {
|
|
30
30
|
var exportImport = props.exportImport;
|
|
31
31
|
var formId = exportImport.formId,
|
|
32
|
-
formCode = exportImport.formCode
|
|
32
|
+
formCode = exportImport.formCode,
|
|
33
|
+
apiUrl = exportImport.apiUrl;
|
|
33
34
|
var detailRef = useRef(null);
|
|
34
35
|
var _useState = useState([]),
|
|
35
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -70,23 +71,26 @@ var ImportLog = function ImportLog(props) {
|
|
|
70
71
|
});
|
|
71
72
|
var init = function init() {
|
|
72
73
|
if (defaultParams !== null && defaultParams !== void 0 && defaultParams.form_id || defaultParams !== null && defaultParams !== void 0 && defaultParams.code) {
|
|
73
|
-
|
|
74
|
+
var _defaultParams = _objectSpread(_objectSpread({}, defaultParams), {}, {
|
|
75
|
+
url: apiUrl
|
|
76
|
+
});
|
|
77
|
+
_historyList.run(_defaultParams);
|
|
74
78
|
}
|
|
75
79
|
};
|
|
76
80
|
useEffect(function () {
|
|
77
81
|
init();
|
|
78
82
|
}, [defaultParams]);
|
|
79
83
|
var columns = [{
|
|
80
|
-
title: getText(
|
|
81
|
-
dataIndex:
|
|
84
|
+
title: getText('table-action-export-import-log-name'),
|
|
85
|
+
dataIndex: 'file_name'
|
|
82
86
|
}, {
|
|
83
|
-
title: getText(
|
|
84
|
-
dataIndex:
|
|
87
|
+
title: getText('table-action-export-import-log-result'),
|
|
88
|
+
dataIndex: 'result',
|
|
85
89
|
render: function render(text, record) {
|
|
86
90
|
var _record$result;
|
|
87
|
-
return /*#__PURE__*/React.createElement("div", null, getText(
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", null, getText('table-action-export-import-log-ok')((text === null || text === void 0 ? void 0 : text.success) || 0), record !== null && record !== void 0 && (_record$result = record.result) !== null && _record$result !== void 0 && _record$result.fail ? getText('table-action-export-import-log-err')((text === null || text === void 0 ? void 0 : text.fail) || 0) : null, text !== null && text !== void 0 && text.fail ? /*#__PURE__*/React.createElement("a", {
|
|
88
92
|
style: {
|
|
89
|
-
marginLeft:
|
|
93
|
+
marginLeft: '10px'
|
|
90
94
|
},
|
|
91
95
|
onClick: function onClick() {
|
|
92
96
|
var _detailRef$current, _detailRef$current$op;
|
|
@@ -94,32 +98,32 @@ var ImportLog = function ImportLog(props) {
|
|
|
94
98
|
list: [record]
|
|
95
99
|
});
|
|
96
100
|
}
|
|
97
|
-
}, getText(
|
|
101
|
+
}, getText('table-action-export-import-log-check')) : null);
|
|
98
102
|
}
|
|
99
103
|
}, {
|
|
100
|
-
title: getText(
|
|
101
|
-
dataIndex:
|
|
104
|
+
title: getText('table-action-export-import-file-account'),
|
|
105
|
+
dataIndex: 'account',
|
|
102
106
|
render: function render(text) {
|
|
103
|
-
return text ? /*#__PURE__*/React.createElement("div", null, "".concat((text === null || text === void 0 ? void 0 : text.first_name) ||
|
|
107
|
+
return text ? /*#__PURE__*/React.createElement("div", null, "".concat((text === null || text === void 0 ? void 0 : text.first_name) || '', " ").concat((text === null || text === void 0 ? void 0 : text.last_name) || '')) : null;
|
|
104
108
|
}
|
|
105
109
|
}, {
|
|
106
|
-
title: getText(
|
|
107
|
-
dataIndex:
|
|
110
|
+
title: getText('table-action-export-import-file-created'),
|
|
111
|
+
dataIndex: 'created_at',
|
|
108
112
|
render: function render(text) {
|
|
109
113
|
return formatDate(text);
|
|
110
114
|
}
|
|
111
115
|
}];
|
|
112
116
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
113
|
-
className:
|
|
117
|
+
className: 'export-history-content'
|
|
114
118
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
115
119
|
spinning: _historyList === null || _historyList === void 0 ? void 0 : _historyList.loading
|
|
116
120
|
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className:
|
|
118
|
-
}, getText(
|
|
121
|
+
className: 'content-hint'
|
|
122
|
+
}, getText('table-action-export-import-log-hint'), /*#__PURE__*/React.createElement("a", {
|
|
119
123
|
onClick: function onClick() {
|
|
120
124
|
return init();
|
|
121
125
|
}
|
|
122
|
-
}, getText(
|
|
126
|
+
}, getText('table-action-export-import-file-refresh'))), /*#__PURE__*/React.createElement(Table, {
|
|
123
127
|
rowClassName: "antd-table-row",
|
|
124
128
|
columns: columns,
|
|
125
129
|
dataSource: list,
|
package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExportImportType } from '../../../../../types';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare type ImportTableProps = {
|
|
5
5
|
onChange: any;
|
|
6
6
|
exportImport: ExportImportType;
|
|
@@ -8,9 +8,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
9
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import { InboxOutlined } from
|
|
12
|
-
import { Button, message } from
|
|
13
|
-
import React, { useMemo, useState } from
|
|
11
|
+
import { InboxOutlined } from '@ant-design/icons';
|
|
12
|
+
import { Button, message } from 'antd';
|
|
13
|
+
import React, { useMemo, useState } from 'react';
|
|
14
14
|
import useEngineContext from "../../../../../../../hooks/useEngineContext";
|
|
15
15
|
import { getText } from "../../../../../../../locales/index";
|
|
16
16
|
import IconFont from "../../../../../../iconfont";
|
|
@@ -26,7 +26,8 @@ var ImportTable = function ImportTable(props) {
|
|
|
26
26
|
errorStatus = props.errorStatus;
|
|
27
27
|
var formId = exportImport.formId,
|
|
28
28
|
formCode = exportImport.formCode,
|
|
29
|
-
templateFileUrl = exportImport.templateFileUrl
|
|
29
|
+
templateFileUrl = exportImport.templateFileUrl,
|
|
30
|
+
apiUrl = exportImport.apiUrl;
|
|
30
31
|
|
|
31
32
|
// 当前上传列表
|
|
32
33
|
var _useState = useState(null),
|
|
@@ -52,10 +53,12 @@ var ImportTable = function ImportTable(props) {
|
|
|
52
53
|
break;
|
|
53
54
|
case 4:
|
|
54
55
|
message.loading({
|
|
55
|
-
content:
|
|
56
|
+
content: 'Loading...',
|
|
56
57
|
key: loadingKey
|
|
57
58
|
});
|
|
58
|
-
params = {
|
|
59
|
+
params = {
|
|
60
|
+
url: apiUrl
|
|
61
|
+
};
|
|
59
62
|
if (formId) {
|
|
60
63
|
params.form_id = formId;
|
|
61
64
|
}
|
|
@@ -70,7 +73,7 @@ var ImportTable = function ImportTable(props) {
|
|
|
70
73
|
download(data === null || data === void 0 ? void 0 : data.url);
|
|
71
74
|
case 13:
|
|
72
75
|
message.success({
|
|
73
|
-
content: getText(
|
|
76
|
+
content: getText('table-action-export-import-table-success-download'),
|
|
74
77
|
key: loadingKey
|
|
75
78
|
});
|
|
76
79
|
case 14:
|
|
@@ -85,62 +88,62 @@ var ImportTable = function ImportTable(props) {
|
|
|
85
88
|
}();
|
|
86
89
|
var fileType = useMemo(function () {
|
|
87
90
|
if (file) {
|
|
88
|
-
return file.type.indexOf(
|
|
91
|
+
return file.type.indexOf('/csv') !== -1 ? 'csv' : 'excel';
|
|
89
92
|
}
|
|
90
|
-
return
|
|
93
|
+
return '';
|
|
91
94
|
}, [file]);
|
|
92
95
|
var fileName = useMemo(function () {
|
|
93
96
|
if (file) {
|
|
94
97
|
return file.name;
|
|
95
98
|
}
|
|
96
|
-
return
|
|
99
|
+
return '';
|
|
97
100
|
}, [file]);
|
|
98
101
|
var _handleSelectFile = function _handleSelectFile(e) {
|
|
99
102
|
var _e$target;
|
|
100
103
|
var _file = e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.files ? e.target.files[0] : null;
|
|
101
104
|
if (_file) {
|
|
102
|
-
if (_file.name.indexOf(
|
|
103
|
-
return message.error(getText(
|
|
105
|
+
if (_file.name.indexOf('.csv') === -1 && _file.name.indexOf('.xls') === -1 && _file.name.indexOf('.xlsx') === -1) {
|
|
106
|
+
return message.error(getText('table-action-export-import-table-error-file'));
|
|
104
107
|
}
|
|
105
108
|
onChange(_file);
|
|
106
109
|
setFile(_file);
|
|
107
110
|
}
|
|
108
111
|
};
|
|
109
112
|
return /*#__PURE__*/React.createElement(React.Fragment, null, errorStatus ? /*#__PURE__*/React.createElement("div", {
|
|
110
|
-
className:
|
|
113
|
+
className: 'error-hint'
|
|
111
114
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
112
115
|
type: "icontixingshixin",
|
|
113
|
-
className:
|
|
116
|
+
className: 'error-icon'
|
|
114
117
|
}), /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className:
|
|
118
|
+
className: 'text'
|
|
116
119
|
}, errorStatus)) : null, /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className:
|
|
118
|
-
}, getText(
|
|
120
|
+
className: 'import-title'
|
|
121
|
+
}, getText('table-action-export-import-table-text-click-download'), /*#__PURE__*/React.createElement("a", {
|
|
119
122
|
onClick: handleDownload
|
|
120
|
-
}, getText(
|
|
121
|
-
className:
|
|
123
|
+
}, getText('table-action-export-import-table-text-product-template'))), file ? /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
className: 'file-list'
|
|
122
125
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
123
|
-
type: fileType ===
|
|
124
|
-
className:
|
|
126
|
+
type: fileType === 'csv' ? 'icon-csv' : 'icon-excel',
|
|
127
|
+
className: 'file-icon'
|
|
125
128
|
}), /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className:
|
|
127
|
-
}, fileName), /*#__PURE__*/React.createElement(Button, null, getText(
|
|
129
|
+
className: 'file-name'
|
|
130
|
+
}, fileName), /*#__PURE__*/React.createElement(Button, null, getText('table-action-export-import-table-text-edit-file'), /*#__PURE__*/React.createElement("input", {
|
|
128
131
|
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
129
|
-
className:
|
|
132
|
+
className: 'upload-input',
|
|
130
133
|
type: "file",
|
|
131
134
|
onChange: _handleSelectFile,
|
|
132
135
|
value: ""
|
|
133
136
|
}))) : /*#__PURE__*/React.createElement("div", {
|
|
134
|
-
className:
|
|
137
|
+
className: 'default-view'
|
|
135
138
|
}, /*#__PURE__*/React.createElement("div", {
|
|
136
|
-
className:
|
|
139
|
+
className: 'icon-wrap'
|
|
137
140
|
}, /*#__PURE__*/React.createElement(InboxOutlined, null)), /*#__PURE__*/React.createElement("p", {
|
|
138
|
-
className:
|
|
139
|
-
}, getText(
|
|
140
|
-
className:
|
|
141
|
-
}, getText(
|
|
141
|
+
className: 'text'
|
|
142
|
+
}, getText('table-action-export-import-table-text-input-title')), /*#__PURE__*/React.createElement("p", {
|
|
143
|
+
className: 'hint'
|
|
144
|
+
}, getText('table-action-export-import-table-text-input-describe')), /*#__PURE__*/React.createElement("input", {
|
|
142
145
|
accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
|
|
143
|
-
className:
|
|
146
|
+
className: 'upload-input',
|
|
144
147
|
type: "file",
|
|
145
148
|
onChange: _handleSelectFile,
|
|
146
149
|
value: ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExportImportType } from '../../../types';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare type ExportImportProps = {
|
|
5
5
|
exportImport: ExportImportType;
|
|
6
6
|
};
|