@vtx/components 4.0.0-beta.71 → 4.0.0-beta.72

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.
Files changed (88) hide show
  1. package/README.md +19 -19
  2. package/es/utils/components/LabelIconTip/index.js +7 -7
  3. package/es/utils/conversionMomentValue/index.js +25 -25
  4. package/es/utils/filterSpecialCharacters.js +6 -6
  5. package/es/utils/genCopyable/index.js +6 -6
  6. package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  7. package/es/utils/hooks/useDebounceFn/index.js +4 -4
  8. package/es/utils/hooks/useDebounceValue/index.js +6 -6
  9. package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
  10. package/es/utils/hooks/useLatest/index.js +2 -2
  11. package/es/utils/hooks/useRefCallback/index.js +5 -5
  12. package/es/utils/isBrowser/index.js +7 -7
  13. package/es/utils/isUrl/index.js +4 -4
  14. package/es/utils/merge/index.js +4 -4
  15. package/es/utils/nanoid/index.js +4 -4
  16. package/es/utils/omitBoolean/index.js +4 -4
  17. package/es/utils/parseValueToMoment/index.js +4 -4
  18. package/es/utils/proFieldParsingText/index.js +10 -10
  19. package/es/utils/transformKeySubmitValue/index.js +57 -57
  20. package/es/utils/useEditableArray/index.js +46 -46
  21. package/es/utils/useEditableMap/index.js +22 -22
  22. package/es/utils/useMediaQuery/index.js +5 -5
  23. package/es/vtx-datagrid/Store/Provide.js +3 -10
  24. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  25. package/es/vtx-datagrid/columnState.js +28 -1
  26. package/es/vtx-datagrid/index.js +26 -8
  27. package/es/vtx-datagrid/style/index.less +242 -242
  28. package/es/vtx-date-picker/style/index.less +39 -39
  29. package/es/vtx-export/index.js +8 -8
  30. package/es/vtx-icon/index.js1 +90 -90
  31. package/es/vtx-import/index.js +57 -29
  32. package/es/vtx-import/result.js +22 -24
  33. package/es/vtx-modal/index.js +2 -2
  34. package/es/vtx-page-layout/Basic.js +2 -2
  35. package/es/vtx-page-layout/TabLayout.js +6 -6
  36. package/es/vtx-page-layout/TableLayout.js +10 -10
  37. package/es/vtx-page-layout/TreeLayout.js +6 -6
  38. package/es/vtx-page-layout/container.js +2 -2
  39. package/es/vtx-provider/index.js +30 -30
  40. package/es/vtx-provider/intl.js +9 -9
  41. package/es/vtx-provider/locale/en_US.js +2 -0
  42. package/es/vtx-provider/locale/zh_CN.js +2 -0
  43. package/es/vtx-provider/useStyle/index.js +17 -17
  44. package/es/vtx-wang-editor/style/index.less +12 -12
  45. package/lib/utils/components/LabelIconTip/index.js +7 -7
  46. package/lib/utils/conversionMomentValue/index.js +25 -25
  47. package/lib/utils/filterSpecialCharacters.js +6 -6
  48. package/lib/utils/genCopyable/index.js +6 -6
  49. package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  50. package/lib/utils/hooks/useDebounceFn/index.js +4 -4
  51. package/lib/utils/hooks/useDebounceValue/index.js +6 -6
  52. package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
  53. package/lib/utils/hooks/useLatest/index.js +2 -2
  54. package/lib/utils/hooks/useRefCallback/index.js +5 -5
  55. package/lib/utils/isBrowser/index.js +7 -7
  56. package/lib/utils/isUrl/index.js +4 -4
  57. package/lib/utils/merge/index.js +4 -4
  58. package/lib/utils/nanoid/index.js +4 -4
  59. package/lib/utils/omitBoolean/index.js +4 -4
  60. package/lib/utils/parseValueToMoment/index.js +4 -4
  61. package/lib/utils/proFieldParsingText/index.js +10 -10
  62. package/lib/utils/transformKeySubmitValue/index.js +57 -57
  63. package/lib/utils/useEditableArray/index.js +46 -46
  64. package/lib/utils/useEditableMap/index.js +22 -22
  65. package/lib/utils/useMediaQuery/index.js +5 -5
  66. package/lib/vtx-datagrid/Store/Provide.js +2 -9
  67. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  68. package/lib/vtx-datagrid/columnState.js +28 -1
  69. package/lib/vtx-datagrid/index.js +26 -8
  70. package/lib/vtx-datagrid/style/index.less +242 -242
  71. package/lib/vtx-date-picker/style/index.less +39 -39
  72. package/lib/vtx-export/index.js +8 -8
  73. package/lib/vtx-icon/index.js1 +90 -90
  74. package/lib/vtx-import/index.js +56 -28
  75. package/lib/vtx-import/result.js +23 -25
  76. package/lib/vtx-modal/index.js +2 -2
  77. package/lib/vtx-page-layout/Basic.js +2 -2
  78. package/lib/vtx-page-layout/TabLayout.js +6 -6
  79. package/lib/vtx-page-layout/TableLayout.js +10 -10
  80. package/lib/vtx-page-layout/TreeLayout.js +6 -6
  81. package/lib/vtx-page-layout/container.js +2 -2
  82. package/lib/vtx-provider/index.js +30 -30
  83. package/lib/vtx-provider/intl.js +9 -9
  84. package/lib/vtx-provider/locale/en_US.js +2 -0
  85. package/lib/vtx-provider/locale/zh_CN.js +2 -0
  86. package/lib/vtx-provider/useStyle/index.js +17 -17
  87. package/lib/vtx-wang-editor/style/index.less +12 -12
  88. package/package.json +238 -238
