@pisell/materials 1.0.404 → 1.0.405
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 +59 -16
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +62 -19
- package/es/components/browserSelect/chevron-down.png +0 -0
- package/es/components/browserSelect/index.d.ts +15 -0
- package/es/components/browserSelect/index.js +36 -0
- package/es/components/browserSelect/index.less +18 -0
- package/es/components/date-picker/constants.d.ts +39 -0
- package/es/components/date-picker/constants.js +76 -0
- package/es/components/date-picker/datePickerCpt.d.ts +8 -0
- package/es/components/date-picker/datePickerCpt.js +370 -0
- package/es/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
- package/es/components/date-picker/hooks/useMediaQuery.js +28 -0
- package/es/components/date-picker/index.js +2 -2
- package/es/components/date-picker/index.less +1880 -0
- package/es/components/drag-sort-tree/index.d.ts +0 -1
- package/es/components/drag-sort-tree/index.js +2 -1
- package/es/components/picker-view/index.d.ts +2 -0
- package/es/components/picker-view/index.js +2 -0
- package/es/components/pisell-config-provider/index.js +2 -0
- package/es/components/pisellModal/components/functions/index.d.ts +23 -5
- package/es/components/pisellModal/components/functions/index.js +7 -2
- package/es/components/pisellModal/index.d.ts +20 -5
- package/es/components/pisellTags/index.d.ts +13 -0
- package/es/components/pisellTags/index.js +83 -0
- package/es/components/pisellTags/index.less +17 -0
- package/es/components/pisellTags/utils.d.ts +1 -0
- package/es/components/pisellTags/utils.js +89 -0
- 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 +32 -25
- package/es/components/table/BasicTable/index.js +5 -3
- package/es/components/table/Gallery/index.js +2 -1
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +13 -11
- package/es/components/table/Table/index.d.ts +2 -2
- package/es/components/table/Table/index.js +68 -42
- package/es/components/table/Table/index.less +3 -0
- package/es/components/table/Table/utils.d.ts +14 -2
- package/es/components/table/Table/utils.js +6 -2
- package/es/components/table/View/index.d.ts +2 -2
- package/es/components/table/View/index.js +27 -16
- package/es/components/table/hooks/useGenScroll.js +1 -1
- package/es/components/table/hooks/useTableSetting.js +29 -7
- package/es/components/table/hooks/useTransDataSource.d.ts +1 -0
- package/es/components/table/hooks/useTransDataSource.js +8 -6
- package/es/components/table/index.js +7 -5
- package/es/components/table/index.less +9 -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/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/locales/en-US.d.ts +12 -0
- package/es/locales/en-US.js +13 -0
- package/es/locales/zh-CN.d.ts +12 -0
- package/es/locales/zh-CN.js +13 -0
- package/es/locales/zh-TW.d.ts +12 -0
- package/es/locales/zh-TW.js +13 -0
- package/lib/components/browserSelect/chevron-down.png +0 -0
- package/lib/components/browserSelect/index.d.ts +15 -0
- package/lib/components/browserSelect/index.js +59 -0
- package/lib/components/browserSelect/index.less +18 -0
- package/lib/components/date-picker/constants.d.ts +39 -0
- package/lib/components/date-picker/constants.js +78 -0
- package/lib/components/date-picker/datePickerCpt.d.ts +8 -0
- package/lib/components/date-picker/datePickerCpt.js +403 -0
- package/lib/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
- package/lib/components/date-picker/hooks/useMediaQuery.js +43 -0
- package/lib/components/date-picker/index.js +2 -2
- package/lib/components/date-picker/index.less +1880 -0
- package/lib/components/drag-sort-tree/index.d.ts +0 -1
- package/lib/components/drag-sort-tree/index.js +0 -1
- package/lib/components/picker-view/index.d.ts +2 -0
- package/lib/components/picker-view/index.js +36 -0
- package/lib/components/pisell-config-provider/index.js +2 -0
- package/lib/components/pisellModal/components/functions/index.d.ts +23 -5
- package/lib/components/pisellModal/components/functions/index.js +13 -7
- package/lib/components/pisellModal/index.d.ts +20 -5
- package/lib/components/pisellTags/index.d.ts +13 -0
- package/lib/components/pisellTags/index.js +113 -0
- package/lib/components/pisellTags/index.less +17 -0
- package/lib/components/pisellTags/utils.d.ts +1 -0
- package/lib/components/pisellTags/utils.js +86 -0
- 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 +13 -8
- package/lib/components/table/BasicTable/index.js +2 -3
- package/lib/components/table/Gallery/index.js +2 -1
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +1 -9
- package/lib/components/table/Table/index.d.ts +2 -2
- package/lib/components/table/Table/index.js +61 -34
- package/lib/components/table/Table/index.less +3 -0
- package/lib/components/table/Table/utils.d.ts +14 -2
- package/lib/components/table/Table/utils.js +7 -1
- package/lib/components/table/View/index.d.ts +2 -2
- package/lib/components/table/View/index.js +28 -19
- package/lib/components/table/hooks/useGenScroll.js +1 -1
- package/lib/components/table/hooks/useTableSetting.js +26 -11
- package/lib/components/table/hooks/useTransDataSource.d.ts +1 -0
- package/lib/components/table/hooks/useTransDataSource.js +6 -5
- package/lib/components/table/index.js +4 -4
- package/lib/components/table/index.less +9 -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/lib/index.d.ts +3 -1
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +12 -0
- package/lib/locales/en-US.js +13 -0
- package/lib/locales/zh-CN.d.ts +12 -0
- package/lib/locales/zh-CN.js +13 -0
- package/lib/locales/zh-TW.d.ts +12 -0
- package/lib/locales/zh-TW.js +13 -0
- package/package.json +1 -1
- 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
|
@@ -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
|
};
|
|
@@ -8,10 +8,10 @@ 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 ImportExport from
|
|
12
|
-
import { useRequest } from
|
|
13
|
-
import { Dropdown, Modal, message } from
|
|
14
|
-
import React, { useMemo, useState } from
|
|
11
|
+
import ImportExport from '@pisell/icon/es/ImportExport';
|
|
12
|
+
import { useRequest } from 'ahooks';
|
|
13
|
+
import { Dropdown, Modal, message } from 'antd';
|
|
14
|
+
import React, { useMemo, useState } from 'react';
|
|
15
15
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
16
16
|
import { getText } from "../../../../../locales/index";
|
|
17
17
|
import { batchImport } from "../../../serve";
|
|
@@ -47,7 +47,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
47
47
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
48
|
type = _useState6[0],
|
|
49
49
|
setType = _useState6[1];
|
|
50
|
-
var _useState7 = useState(
|
|
50
|
+
var _useState7 = useState(''),
|
|
51
51
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
52
52
|
value = _useState8[0],
|
|
53
53
|
setValue = _useState8[1];
|
|
@@ -62,22 +62,28 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
62
62
|
var context = useEngineContext();
|
|
63
63
|
request.setRequest(context.appHelper.utils.request);
|
|
64
64
|
var _items = useMemo(function () {
|
|
65
|
+
var _Object$entries$map;
|
|
65
66
|
// 将对象转成数组
|
|
66
|
-
var result = Object.entries(exportImportOptions).map(function (_ref2) {
|
|
67
|
+
var result = (_Object$entries$map = Object.entries(exportImportOptions).map(function (_ref2) {
|
|
68
|
+
var _exportImport$hiddenK;
|
|
67
69
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
68
70
|
key = _ref3[0],
|
|
69
71
|
value = _ref3[1];
|
|
72
|
+
// 如果开启了隐藏字段则不显示该字段
|
|
73
|
+
if (Array.isArray(exportImport === null || exportImport === void 0 ? void 0 : exportImport.hiddenKeys) && exportImport !== null && exportImport !== void 0 && (_exportImport$hiddenK = exportImport.hiddenKeys) !== null && _exportImport$hiddenK !== void 0 && _exportImport$hiddenK.includes(key)) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
70
76
|
return {
|
|
71
77
|
key: key,
|
|
72
78
|
label: value
|
|
73
79
|
};
|
|
74
|
-
});
|
|
80
|
+
})) === null || _Object$entries$map === void 0 ? void 0 : _Object$entries$map.filter(Boolean);
|
|
75
81
|
return result;
|
|
76
|
-
}, []);
|
|
82
|
+
}, [exportImport === null || exportImport === void 0 ? void 0 : exportImport.hiddenKeys]);
|
|
77
83
|
var Content = useMemo(function () {
|
|
78
|
-
|
|
79
|
-
return Com[
|
|
80
|
-
}, [value]);
|
|
84
|
+
var _value = value || defaultOptions.importValue;
|
|
85
|
+
return Com[_value];
|
|
86
|
+
}, [value, defaultOptions.importValue]);
|
|
81
87
|
var _footer = useMemo(function () {
|
|
82
88
|
var types = defaultOptions.footerHintTypes;
|
|
83
89
|
if (types.includes(value)) {
|
|
@@ -92,18 +98,18 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
92
98
|
if (!value) return null;
|
|
93
99
|
var types = defaultOptions.okShowButtonTypes;
|
|
94
100
|
var lang = getCurrentLocale();
|
|
95
|
-
var isEn = lang ===
|
|
101
|
+
var isEn = lang === 'en-US' || lang === 'en';
|
|
96
102
|
|
|
97
103
|
// 导出导入标题
|
|
98
104
|
if (types.includes(value) && exportImport !== null && exportImport !== void 0 && exportImport.title) {
|
|
99
|
-
return "".concat(exportImportOptions[value]).concat(isEn ?
|
|
105
|
+
return "".concat(exportImportOptions[value]).concat(isEn ? ' ' : '').concat(exportImport.title);
|
|
100
106
|
}
|
|
101
107
|
return exportImportOptions[value];
|
|
102
108
|
}, [value, exportImport === null || exportImport === void 0 ? void 0 : exportImport.title]);
|
|
103
109
|
var _okText = useMemo(function () {
|
|
104
110
|
var types = defaultOptions.okShowButtonTypes;
|
|
105
111
|
if (types.includes(value)) {
|
|
106
|
-
return value === defaultOptions.exportValue ? getText(
|
|
112
|
+
return value === defaultOptions.exportValue ? getText('table-action-export-import-button') : getText('table-action-export-import-button-import');
|
|
107
113
|
}
|
|
108
114
|
}, [value]);
|
|
109
115
|
var handleClick = function handleClick(e) {
|
|
@@ -113,7 +119,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
113
119
|
};
|
|
114
120
|
var onCancel = function onCancel() {
|
|
115
121
|
setOpen(false);
|
|
116
|
-
setValue(
|
|
122
|
+
setValue('');
|
|
117
123
|
setFile(null);
|
|
118
124
|
setErrorStatus(null);
|
|
119
125
|
setType(defaultOptions.exportType);
|
|
@@ -125,7 +131,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
125
131
|
setErrorStatus(null);
|
|
126
132
|
message.destroy();
|
|
127
133
|
message.success({
|
|
128
|
-
content: getText(
|
|
134
|
+
content: getText('table-action-export-import-import-success'),
|
|
129
135
|
key: value
|
|
130
136
|
});
|
|
131
137
|
onCancel();
|
|
@@ -137,11 +143,11 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
137
143
|
});
|
|
138
144
|
var onOk = /*#__PURE__*/function () {
|
|
139
145
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
140
|
-
var formId, formCode, _params, result, formData;
|
|
146
|
+
var formId, formCode, apiUrl, _params, result, formData;
|
|
141
147
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
142
148
|
while (1) switch (_context.prev = _context.next) {
|
|
143
149
|
case 0:
|
|
144
|
-
formId = exportImport.formId, formCode = exportImport.formCode; // 导出
|
|
150
|
+
formId = exportImport.formId, formCode = exportImport.formCode, apiUrl = exportImport.apiUrl; // 导出
|
|
145
151
|
if (!(value === defaultOptions.exportValue)) {
|
|
146
152
|
_context.next = 9;
|
|
147
153
|
break;
|
|
@@ -163,16 +169,17 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
163
169
|
case 9:
|
|
164
170
|
if (value === defaultOptions.importValue) {
|
|
165
171
|
formData = new FormData();
|
|
166
|
-
formData.append(
|
|
172
|
+
formData.append('file', file);
|
|
167
173
|
if (formId) {
|
|
168
|
-
formData.append(
|
|
174
|
+
formData.append('form_id', formId);
|
|
169
175
|
}
|
|
170
176
|
if (formCode) {
|
|
171
|
-
formData.append(
|
|
177
|
+
formData.append('code', formCode);
|
|
172
178
|
}
|
|
179
|
+
formData.append('url', apiUrl || '');
|
|
173
180
|
if (formData) {
|
|
174
181
|
message.loading({
|
|
175
|
-
content:
|
|
182
|
+
content: 'Loading...',
|
|
176
183
|
key: value
|
|
177
184
|
});
|
|
178
185
|
_batchImport.run(formData);
|
|
@@ -199,7 +206,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
199
206
|
isActive: false
|
|
200
207
|
}, /*#__PURE__*/React.createElement(ImportExport, {
|
|
201
208
|
style: {
|
|
202
|
-
cursor:
|
|
209
|
+
cursor: 'pointer',
|
|
203
210
|
fontSize: 20
|
|
204
211
|
}
|
|
205
212
|
}))), /*#__PURE__*/React.createElement(Modal, {
|
|
@@ -211,11 +218,11 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
211
218
|
className: "export-import-modal",
|
|
212
219
|
onCancel: onCancel,
|
|
213
220
|
bodyStyle: {
|
|
214
|
-
padding:
|
|
221
|
+
padding: '0px'
|
|
215
222
|
},
|
|
216
223
|
destroyOnClose: true,
|
|
217
224
|
onOk: onOk,
|
|
218
|
-
cancelText: getText(
|
|
225
|
+
cancelText: getText('table-action-export-import-cancel'),
|
|
219
226
|
okButtonProps: {
|
|
220
227
|
disabled: value === defaultOptions.importValue && (!file || !!errorStatus)
|
|
221
228
|
}
|
|
@@ -84,7 +84,6 @@ var BasicTable = function BasicTable(props) {
|
|
|
84
84
|
total: _total
|
|
85
85
|
};
|
|
86
86
|
}, [localPagination, dataSource, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size, filter, sort, other.columns]);
|
|
87
|
-
console.log(pagination, 'wh8888');
|
|
88
87
|
|
|
89
88
|
// 总数
|
|
90
89
|
var total = useMemo(function () {
|
|
@@ -110,7 +109,7 @@ var BasicTable = function BasicTable(props) {
|
|
|
110
109
|
type: 'setCurrentDataSource',
|
|
111
110
|
payload: (_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list) || []
|
|
112
111
|
});
|
|
113
|
-
}, [_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list]);
|
|
112
|
+
}, [JSON.stringify(_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list)]);
|
|
114
113
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, _extends({
|
|
115
114
|
key: defaultExpandedRowKeys.join('-')
|
|
116
115
|
}, other, {
|
|
@@ -140,7 +139,10 @@ var BasicTable = function BasicTable(props) {
|
|
|
140
139
|
defaultExpandAllRows: true
|
|
141
140
|
}
|
|
142
141
|
})), total > ((pagination === null || pagination === void 0 ? void 0 : pagination.pageSize) || (pagination === null || pagination === void 0 ? void 0 : (_pagination$pageSizeO = pagination.pageSizeOptions) === null || _pagination$pageSizeO === void 0 ? void 0 : _pagination$pageSizeO[0]) || 10) || pagination !== null && pagination !== void 0 && pagination.showPagination && total > 10 ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
143
|
-
name: "pagination"
|
|
142
|
+
name: "pagination",
|
|
143
|
+
style: {
|
|
144
|
+
margin: 0
|
|
145
|
+
}
|
|
144
146
|
}, /*#__PURE__*/React.createElement(FormPagination, _extends({}, pagination, {
|
|
145
147
|
showTotal: _showTotal,
|
|
146
148
|
total: total
|
|
@@ -46,7 +46,8 @@ var Gallery = function Gallery(props) {
|
|
|
46
46
|
form: form,
|
|
47
47
|
localPagination: !!(pagination !== null && pagination !== void 0 && pagination.localPagination),
|
|
48
48
|
rowKey: rowKey,
|
|
49
|
-
filter: filter
|
|
49
|
+
filter: filter,
|
|
50
|
+
currentView: 'gallery'
|
|
50
51
|
});
|
|
51
52
|
useEffect(function () {
|
|
52
53
|
onDataSourceChange === null || onDataSourceChange === void 0 ? void 0 : onDataSourceChange(dataSource);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["value", "onChange", "onPressEnter", "onBlur", "style", "bordered", "presets", "showTime", "format"];
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -5,10 +6,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
5
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
8
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
9
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
import { isArr,
|
|
11
|
+
import { isArr, isString } from "@pisell/utils";
|
|
12
12
|
import dayjs from "dayjs";
|
|
13
13
|
import React, { forwardRef, useMemo } from "react";
|
|
14
14
|
import DatePicker from "../../../../../date-picker";
|
|
@@ -64,17 +64,19 @@ var Edit = function Edit(props, ref) {
|
|
|
64
64
|
label: getText("table-action-range-picker-presets-last-90-day"),
|
|
65
65
|
value: [dayjs().add(-90, "d").startOf("day"), dayjs().endOf("day")]
|
|
66
66
|
}];
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
|
|
68
|
+
// const _showTime = useMemo(() => {
|
|
69
|
+
// if (isBoolean(showTime)) {
|
|
70
|
+
// return showTime;
|
|
71
|
+
// } else if (typeof showTime === "object") {
|
|
72
|
+
// return showTime;
|
|
73
|
+
// }
|
|
74
|
+
// return true;
|
|
75
|
+
// }, [showTime]);
|
|
76
|
+
|
|
75
77
|
return /*#__PURE__*/React.createElement(RangePicker, _extends({}, others, {
|
|
76
78
|
format: format,
|
|
77
|
-
showTime:
|
|
79
|
+
showTime: showTime,
|
|
78
80
|
presets: presets || rangePresets,
|
|
79
81
|
ref: ref,
|
|
80
82
|
value: dayjsVal,
|
|
@@ -11,10 +11,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
11
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
13
|
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; }
|
|
14
|
-
import React, { memo, useCallback, useEffect, useMemo, useRef } from
|
|
15
|
-
import { Form } from
|
|
14
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
15
|
+
import { Form } from 'antd';
|
|
16
16
|
// import { Access } from '@umijs/max';
|
|
17
|
-
import { useMemoizedFn, useSize } from
|
|
17
|
+
import { useDebounce, useMemoizedFn, useSize } from 'ahooks';
|
|
18
18
|
import { Context } from "../model";
|
|
19
19
|
// import AddFieldModal from "./AddFieldModal";
|
|
20
20
|
import BasicTable from "../BasicTable";
|
|
@@ -25,26 +25,23 @@ import useTransDataSource from "../hooks/useTransDataSource";
|
|
|
25
25
|
import useTransColumns from "../hooks/useTransColumns";
|
|
26
26
|
import useGenTableComponents from "../hooks/useGenTableComponents";
|
|
27
27
|
import useGenScroll from "../hooks/useGenScroll";
|
|
28
|
-
import { useSharedState
|
|
28
|
+
import { useSharedState } from "../../../hooks";
|
|
29
29
|
import "./index.less";
|
|
30
30
|
var GridViewTable = function GridViewTable(_ref) {
|
|
31
|
-
var _tableProps$paginatio, _tableProps$paginatio2
|
|
31
|
+
var _tableProps$paginatio, _tableProps$paginatio2;
|
|
32
32
|
var tableProps = _ref.tableProps,
|
|
33
33
|
filter = _ref.filter,
|
|
34
34
|
setTableSetting = _ref.setTableSetting,
|
|
35
35
|
onDataSourceChange = _ref.onDataSourceChange;
|
|
36
|
-
var responsive = useResponsive();
|
|
37
36
|
var _useSharedState = useSharedState(Context),
|
|
38
37
|
state = _useSharedState.state,
|
|
39
38
|
dispatch = _useSharedState.dispatch;
|
|
40
39
|
var form = Form.useFormInstance();
|
|
41
|
-
var column_setting = Form.useWatch(
|
|
40
|
+
var column_setting = Form.useWatch('column_setting', {
|
|
42
41
|
form: form,
|
|
43
42
|
preserve: true
|
|
44
43
|
}) || [];
|
|
45
44
|
var tableWrapRef = useRef(null);
|
|
46
|
-
var _ref2 = useSize(tableWrapRef) || {},
|
|
47
|
-
height = _ref2.height;
|
|
48
45
|
var defaultDataSource = state.dataSource,
|
|
49
46
|
originDataSource = state.originDataSource;
|
|
50
47
|
var handleSave = useMemoizedFn(function (row) {
|
|
@@ -55,18 +52,18 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
55
52
|
var item = newData[index];
|
|
56
53
|
newData.splice(index, 1, _objectSpread(_objectSpread({}, item), row));
|
|
57
54
|
dispatch({
|
|
58
|
-
type:
|
|
55
|
+
type: 'setDataSource',
|
|
59
56
|
payload: newData
|
|
60
57
|
});
|
|
61
58
|
});
|
|
62
59
|
var handleResize = function handleResize(index) {
|
|
63
|
-
return function (e,
|
|
64
|
-
var size =
|
|
60
|
+
return function (e, _ref2) {
|
|
61
|
+
var size = _ref2.size;
|
|
65
62
|
var nextColumns = _toConsumableArray(columns);
|
|
66
63
|
nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
|
|
67
64
|
width: size.width
|
|
68
65
|
});
|
|
69
|
-
form.setFieldValue(
|
|
66
|
+
form.setFieldValue('column_setting', nextColumns);
|
|
70
67
|
setTableSetting(form.getFieldsValue());
|
|
71
68
|
};
|
|
72
69
|
};
|
|
@@ -85,11 +82,12 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
85
82
|
form: form,
|
|
86
83
|
localPagination: !!(tableProps !== null && tableProps !== void 0 && (_tableProps$paginatio2 = tableProps.pagination) !== null && _tableProps$paginatio2 !== void 0 && _tableProps$paginatio2.localPagination),
|
|
87
84
|
rowKey: tableProps.rowKey,
|
|
88
|
-
filter: filter
|
|
85
|
+
filter: filter,
|
|
86
|
+
currentView: 'table'
|
|
89
87
|
});
|
|
90
88
|
useEffect(function () {
|
|
91
89
|
dispatch({
|
|
92
|
-
type:
|
|
90
|
+
type: 'setOriginResultDataSource',
|
|
93
91
|
payload: dataSource || []
|
|
94
92
|
});
|
|
95
93
|
}, [dataSource]);
|
|
@@ -99,24 +97,10 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
99
97
|
var components = useGenTableComponents({
|
|
100
98
|
form: form
|
|
101
99
|
});
|
|
102
|
-
var isShowPagination = useMemo(function () {
|
|
103
|
-
var _tableProps$paginatio3, _tableProps$paginatio4, _tableProps$paginatio5, _tableProps$paginatio6;
|
|
104
|
-
var total = (tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio3 = tableProps.pagination) === null || _tableProps$paginatio3 === void 0 ? void 0 : _tableProps$paginatio3.total) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0;
|
|
105
|
-
if (tableProps !== null && tableProps !== void 0 && (_tableProps$paginatio4 = tableProps.pagination) !== null && _tableProps$paginatio4 !== void 0 && _tableProps$paginatio4.localPagination) {
|
|
106
|
-
total = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0;
|
|
107
|
-
}
|
|
108
|
-
return total > ((tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio5 = tableProps.pagination) === null || _tableProps$paginatio5 === void 0 ? void 0 : (_tableProps$paginatio6 = _tableProps$paginatio5.pageSizeOptions) === null || _tableProps$paginatio6 === void 0 ? void 0 : _tableProps$paginatio6[0]) || 10);
|
|
109
|
-
}, [tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio7 = tableProps.pagination) === null || _tableProps$paginatio7 === void 0 ? void 0 : _tableProps$paginatio7.localPagination, tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio8 = tableProps.pagination) === null || _tableProps$paginatio8 === void 0 ? void 0 : _tableProps$paginatio8.total, dataSource.length, tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio9 = tableProps.pagination) === null || _tableProps$paginatio9 === void 0 ? void 0 : (_tableProps$paginatio10 = _tableProps$paginatio9.pageSizeOptions) === null || _tableProps$paginatio10 === void 0 ? void 0 : _tableProps$paginatio10[0]]);
|
|
110
|
-
var scroll = useGenScroll({
|
|
111
|
-
wrapHeight: height || 500,
|
|
112
|
-
scroll: tableProps.scroll,
|
|
113
|
-
columns: columns,
|
|
114
|
-
isShowPagination: isShowPagination
|
|
115
|
-
});
|
|
116
100
|
var showTotal = useCallback(function (total, range, pageSize) {
|
|
117
101
|
var start = range[0] - 1;
|
|
118
102
|
var _current = start / pageSize + 1;
|
|
119
|
-
return getText(
|
|
103
|
+
return getText('table-pagination-total')(_current, Math.ceil(total / pageSize));
|
|
120
104
|
}, []);
|
|
121
105
|
var _paginationConfig = useMemo(function () {
|
|
122
106
|
if (tableProps.pagination === false) {
|
|
@@ -125,22 +109,64 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
125
109
|
return _objectSpread(_objectSpread(_objectSpread({}, paginationConfig), tableProps.pagination), {}, {
|
|
126
110
|
showTotal: showTotal
|
|
127
111
|
});
|
|
128
|
-
}, [
|
|
112
|
+
}, [tableProps.pagination]);
|
|
129
113
|
return /*#__PURE__*/React.createElement("div", {
|
|
130
|
-
className:
|
|
114
|
+
className: 'materials-grid-table-wrap',
|
|
131
115
|
ref: tableWrapRef
|
|
132
|
-
}, /*#__PURE__*/React.createElement(
|
|
133
|
-
|
|
134
|
-
onSortChange: tableProps.onSortChange
|
|
135
|
-
}, /*#__PURE__*/React.createElement(BasicTable, _extends({
|
|
136
|
-
key: scroll === null || scroll === void 0 ? void 0 : scroll.y,
|
|
116
|
+
}, /*#__PURE__*/React.createElement(AutoSizerContent, {
|
|
117
|
+
tableWrapRef: tableWrapRef,
|
|
137
118
|
dataSource: dataSource,
|
|
119
|
+
tableProps: tableProps,
|
|
138
120
|
columns: columns,
|
|
139
|
-
|
|
121
|
+
paginationConfig: _paginationConfig,
|
|
140
122
|
components: components
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
123
|
+
}));
|
|
124
|
+
};
|
|
125
|
+
var AutoSizerContent = function AutoSizerContent(props) {
|
|
126
|
+
var _tableProps$paginatio9, _tableProps$paginatio10, _tableProps$paginatio11, _tableProps$paginatio12;
|
|
127
|
+
var tableProps = props.tableProps,
|
|
128
|
+
dataSource = props.dataSource,
|
|
129
|
+
paginationConfig = props.paginationConfig,
|
|
130
|
+
columns = props.columns,
|
|
131
|
+
components = props.components,
|
|
132
|
+
tableWrapRef = props.tableWrapRef;
|
|
133
|
+
var _ref3 = useSize(tableWrapRef) || {},
|
|
134
|
+
height = _ref3.height;
|
|
135
|
+
var debouncedHeight = useDebounce(height, {
|
|
136
|
+
wait: 500
|
|
137
|
+
});
|
|
138
|
+
var isShowPagination = useMemo(function () {
|
|
139
|
+
var _tableProps$paginatio3, _tableProps$paginatio4, _tableProps$paginatio5, _tableProps$paginatio6, _tableProps$paginatio7, _tableProps$paginatio8;
|
|
140
|
+
var total = (tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio3 = tableProps.pagination) === null || _tableProps$paginatio3 === void 0 ? void 0 : _tableProps$paginatio3.total) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0;
|
|
141
|
+
if (tableProps !== null && tableProps !== void 0 && (_tableProps$paginatio4 = tableProps.pagination) !== null && _tableProps$paginatio4 !== void 0 && _tableProps$paginatio4.localPagination) {
|
|
142
|
+
total = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0;
|
|
143
|
+
}
|
|
144
|
+
return total > ((tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio5 = tableProps.pagination) === null || _tableProps$paginatio5 === void 0 ? void 0 : _tableProps$paginatio5.pageSize) || (tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio6 = tableProps.pagination) === null || _tableProps$paginatio6 === void 0 ? void 0 : (_tableProps$paginatio7 = _tableProps$paginatio6.pageSizeOptions) === null || _tableProps$paginatio7 === void 0 ? void 0 : _tableProps$paginatio7[0]) || 10) || (tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio8 = tableProps.pagination) === null || _tableProps$paginatio8 === void 0 ? void 0 : _tableProps$paginatio8.showPagination) && total > 10;
|
|
145
|
+
}, [tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio9 = tableProps.pagination) === null || _tableProps$paginatio9 === void 0 ? void 0 : _tableProps$paginatio9.localPagination, tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio10 = tableProps.pagination) === null || _tableProps$paginatio10 === void 0 ? void 0 : _tableProps$paginatio10.total, dataSource.length, tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$paginatio11 = tableProps.pagination) === null || _tableProps$paginatio11 === void 0 ? void 0 : (_tableProps$paginatio12 = _tableProps$paginatio11.pageSizeOptions) === null || _tableProps$paginatio12 === void 0 ? void 0 : _tableProps$paginatio12[0]]);
|
|
146
|
+
var scroll = useGenScroll({
|
|
147
|
+
wrapHeight: debouncedHeight || 500,
|
|
148
|
+
scroll: tableProps.scroll,
|
|
149
|
+
columns: columns,
|
|
150
|
+
isShowPagination: isShowPagination
|
|
151
|
+
});
|
|
152
|
+
var debouncedScroll = useDebounce(scroll, {
|
|
153
|
+
wait: 200
|
|
154
|
+
});
|
|
155
|
+
var basicTable = useMemo(function () {
|
|
156
|
+
return /*#__PURE__*/React.createElement(BasicTable, _extends({
|
|
157
|
+
key: debouncedScroll,
|
|
158
|
+
dataSource: dataSource,
|
|
159
|
+
columns: columns,
|
|
160
|
+
className: 'grid-view-table',
|
|
161
|
+
components: components
|
|
162
|
+
}, tableProps, {
|
|
163
|
+
scroll: debouncedScroll,
|
|
164
|
+
pagination: paginationConfig
|
|
165
|
+
}));
|
|
166
|
+
}, [debouncedScroll, dataSource, columns, components, paginationConfig, tableProps]);
|
|
167
|
+
return /*#__PURE__*/React.createElement(SortRow, {
|
|
168
|
+
rowKey: tableProps.rowKey,
|
|
169
|
+
onSortChange: tableProps.onSortChange
|
|
170
|
+
}, basicTable);
|
|
145
171
|
};
|
|
146
172
|
export default /*#__PURE__*/memo(GridViewTable);
|
|
@@ -81,7 +81,10 @@ export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj,
|
|
|
81
81
|
}>;
|
|
82
82
|
currentViewMode: ModeType;
|
|
83
83
|
currentSettingHash: string;
|
|
84
|
-
}) =>
|
|
84
|
+
}) => {
|
|
85
|
+
key: string;
|
|
86
|
+
value: Record<string, any>;
|
|
87
|
+
} | undefined;
|
|
85
88
|
export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
|
|
86
89
|
/**
|
|
87
90
|
* 从本地存储中获取表格设置, 全部配置
|
|
@@ -112,7 +115,16 @@ export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, c
|
|
|
112
115
|
keys?: string[] | undefined;
|
|
113
116
|
currentViewMode: ModeType;
|
|
114
117
|
currentSettingHash: string;
|
|
115
|
-
}) =>
|
|
118
|
+
}) => {
|
|
119
|
+
key: string;
|
|
120
|
+
value: Record<string, any>;
|
|
121
|
+
} | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* 获取表格键值
|
|
124
|
+
* @param tableId 表格ID
|
|
125
|
+
* @returns 返回格式化后的表格键值
|
|
126
|
+
*/
|
|
127
|
+
export declare const getTableKey: (tableId: string) => string;
|
|
116
128
|
/**
|
|
117
129
|
* 合并筛选设置
|
|
118
130
|
* @param list 列表数据
|