@@ -1,90 +1,90 @@
1
- import { lazy, memo, Suspense, useMemo } from 'react';
2
- import AlignRightOutlined from './svg/alignRightOutlined.js';
3
- import ColumnHeightOutlined from './svg/columnHeightOutlined.js';
4
- import DownOutlined from './svg/downOutlined.js';
5
- import Fullscreen from './svg/fullscreen.js';
6
- import RedoOutlined from './svg/redoOutlined.js';
7
- import RightOutlined from './svg/rightOutlined.js';
8
- import SettingOutlined from './svg/settingOutlined.js';
9
-
10
-
11
- const iconComponents = {
12
- alignRightOutlined: AlignRightOutlined,
13
- columnHeightOutlined: ColumnHeightOutlined,
14
- downOutlined: DownOutlined,
15
- fullscreen: Fullscreen,
16
- redoOutlined: RedoOutlined,
17
- rightOutlined: RightOutlined,
18
- settingOutlined: SettingOutlined,
19
- // 低频图标如果确实需要,可以再考虑 lazy
20
- };
21
-
22
- // const iconComponents = {
23
- // // 核心:添加你需要的所有图标, 动态导入有的组件会失败
24
- // alignRightOutlined: lazy(() => import('./svg/alignRightOutlined.js')),
25
- // columnHeightOutlined: lazy(() => import('./svg/columnHeightOutlined.js')),
26
- // downOutlined: lazy(() => import('./svg/downOutlined.js')),
27
- // fullscreen: lazy(() => import('./svg/fullscreen.js')),
28
- // redoOutlined: lazy(() => import('./svg/redoOutlined.js')),
29
- // rightOutlined: lazy(() => import('./svg/rightOutlined.js')),
30
- // settingOutlined: lazy(() => import('./svg/settingOutlined.js')),
31
- // // 新增其他图标...
32
- // };
33
-
34
-
35
- const VtxIcon = memo(({
36
- type,
37
- size = 16,
38
- className = '',
39
- style = {},
40
- color,
41
- fileType = 'webp',
42
- ...props
43
- }) => {
44
- const width = props.width || size;
45
- const height = props.height || size;
46
- if (!type) {
47
- return null;
48
- }
49
- // const SvgComponent = useMemo(() => {
50
- // // 动态导入并缓存结果
51
- // return lazy(() => import(/* @vite-ignore */`./svg/${type}.js`));
52
- // }, [type]);
53
-
54
- const SvgComponent = useMemo(() => {
55
- // 兜底:找不到对应图标时,返回一个空组件(避免报错)
56
- return iconComponents[type] || lazy(() => Promise.resolve({ default: () => <svg width={width} height={height} /> }));
57
- }, [type, width, height]);
58
-
59
- // 默认返回空元素
60
- if (fileType == 'svg') {
61
- try {
62
- // const SvgComponent = lazy(() => import(`./svg/${type}.js`));
63
- return (
64
- <Suspense fallback={<div style={{ width, height, ...style }} />}>
65
- <SvgComponent
66
- className={className}
67
- style={{ width, height, ...style }}
68
- fill={color}
69
- {...props}
70
- />
71
- </Suspense>
72
- );
73
- } catch (error) {
74
- // 如果动态导入失败,返回空的 SVG 元素
75
- return (
76
- <svg width={width} height={height} style={style} className={className} {...props} />
77
- );
78
- }
79
- } else {
80
- return (
81
- // <img
82
- // src={require(`./assets/${type}.${fileType}`)}
83
- // style={{ width, height, ...style }}
84
- // />
85
- <></>
86
- );
87
- }
88
- });
89
- export { VtxIcon }
90
- export default VtxIcon;
1
+ import { lazy, memo, Suspense, useMemo } from 'react';
2
+ import AlignRightOutlined from './svg/alignRightOutlined.js';
3
+ import ColumnHeightOutlined from './svg/columnHeightOutlined.js';
4
+ import DownOutlined from './svg/downOutlined.js';
5
+ import Fullscreen from './svg/fullscreen.js';
6
+ import RedoOutlined from './svg/redoOutlined.js';
7
+ import RightOutlined from './svg/rightOutlined.js';
8
+ import SettingOutlined from './svg/settingOutlined.js';
9
+
10
+
11
+ const iconComponents = {
12
+ alignRightOutlined: AlignRightOutlined,
13
+ columnHeightOutlined: ColumnHeightOutlined,
14
+ downOutlined: DownOutlined,
15
+ fullscreen: Fullscreen,
16
+ redoOutlined: RedoOutlined,
17
+ rightOutlined: RightOutlined,
18
+ settingOutlined: SettingOutlined,
19
+ // 低频图标如果确实需要,可以再考虑 lazy
20
+ };
21
+
22
+ // const iconComponents = {
23
+ // // 核心:添加你需要的所有图标, 动态导入有的组件会失败
24
+ // alignRightOutlined: lazy(() => import('./svg/alignRightOutlined.js')),
25
+ // columnHeightOutlined: lazy(() => import('./svg/columnHeightOutlined.js')),
26
+ // downOutlined: lazy(() => import('./svg/downOutlined.js')),
27
+ // fullscreen: lazy(() => import('./svg/fullscreen.js')),
28
+ // redoOutlined: lazy(() => import('./svg/redoOutlined.js')),
29
+ // rightOutlined: lazy(() => import('./svg/rightOutlined.js')),
30
+ // settingOutlined: lazy(() => import('./svg/settingOutlined.js')),
31
+ // // 新增其他图标...
32
+ // };
33
+
34
+
35
+ const VtxIcon = memo(({
36
+ type,
37
+ size = 16,
38
+ className = '',
39
+ style = {},
40
+ color,
41
+ fileType = 'webp',
42
+ ...props
43
+ }) => {
44
+ const width = props.width || size;
45
+ const height = props.height || size;
46
+ if (!type) {
47
+ return null;
48
+ }
49
+ // const SvgComponent = useMemo(() => {
50
+ // // 动态导入并缓存结果
51
+ // return lazy(() => import(/* @vite-ignore */`./svg/${type}.js`));
52
+ // }, [type]);
53
+
54
+ const SvgComponent = useMemo(() => {
55
+ // 兜底:找不到对应图标时,返回一个空组件(避免报错)
56
+ return iconComponents[type] || lazy(() => Promise.resolve({ default: () => <svg width={width} height={height} /> }));
57
+ }, [type, width, height]);
58
+
59
+ // 默认返回空元素
60
+ if (fileType == 'svg') {
61
+ try {
62
+ // const SvgComponent = lazy(() => import(`./svg/${type}.js`));
63
+ return (
64
+ <Suspense fallback={<div style={{ width, height, ...style }} />}>
65
+ <SvgComponent
66
+ className={className}
67
+ style={{ width, height, ...style }}
68
+ fill={color}
69
+ {...props}
70
+ />
71
+ </Suspense>
72
+ );
73
+ } catch (error) {
74
+ // 如果动态导入失败,返回空的 SVG 元素
75
+ return (
76
+ <svg width={width} height={height} style={style} className={className} {...props} />
77
+ );
78
+ }
79
+ } else {
80
+ return (
81
+ // <img
82
+ // src={require(`./assets/${type}.${fileType}`)}
83
+ // style={{ width, height, ...style }}
84
+ // />
85
+ <></>
86
+ );
87
+ }
88
+ });
89
+ export { VtxIcon }
90
+ export default VtxIcon;
@@ -1,15 +1,15 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- 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; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
2
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
5
  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
6
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
+ 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; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
14
14
  import React, { useRef, useEffect, useContext } from 'react';
15
15
  import { message, Button, Tooltip } from 'antd';
@@ -22,9 +22,13 @@ import { getVtxToken, getSignature } from '@vtx/utils';
22
22
  import { useStyle } from "./style/index";
23
23
  import { VtxProvider, useIntl } from "../vtx-provider";
24
24
  import VtxModal from "../vtx-modal";
25
- import { jsx as _jsx } from "react/jsx-runtime";
26
25
  import { jsxs as _jsxs } from "react/jsx-runtime";
26
+ import { jsx as _jsx } from "react/jsx-runtime";
27
27
  function VtxImport(props) {
28
+ var templateURL = props.templateURL,
29
+ uploadURL = props.uploadURL,
30
+ afterUpload = props.afterUpload,
31
+ beforeUpload = props.beforeUpload;
28
32
  var token = getToken();
29
33
  if (props.token) {
30
34
  props.token, _readOnlyError("token");
@@ -36,6 +40,22 @@ function VtxImport(props) {
36
40
  var _useStyle = useStyle(prefixCls),
37
41
  wrapSSR = _useStyle.wrapSSR,
38
42
  hashId = _useStyle.hashId;
43
+ var TextEnum = _objectSpread({
44
+ rowNumberText: intl.getMessage('import.rowNumber', '行号'),
45
+ errorMessageText: intl.getMessage('import.errorMessage', '错误说明'),
46
+ resultTitleText: intl.getMessage('import.result', '导入结果'),
47
+ btnCloseText: intl.getMessage('switch.close', '关闭'),
48
+ operationText: intl.getMessage('import.operation', '导入'),
49
+ uploadFailedText: intl.getMessage('import.error', '上传失败'),
50
+ parseResponseFailedText: intl.getMessage('import.error', '解析响应失败'),
51
+ uploadSuccessText: intl.getMessage('import.success', '上传成功'),
52
+ parseResponseDataFailedText: intl.getMessage('import.error', '解析响应数据失败'),
53
+ downloadTemplateText: intl.getMessage('import.downloadTemplate', '下载模板'),
54
+ pleaseSelectFileText: intl.getMessage('import.pleaseSelectFile', '请选择需要上传的文件'),
55
+ uploadText: intl.getMessage('import.upload', '上传'),
56
+ selectFileText: intl.getMessage('import.selectFile', '选择文件'),
57
+ noFileSelectedText: intl.getMessage('import.noFileSelected', '未选择任何文件')
58
+ }, props.customEnumText);
39
59
 
40
60
  // 用 useRef 管理 DOM 引用,而不是 state
41
61
  var fileInputRef = useRef(null);
@@ -62,13 +82,22 @@ function VtxImport(props) {
62
82
  // 导入结果查看
63
83
  modalWidth: props.modalWidth || 800,
64
84
  columns: props.columns || [{
65
- title: '行号',
85
+ title: TextEnum.rowNumberText,
66
86
  dataIndex: 'lineNum',
67
87
  key: 'lineNum'
68
88
  }, {
69
- title: '错误说明',
89
+ title: TextEnum.errorMessageText,
70
90
  dataIndex: 'messages',
71
- key: 'messages'
91
+ key: 'messages',
92
+ render: function render(val) {
93
+ return /*#__PURE__*/_jsxs("div", {
94
+ style: {
95
+ display: 'flex',
96
+ width: 600
97
+ },
98
+ children: [" ", val]
99
+ });
100
+ }
72
101
  }],
73
102
  step: 1,
74
103
  chunkSize: props.chunkSize || 10 * 1024 * 1024,
@@ -76,7 +105,7 @@ function VtxImport(props) {
76
105
  currentIndex: 0,
77
106
  chunkId: '',
78
107
  chunks: [],
79
- operation: props.operation || intl.getMessage('import.operation', '导入'),
108
+ operation: props.operation || TextEnum.operationText,
80
109
  fileName: ''
81
110
  }),
82
111
  _useSet2 = _slicedToArray(_useSet, 2),
@@ -133,7 +162,7 @@ function VtxImport(props) {
133
162
  }
134
163
  };
135
164
  xhr.onerror = function () {
136
- message.error(intl.getMessage('import.error', '上传失败'));
165
+ message.error(TextEnum.uploadFailedText);
137
166
  };
138
167
  // 发送请求
139
168
  xhr.open('POST', '/cloudFile/common/uploadChunk', true);
@@ -155,23 +184,23 @@ function VtxImport(props) {
155
184
  try {
156
185
  res = JSON.parse(xhr.responseText);
157
186
  } catch (e) {
158
- message.error(intl.getMessage('import.error', '解析响应失败'));
187
+ message.error(TextEnum.parseResponseFailedText);
159
188
  setState({
160
189
  uploading: false
161
190
  });
162
191
  return;
163
192
  }
164
193
  if (((_res = res) === null || _res === void 0 ? void 0 : _res.result) == 0) {
165
- message.success(intl.getMessage('import.success', '上传成功'));
194
+ message.success(TextEnum.uploadSuccessText);
166
195
  chunkUpload(res.data);
167
196
  } else {
168
197
  var _res2;
169
- message.error(((_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.msg) || intl.getMessage('import.error', '上传失败'));
198
+ message.error(((_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.msg) || TextEnum.uploadFailedText);
170
199
  }
171
200
  }
172
201
  };
173
202
  xhr.onerror = function () {
174
- message.error(intl.getMessage('import.error', '上传失败'));
203
+ message.error(TextEnum.uploadFailedText);
175
204
  };
176
205
  // 发送请求
177
206
  xhr.open('POST', '/cloudFile/common/mergeChunk', true);
@@ -298,7 +327,7 @@ function VtxImport(props) {
298
327
  try {
299
328
  parseData = JSON.parse(data);
300
329
  } catch (e) {
301
- message.error(intl.getMessage('import.error', '解析响应数据失败'));
330
+ message.error(TextEnum.parseResponseDataFailedText);
302
331
  return;
303
332
  }
304
333
  if (typeof props.afterUpload === 'function') {
@@ -320,18 +349,14 @@ function VtxImport(props) {
320
349
  // 新增其他错误提示
321
350
  if (parseData.result !== 0) {
322
351
  var _parseData2;
323
- message.error(((_parseData2 = parseData) === null || _parseData2 === void 0 ? void 0 : _parseData2.msg) || intl.getMessage('import.success', '上传成功'));
352
+ message.error(((_parseData2 = parseData) === null || _parseData2 === void 0 ? void 0 : _parseData2.msg) || TextEnum.uploadSuccessText);
324
353
  }
325
354
  }
326
355
  };
327
- var templateURL = props.templateURL,
328
- uploadURL = props.uploadURL,
329
- afterUpload = props.afterUpload,
330
- beforeUpload = props.beforeUpload;
331
356
  var modalProps = {
332
357
  className: "".concat(prefixCls, "-modal"),
333
358
  open: state.visible,
334
- title: intl.getMessage('import.operation', '导入'),
359
+ title: TextEnum.operationText,
335
360
  onCancel: function onCancel() {
336
361
  return closeModal();
337
362
  },
@@ -343,7 +368,7 @@ function VtxImport(props) {
343
368
  onClick: function onClick() {
344
369
  window.open(templateURL);
345
370
  },
346
- children: intl.getMessage('import.downloadTemplate', '下载模板')
371
+ children: TextEnum.downloadTemplateText
347
372
  }, "downloadTemple") : null, /*#__PURE__*/_jsx(Button, {
348
373
  type: "primary",
349
374
  loading: state.uploading,
@@ -382,15 +407,15 @@ function VtxImport(props) {
382
407
  // request.send(fmd);
383
408
  // }
384
409
  } else {
385
- message.info(intl.getMessage('import.pleaseSelectFile', '请选择需要上传的文件'));
410
+ message.info(TextEnum.pleaseSelectFileText);
386
411
  }
387
412
  },
388
- children: intl.getMessage('import.upload', '上传')
413
+ children: TextEnum.uploadText
389
414
  }, "uploadSubmit"), /*#__PURE__*/_jsx(Button, {
390
415
  onClick: function onClick() {
391
416
  closeModal();
392
417
  },
393
- children: intl.getMessage('switch.close', '关闭')
418
+ children: TextEnum.btnCloseText
394
419
  }, "closeWindow")],
395
420
  width: 520
396
421
  };
@@ -403,7 +428,8 @@ function VtxImport(props) {
403
428
  resultVisible: false
404
429
  });
405
430
  },
406
- modalWidth: state.modalWidth
431
+ modalWidth: state.modalWidth,
432
+ TextEnum: TextEnum
407
433
  };
408
434
 
409
435
  // 组件卸载时清理
@@ -477,7 +503,7 @@ function VtxImport(props) {
477
503
  onClick: handleSelectFile,
478
504
  children: /*#__PURE__*/_jsx("span", {
479
505
  className: "".concat(prefixCls, "-label"),
480
- children: intl.getMessage('import.selectFile', '选择文件')
506
+ children: TextEnum.selectFileText
481
507
  })
482
508
  }), state.fileName ? /*#__PURE__*/_jsx(Tooltip, {
483
509
  title: state.fileName,
@@ -487,7 +513,7 @@ function VtxImport(props) {
487
513
  })
488
514
  }) : /*#__PURE__*/_jsx("div", {
489
515
  className: "".concat(prefixCls, "-file-name"),
490
- children: intl.getMessage('import.noFileSelected', '未选择任何文件')
516
+ children: TextEnum.noFileSelectedText
491
517
  })]
492
518
  }), /*#__PURE__*/_jsx("input", {
493
519
  type: "file",
@@ -515,11 +541,13 @@ VtxImport.propTypes = {
515
541
  postData: PropTypes.object,
516
542
  fileKey: PropTypes.string,
517
543
  accept: PropTypes.string,
544
+ token: PropTypes.string,
518
545
  operation: PropTypes.string,
519
546
  close: PropTypes.func,
520
547
  afterUpload: PropTypes.func,
521
548
  modalWidth: PropTypes.number,
522
549
  columns: PropTypes.array,
550
+ customEnumText: PropTypes.object,
523
551
  children: PropTypes.object,
524
552
  beforeUpload: PropTypes.func,
525
553
  chunkSize: PropTypes.number
@@ -1,25 +1,27 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- 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; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
2
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
5
  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
6
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
+ 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; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  import React from 'react';
14
14
  import { Modal, Button } from 'antd';
15
15
  import PropTypes from 'prop-types';
16
16
  import useSet from "../utils/useSet";
17
17
  import VtxDatagrid from "../vtx-datagrid";
18
- import { useIntl } from "../vtx-provider";
19
18
  import VtxModal from "../vtx-modal";
20
19
  import { jsx as _jsx } from "react/jsx-runtime";
21
20
  function VtxImportResult(props) {
22
- var intl = useIntl();
21
+ var TextEnum = _objectSpread({
22
+ resultTitleText: '导入结果',
23
+ btnCloseText: '关闭'
24
+ }, props.TextEnum);
23
25
  var _useSet = useSet({
24
26
  visible: props.visible || false,
25
27
  dataSource: props.dataSource || [],
@@ -29,11 +31,9 @@ function VtxImportResult(props) {
29
31
  _useSet2 = _slicedToArray(_useSet, 1),
30
32
  state = _useSet2[0];
31
33
  var modalProps = {
32
- bodyStyle: {
33
- backgroundColor: '#f8f8f8'
34
- },
34
+ bodyStyle: {},
35
35
  open: state.visible,
36
- title: intl.getMessage('import.result', '导入结果'),
36
+ title: TextEnum.resultTitleText,
37
37
  onCancel: function onCancel() {
38
38
  if (typeof props.hideVisible === 'function') {
39
39
  props.hideVisible();
@@ -50,29 +50,26 @@ function VtxImportResult(props) {
50
50
  props.hideVisible();
51
51
  }
52
52
  },
53
- children: intl.getMessage('switch.close', '关闭')
53
+ children: TextEnum.btnCloseText
54
54
  }, "closeWindow")]
55
55
  };
56
56
  var newTableProps = {
57
+ toolba: false,
57
58
  columns: state.columns,
58
59
  dataSource: state.dataSource,
59
60
  startIndex: 1,
60
61
  size: 'small',
61
62
  headFootHeight: 50,
62
63
  pagination: false,
63
- autoFit: false
64
+ autoFit: false,
65
+ scroll: {
66
+ y: 550
67
+ }
64
68
  };
65
69
  return /*#__PURE__*/_jsx(VtxModal, _objectSpread(_objectSpread({}, modalProps), {}, {
66
- children: /*#__PURE__*/_jsx("div", {
67
- style: {
68
- maxHeight: 600,
69
- width: '100%',
70
- overflow: 'auto'
71
- },
72
- children: /*#__PURE__*/_jsx(VtxDatagrid, _objectSpread({
73
- toolbar: false
74
- }, newTableProps))
75
- })
70
+ children: /*#__PURE__*/_jsx(VtxDatagrid, _objectSpread({
71
+ toolbar: false
72
+ }, newTableProps))
76
73
  }));
77
74
  }
78
75
  VtxImportResult.propTypes = {
@@ -80,6 +77,7 @@ VtxImportResult.propTypes = {
80
77
  dataSource: PropTypes.array,
81
78
  columns: PropTypes.array,
82
79
  modalWidth: PropTypes.number,
83
- hideVisible: PropTypes.func
80
+ hideVisible: PropTypes.func,
81
+ TextEnum: PropTypes.object
84
82
  };
85
83
  export default VtxImportResult;
@@ -134,8 +134,8 @@ function VtxModal(props) {
134
134
  }
135
135
  };
136
136
 
137
- /*
138
- *重写title,加入对话框全屏功能
137
+ /*
138
+ *重写title,加入对话框全屏功能
139
139
  */
140
140
  title = function renderTitle() {
141
141
  if (typeof title == 'string' && title.indexOf('>') > -1) {
@@ -1,5 +1,5 @@
1
- /**
2
- * 基础布局
1
+ /**
2
+ * 基础布局
3
3
  */
4
4
  import PropTypes from 'prop-types';
5
5
  import { useContext } from 'react';
@@ -5,9 +5,9 @@ import { useContext } from 'react';
5
5
  import { useStyle } from "./style";
6
6
  import { VtxProvider } from "../vtx-provider";
7
7
 
8
- /**
9
- * 页面
10
- * @param {*} props
8
+ /**
9
+ * 页面
10
+ * @param {*} props
11
11
  */
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  var Page = function Page(props) {
@@ -29,9 +29,9 @@ Page.propTypes = {
29
29
  children: PropTypes.node
30
30
  };
31
31
 
32
- /**
33
- * 内容
34
- * @param {*} props
32
+ /**
33
+ * 内容
34
+ * @param {*} props
35
35
  */
36
36
  var Content = function Content(props) {
37
37
  var className = props.className,
@@ -24,9 +24,9 @@ var pagePaddingTop = 20;
24
24
  var searchMarginBottom = 20;
25
25
 
26
26
  // eslint-disable-next-line valid-jsdoc
27
- /**
28
- * 页面
29
- * @param {*} props
27
+ /**
28
+ * 页面
29
+ * @param {*} props
30
30
  */
31
31
  var Page = function Page(props) {
32
32
  var _useContext = useContext(VtxProvider),
@@ -74,17 +74,17 @@ Page.propTypes = {
74
74
  onSearchCollapse: PropTypes.func
75
75
  };
76
76
 
77
- /**
78
- * 搜索
77
+ /**
78
+ * 搜索
79
79
  */
80
80
  var Search = container({
81
81
  componentClass: 'vtx-page-table-search'
82
82
  })(Basic);
83
83
 
84
84
  // eslint-disable-next-line valid-jsdoc
85
- /**
86
- * 内容
87
- * @param {*} props
85
+ /**
86
+ * 内容
87
+ * @param {*} props
88
88
  */
89
89
  var Content = function Content(props) {
90
90
  var className = props.className,
@@ -119,8 +119,8 @@ Content.propTypes = {
119
119
  };
120
120
 
121
121
  // eslint-disable-next-line valid-jsdoc
122
- /**
123
- * 表格布局
122
+ /**
123
+ * 表格布局
124
124
  */
125
125
  var Table = function Table(props) {
126
126
  var className = props.className,
@@ -4,9 +4,9 @@ import { useContext } from 'react';
4
4
  import { useStyle } from "./style";
5
5
  import { VtxProvider } from "../vtx-provider";
6
6
 
7
- /**
8
- * 页面
9
- * @param {*} props
7
+ /**
8
+ * 页面
9
+ * @param {*} props
10
10
  */
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  var Page = function Page(props) {
@@ -28,9 +28,9 @@ Page.propTypes = {
28
28
  children: PropTypes.node
29
29
  };
30
30
 
31
- /**
32
- * 内容
33
- * @param {*} props
31
+ /**
32
+ * 内容
33
+ * @param {*} props
34
34
  */
35
35
  var Content = function Content(props) {
36
36
  var className = props.className,
@@ -14,8 +14,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
14
14
  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; }
15
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
16
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
- /**
18
- * 高阶组件
17
+ /**
18
+ * 高阶组件
19
19
  */
20
20
  import React from 'react';
21
21
  import PropTypes from 'prop-types';