@vtx/components 3.1.151 → 3.1.152

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 (311) hide show
  1. package/lib/_util/filterSpecialCharacters.js +49 -60
  2. package/lib/_util/filterSpecialCharacters.js.map +1 -1
  3. package/lib/_util/getComponentProps.js +4 -1
  4. package/lib/_util/getComponentProps.js.map +1 -1
  5. package/lib/_util/getToken.js +16 -8
  6. package/lib/_util/getToken.js.map +1 -1
  7. package/lib/_util/getUrlParam.js +9 -2
  8. package/lib/_util/getUrlParam.js.map +1 -1
  9. package/lib/_util/isFunction.js +1 -0
  10. package/lib/_util/isFunction.js.map +1 -1
  11. package/lib/_util/isObject.js +1 -0
  12. package/lib/_util/isObject.js.map +1 -1
  13. package/lib/_util/useColSize.js +13 -3
  14. package/lib/_util/useColSize.js.map +1 -1
  15. package/lib/_util/useInterval.js +3 -0
  16. package/lib/_util/useInterval.js.map +1 -1
  17. package/lib/_util/useSet.js +42 -26
  18. package/lib/_util/useSet.js.map +1 -1
  19. package/lib/config.js +2 -1
  20. package/lib/config.js.map +1 -1
  21. package/lib/index.js +30 -1
  22. package/lib/index.js.map +1 -1
  23. package/lib/style/index.less +2 -2
  24. package/lib/style/themes/compact.less +1 -1
  25. package/lib/style/themes/dark.less +9 -9
  26. package/lib/style/themes/default.less +7 -7
  27. package/lib/style/themes/index.less +1 -1
  28. package/lib/style/themes/variable.less +5 -5
  29. package/lib/vtx-color-picker/index.js +33 -14
  30. package/lib/vtx-color-picker/index.js.map +1 -1
  31. package/lib/vtx-color-picker/style/css.js +2 -0
  32. package/lib/vtx-color-picker/style/css.js.map +1 -1
  33. package/lib/vtx-color-picker/style/index.js +2 -0
  34. package/lib/vtx-color-picker/style/index.js.map +1 -1
  35. package/lib/vtx-combogrid/Combogrid.js +96 -55
  36. package/lib/vtx-combogrid/Combogrid.js.map +1 -1
  37. package/lib/vtx-combogrid/index.js +66 -41
  38. package/lib/vtx-combogrid/index.js.map +1 -1
  39. package/lib/vtx-combogrid/style/css.js +7 -0
  40. package/lib/vtx-combogrid/style/css.js.map +1 -1
  41. package/lib/vtx-combogrid/style/index.js +7 -0
  42. package/lib/vtx-combogrid/style/index.js.map +1 -1
  43. package/lib/vtx-datagrid/Alert.js +15 -6
  44. package/lib/vtx-datagrid/Alert.js.map +1 -1
  45. package/lib/vtx-datagrid/CheckboxList.js +71 -35
  46. package/lib/vtx-datagrid/CheckboxList.js.map +1 -1
  47. package/lib/vtx-datagrid/ColumnSetting.js +105 -58
  48. package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
  49. package/lib/vtx-datagrid/ResizeableTitle.js +18 -6
  50. package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
  51. package/lib/vtx-datagrid/index.js +217 -138
  52. package/lib/vtx-datagrid/index.js.map +1 -1
  53. package/lib/vtx-datagrid/renderColumnButtons.js +46 -15
  54. package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
  55. package/lib/vtx-datagrid/style/css.js +10 -0
  56. package/lib/vtx-datagrid/style/css.js.map +1 -1
  57. package/lib/vtx-datagrid/style/index.js +10 -0
  58. package/lib/vtx-datagrid/style/index.js.map +1 -1
  59. package/lib/vtx-date-picker/QdatePicker.js +58 -28
  60. package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
  61. package/lib/vtx-date-picker/generatePicker.js +77 -35
  62. package/lib/vtx-date-picker/generatePicker.js.map +1 -1
  63. package/lib/vtx-date-picker/index.js +8 -2
  64. package/lib/vtx-date-picker/index.js.map +1 -1
  65. package/lib/vtx-date-picker/style/css.js +1 -0
  66. package/lib/vtx-date-picker/style/css.js.map +1 -1
  67. package/lib/vtx-date-picker/style/index.js +1 -0
  68. package/lib/vtx-date-picker/style/index.js.map +1 -1
  69. package/lib/vtx-date-picker/style/index.less +39 -39
  70. package/lib/vtx-editor/index.js +32 -13
  71. package/lib/vtx-editor/index.js.map +1 -1
  72. package/lib/vtx-editor/style/css.js +1 -0
  73. package/lib/vtx-editor/style/css.js.map +1 -1
  74. package/lib/vtx-editor/style/index.js +1 -0
  75. package/lib/vtx-editor/style/index.js.map +1 -1
  76. package/lib/vtx-editor/style/index.less +8 -8
  77. package/lib/vtx-ellipsis-text/index.js +29 -16
  78. package/lib/vtx-ellipsis-text/index.js.map +1 -1
  79. package/lib/vtx-ellipsis-text/style/css.js +1 -0
  80. package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
  81. package/lib/vtx-ellipsis-text/style/index.js +1 -0
  82. package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
  83. package/lib/vtx-ellipsis-text/style/index.less +13 -13
  84. package/lib/vtx-export/index.js +73 -38
  85. package/lib/vtx-export/index.js.map +1 -1
  86. package/lib/vtx-export/style/css.js +5 -0
  87. package/lib/vtx-export/style/css.js.map +1 -1
  88. package/lib/vtx-export/style/index.js +5 -0
  89. package/lib/vtx-export/style/index.js.map +1 -1
  90. package/lib/vtx-export-async/ColumnsSelect.js +23 -11
  91. package/lib/vtx-export-async/ColumnsSelect.js.map +1 -1
  92. package/lib/vtx-export-async/History.js +117 -75
  93. package/lib/vtx-export-async/History.js.map +1 -1
  94. package/lib/vtx-export-async/index.js +116 -72
  95. package/lib/vtx-export-async/index.js.map +1 -1
  96. package/lib/vtx-export-async/style/css.js.map +1 -1
  97. package/lib/vtx-export-async/style/index.js.map +1 -1
  98. package/lib/vtx-export-async/util.js +21 -9
  99. package/lib/vtx-export-async/util.js.map +1 -1
  100. package/lib/vtx-form-layout/Card.js +39 -17
  101. package/lib/vtx-form-layout/Card.js.map +1 -1
  102. package/lib/vtx-form-layout/Divider.js +12 -6
  103. package/lib/vtx-form-layout/Divider.js.map +1 -1
  104. package/lib/vtx-form-layout/FormItem.js +67 -18
  105. package/lib/vtx-form-layout/FormItem.js.map +1 -1
  106. package/lib/vtx-form-layout/Pane.js +10 -4
  107. package/lib/vtx-form-layout/Pane.js.map +1 -1
  108. package/lib/vtx-form-layout/Row.js +9 -2
  109. package/lib/vtx-form-layout/Row.js.map +1 -1
  110. package/lib/vtx-form-layout/context.js +4 -1
  111. package/lib/vtx-form-layout/context.js.map +1 -1
  112. package/lib/vtx-form-layout/demo/Modal.less +43 -43
  113. package/lib/vtx-form-layout/index.js +25 -10
  114. package/lib/vtx-form-layout/index.js.map +1 -1
  115. package/lib/vtx-form-layout/style/css.js +7 -0
  116. package/lib/vtx-form-layout/style/css.js.map +1 -1
  117. package/lib/vtx-form-layout/style/index.js +7 -0
  118. package/lib/vtx-form-layout/style/index.js.map +1 -1
  119. package/lib/vtx-form-layout/style/index.less +220 -220
  120. package/lib/vtx-image/Image.js +117 -77
  121. package/lib/vtx-image/Image.js.map +1 -1
  122. package/lib/vtx-image/Preview.js +63 -34
  123. package/lib/vtx-image/Preview.js.map +1 -1
  124. package/lib/vtx-image/PreviewGroup.js +54 -24
  125. package/lib/vtx-image/PreviewGroup.js.map +1 -1
  126. package/lib/vtx-image/index.js +11 -4
  127. package/lib/vtx-image/index.js.map +1 -1
  128. package/lib/vtx-image/style/css.js +1 -0
  129. package/lib/vtx-image/style/css.js.map +1 -1
  130. package/lib/vtx-image/style/index.js +1 -0
  131. package/lib/vtx-image/style/index.js.map +1 -1
  132. package/lib/vtx-import/index.js +143 -91
  133. package/lib/vtx-import/index.js.map +1 -1
  134. package/lib/vtx-import/result.js +33 -15
  135. package/lib/vtx-import/result.js.map +1 -1
  136. package/lib/vtx-import/style/css.js +3 -0
  137. package/lib/vtx-import/style/css.js.map +1 -1
  138. package/lib/vtx-import/style/index.js +3 -0
  139. package/lib/vtx-import/style/index.js.map +1 -1
  140. package/lib/vtx-import/style/index.less +8 -8
  141. package/lib/vtx-import2/CheckResult.js +9 -2
  142. package/lib/vtx-import2/CheckResult.js.map +1 -1
  143. package/lib/vtx-import2/Content.js +38 -16
  144. package/lib/vtx-import2/Content.js.map +1 -1
  145. package/lib/vtx-import2/DownloadSvg.js +7 -2
  146. package/lib/vtx-import2/DownloadSvg.js.map +1 -1
  147. package/lib/vtx-import2/ImportResult.js +15 -8
  148. package/lib/vtx-import2/ImportResult.js.map +1 -1
  149. package/lib/vtx-import2/UploadSvg.js +7 -2
  150. package/lib/vtx-import2/UploadSvg.js.map +1 -1
  151. package/lib/vtx-import2/index.js +176 -91
  152. package/lib/vtx-import2/index.js.map +1 -1
  153. package/lib/vtx-import2/style/css.js +3 -0
  154. package/lib/vtx-import2/style/css.js.map +1 -1
  155. package/lib/vtx-import2/style/index.js +3 -0
  156. package/lib/vtx-import2/style/index.js.map +1 -1
  157. package/lib/vtx-import2/style/index.less +102 -102
  158. package/lib/vtx-input/TextArea.js +31 -14
  159. package/lib/vtx-input/TextArea.js.map +1 -1
  160. package/lib/vtx-input/index.js +49 -24
  161. package/lib/vtx-input/index.js.map +1 -1
  162. package/lib/vtx-input/style/css.js +1 -0
  163. package/lib/vtx-input/style/css.js.map +1 -1
  164. package/lib/vtx-input/style/index.js +1 -0
  165. package/lib/vtx-input/style/index.js.map +1 -1
  166. package/lib/vtx-input/style/index.less +24 -24
  167. package/lib/vtx-input/useLength.js +23 -10
  168. package/lib/vtx-input/useLength.js.map +1 -1
  169. package/lib/vtx-modal/Title.js +9 -3
  170. package/lib/vtx-modal/Title.js.map +1 -1
  171. package/lib/vtx-modal/index.js +85 -52
  172. package/lib/vtx-modal/index.js.map +1 -1
  173. package/lib/vtx-modal/style/css.js +1 -0
  174. package/lib/vtx-modal/style/css.js.map +1 -1
  175. package/lib/vtx-modal/style/index.js +1 -0
  176. package/lib/vtx-modal/style/index.js.map +1 -1
  177. package/lib/vtx-page-layout/Basic.js +9 -4
  178. package/lib/vtx-page-layout/Basic.js.map +1 -1
  179. package/lib/vtx-page-layout/Content.js +27 -16
  180. package/lib/vtx-page-layout/Content.js.map +1 -1
  181. package/lib/vtx-page-layout/Pane.js +13 -4
  182. package/lib/vtx-page-layout/Pane.js.map +1 -1
  183. package/lib/vtx-page-layout/TableLayout.js +64 -34
  184. package/lib/vtx-page-layout/TableLayout.js.map +1 -1
  185. package/lib/vtx-page-layout/TableWrap.js +23 -12
  186. package/lib/vtx-page-layout/TableWrap.js.map +1 -1
  187. package/lib/vtx-page-layout/container.js +61 -32
  188. package/lib/vtx-page-layout/container.js.map +1 -1
  189. package/lib/vtx-page-layout/index.js +11 -2
  190. package/lib/vtx-page-layout/index.js.map +1 -1
  191. package/lib/vtx-page-layout/style/css.js.map +1 -1
  192. package/lib/vtx-page-layout/style/index.js.map +1 -1
  193. package/lib/vtx-page-layout/style/index.less +138 -138
  194. package/lib/vtx-rps-frame/index.js +58 -38
  195. package/lib/vtx-rps-frame/index.js.map +1 -1
  196. package/lib/vtx-rps-frame/style/css.js.map +1 -1
  197. package/lib/vtx-rps-frame/style/index.js.map +1 -1
  198. package/lib/vtx-scrollable-row/index.js +68 -34
  199. package/lib/vtx-scrollable-row/index.js.map +1 -1
  200. package/lib/vtx-scrollable-row/style/css.js.map +1 -1
  201. package/lib/vtx-scrollable-row/style/index.js.map +1 -1
  202. package/lib/vtx-scrollable-row/style/index.less +113 -113
  203. package/lib/vtx-search/VtxCol.js +27 -8
  204. package/lib/vtx-search/VtxCol.js.map +1 -1
  205. package/lib/vtx-search/VtxRow.js +15 -8
  206. package/lib/vtx-search/VtxRow.js.map +1 -1
  207. package/lib/vtx-search/index.js +112 -67
  208. package/lib/vtx-search/index.js.map +1 -1
  209. package/lib/vtx-search/style/css.js +4 -0
  210. package/lib/vtx-search/style/css.js.map +1 -1
  211. package/lib/vtx-search/style/index.js +4 -0
  212. package/lib/vtx-search/style/index.js.map +1 -1
  213. package/lib/vtx-search-map-input/index.js +98 -63
  214. package/lib/vtx-search-map-input/index.js.map +1 -1
  215. package/lib/vtx-search-map-input/style/css.js +2 -0
  216. package/lib/vtx-search-map-input/style/css.js.map +1 -1
  217. package/lib/vtx-search-map-input/style/index.js +2 -0
  218. package/lib/vtx-search-map-input/style/index.js.map +1 -1
  219. package/lib/vtx-select/index.js +99 -47
  220. package/lib/vtx-select/index.js.map +1 -1
  221. package/lib/vtx-select/style/css.js +8 -0
  222. package/lib/vtx-select/style/css.js.map +1 -1
  223. package/lib/vtx-select/style/index.js +8 -0
  224. package/lib/vtx-select/style/index.js.map +1 -1
  225. package/lib/vtx-select/style/index.less +68 -68
  226. package/lib/vtx-signature/index.js +34 -19
  227. package/lib/vtx-signature/index.js.map +1 -1
  228. package/lib/vtx-signature/style/css.js +2 -0
  229. package/lib/vtx-signature/style/css.js.map +1 -1
  230. package/lib/vtx-signature/style/index.js +2 -0
  231. package/lib/vtx-signature/style/index.js.map +1 -1
  232. package/lib/vtx-signature/style/index.less +33 -33
  233. package/lib/vtx-split-pane/Pane.js +23 -12
  234. package/lib/vtx-split-pane/Pane.js.map +1 -1
  235. package/lib/vtx-split-pane/Resizer.js +41 -21
  236. package/lib/vtx-split-pane/Resizer.js.map +1 -1
  237. package/lib/vtx-split-pane/SplitPane.js +111 -55
  238. package/lib/vtx-split-pane/SplitPane.js.map +1 -1
  239. package/lib/vtx-split-pane/index.js +7 -2
  240. package/lib/vtx-split-pane/index.js.map +1 -1
  241. package/lib/vtx-split-pane/style/css.js +3 -0
  242. package/lib/vtx-split-pane/style/css.js.map +1 -1
  243. package/lib/vtx-split-pane/style/index.js +3 -0
  244. package/lib/vtx-split-pane/style/index.js.map +1 -1
  245. package/lib/vtx-split-pane/style/index.less +76 -76
  246. package/lib/vtx-statistics-column/Back.js +11 -4
  247. package/lib/vtx-statistics-column/Back.js.map +1 -1
  248. package/lib/vtx-statistics-column/Item.js +32 -16
  249. package/lib/vtx-statistics-column/Item.js.map +1 -1
  250. package/lib/vtx-statistics-column/Total.js +31 -15
  251. package/lib/vtx-statistics-column/Total.js.map +1 -1
  252. package/lib/vtx-statistics-column/context.js +4 -1
  253. package/lib/vtx-statistics-column/context.js.map +1 -1
  254. package/lib/vtx-statistics-column/index.js +19 -2
  255. package/lib/vtx-statistics-column/index.js.map +1 -1
  256. package/lib/vtx-statistics-column/style/css.js +1 -0
  257. package/lib/vtx-statistics-column/style/css.js.map +1 -1
  258. package/lib/vtx-statistics-column/style/index.js +1 -0
  259. package/lib/vtx-statistics-column/style/index.js.map +1 -1
  260. package/lib/vtx-statistics-column/style/index.less +59 -59
  261. package/lib/vtx-time-picker/index.js +22 -8
  262. package/lib/vtx-time-picker/index.js.map +1 -1
  263. package/lib/vtx-time-picker/style/css.js.map +1 -1
  264. package/lib/vtx-time-picker/style/index.js.map +1 -1
  265. package/lib/vtx-tree/index.js +153 -83
  266. package/lib/vtx-tree/index.js.map +1 -1
  267. package/lib/vtx-tree/style/css.js +2 -0
  268. package/lib/vtx-tree/style/css.js.map +1 -1
  269. package/lib/vtx-tree/style/index.js +2 -0
  270. package/lib/vtx-tree/style/index.js.map +1 -1
  271. package/lib/vtx-tree/utils.js +31 -10
  272. package/lib/vtx-tree/utils.js.map +1 -1
  273. package/lib/vtx-tree-select/index.js +81 -37
  274. package/lib/vtx-tree-select/index.js.map +1 -1
  275. package/lib/vtx-tree-select/style/css.js +4 -0
  276. package/lib/vtx-tree-select/style/css.js.map +1 -1
  277. package/lib/vtx-tree-select/style/index.js +4 -0
  278. package/lib/vtx-tree-select/style/index.js.map +1 -1
  279. package/lib/vtx-upload/FilePreview.js +35 -17
  280. package/lib/vtx-upload/FilePreview.js.map +1 -1
  281. package/lib/vtx-upload/index.js +167 -90
  282. package/lib/vtx-upload/index.js.map +1 -1
  283. package/lib/vtx-upload/style/css.js +6 -0
  284. package/lib/vtx-upload/style/css.js.map +1 -1
  285. package/lib/vtx-upload/style/index.js +6 -0
  286. package/lib/vtx-upload/style/index.js.map +1 -1
  287. package/lib/vtx-upload/style/index.less +61 -61
  288. package/lib/vtx-wang-editor/index.js +126 -84
  289. package/lib/vtx-wang-editor/index.js.map +1 -1
  290. package/lib/vtx-wang-editor/style/css.js +1 -0
  291. package/lib/vtx-wang-editor/style/css.js.map +1 -1
  292. package/lib/vtx-wang-editor/style/index.js +1 -0
  293. package/lib/vtx-wang-editor/style/index.js.map +1 -1
  294. package/lib/vtx-wang-editor/style/index.less +12 -12
  295. package/lib/vtx-wang-editor/wangEditorUtil.js +141 -80
  296. package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
  297. package/lib/vtx-ztree/index.js +138 -77
  298. package/lib/vtx-ztree/index.js.map +1 -1
  299. package/lib/vtx-ztree/style/css.js +1 -0
  300. package/lib/vtx-ztree/style/css.js.map +1 -1
  301. package/lib/vtx-ztree/style/index.js +1 -0
  302. package/lib/vtx-ztree/style/index.js.map +1 -1
  303. package/lib/vtx-ztree/style/index.less +45 -45
  304. package/lib/vtx-ztree-select/index.js +159 -91
  305. package/lib/vtx-ztree-select/index.js.map +1 -1
  306. package/lib/vtx-ztree-select/style/css.js +3 -0
  307. package/lib/vtx-ztree-select/style/css.js.map +1 -1
  308. package/lib/vtx-ztree-select/style/index.js +3 -0
  309. package/lib/vtx-ztree-select/style/index.js.map +1 -1
  310. package/lib/vtx-ztree-select/style/index.less +109 -109
  311. package/package.json +122 -122
@@ -1,61 +1,90 @@
1
1
  "use strict";
2
2
 
3
+ 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); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports["default"] = void 0;
9
+
7
10
  var _react = _interopRequireWildcard(require("react"));
11
+
8
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
9
14
  var _antd = require("antd");
15
+
10
16
  var _Content = _interopRequireDefault(require("./Content"));
17
+
11
18
  var _ImportResult = _interopRequireDefault(require("./ImportResult"));
19
+
12
20
  var _ahooks = require("ahooks");
21
+
13
22
  var _getToken = _interopRequireDefault(require("../_util/getToken"));
23
+
14
24
  var _getSignature = _interopRequireDefault(require("@vtx/utils/lib/getSignature"));
25
+
15
26
  var _useSet3 = _interopRequireDefault(require("../_util/useSet"));
27
+
16
28
  var _md = _interopRequireDefault(require("md5"));
29
+
17
30
  var _utils = require("@vtx/utils");
18
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
21
- 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); }
22
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
+
34
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
+
36
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
+
38
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
39
+
23
40
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
25
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
26
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
41
+
42
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
43
+
44
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
45
+
46
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
47
+
27
48
  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."); }
28
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
29
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
30
- 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; } }
31
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
32
- 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; }
33
- 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; }
34
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
35
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
36
- 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); }
49
+
50
+ 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); }
51
+
52
+ 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; }
53
+
54
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
55
+
56
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
57
+
58
+ 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; }
59
+
60
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
61
+
62
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
63
+
37
64
  function getFileName() {
38
65
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
39
66
  var index = name.lastIndexOf('.');
40
67
  var suffix = name.substring(index);
41
68
  return name.substring(0, index) + '(错误文件)' + suffix;
42
69
  }
70
+
43
71
  var VtxImport2 = function VtxImport2(props) {
44
72
  var visible = props.visible,
45
- close = props.close,
46
- title = props.title,
47
- accept = props.accept,
48
- fileKey = props.fileKey,
49
- uploadURL = props.uploadURL,
50
- postData = props.postData,
51
- errorURL = props.errorURL,
52
- templateURL = props.templateURL,
53
- afterUpload = props.afterUpload,
54
- errorDownloadName = props.errorDownloadName,
55
- customText = props.customText,
56
- _props$customEnumText = props.customEnumText,
57
- customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
58
- beforeUpload = props.beforeUpload;
73
+ close = props.close,
74
+ title = props.title,
75
+ accept = props.accept,
76
+ fileKey = props.fileKey,
77
+ uploadURL = props.uploadURL,
78
+ postData = props.postData,
79
+ errorURL = props.errorURL,
80
+ templateURL = props.templateURL,
81
+ afterUpload = props.afterUpload,
82
+ errorDownloadName = props.errorDownloadName,
83
+ customText = props.customText,
84
+ _props$customEnumText = props.customEnumText,
85
+ customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
86
+ beforeUpload = props.beforeUpload;
87
+
59
88
  var TextEnum = _objectSpread({
60
89
  headSubTitleText: '导入',
61
90
  btnCloseText: '关闭',
@@ -73,73 +102,89 @@ var VtxImport2 = function VtxImport2(props) {
73
102
  resultInfoDataText: '条数据',
74
103
  resultNetworkErrorText: '服务器异常'
75
104
  }, customEnumText);
105
+
76
106
  var _useState = (0, _react.useState)(0),
77
- _useState2 = _slicedToArray(_useState, 2),
78
- status = _useState2[0],
79
- setStatus = _useState2[1]; // 0:首页,1:结果页
107
+ _useState2 = _slicedToArray(_useState, 2),
108
+ status = _useState2[0],
109
+ setStatus = _useState2[1]; // 0:首页,1:结果页
110
+
111
+
80
112
  var _useState3 = (0, _react.useState)(false),
81
- _useState4 = _slicedToArray(_useState3, 2),
82
- result = _useState4[0],
83
- setResult = _useState4[1];
113
+ _useState4 = _slicedToArray(_useState3, 2),
114
+ result = _useState4[0],
115
+ setResult = _useState4[1];
116
+
84
117
  var _useState5 = (0, _react.useState)(5),
85
- _useState6 = _slicedToArray(_useState5, 2),
86
- countdown = _useState6[0],
87
- setCountdown = _useState6[1];
118
+ _useState6 = _slicedToArray(_useState5, 2),
119
+ countdown = _useState6[0],
120
+ setCountdown = _useState6[1];
121
+
88
122
  var _useState7 = (0, _react.useState)([]),
89
- _useState8 = _slicedToArray(_useState7, 2),
90
- fileList = _useState8[0],
91
- setFileList = _useState8[1];
123
+ _useState8 = _slicedToArray(_useState7, 2),
124
+ fileList = _useState8[0],
125
+ setFileList = _useState8[1];
126
+
92
127
  var _useState9 = (0, _react.useState)(undefined),
93
- _useState10 = _slicedToArray(_useState9, 2),
94
- interval = _useState10[0],
95
- setInterval = _useState10[1];
128
+ _useState10 = _slicedToArray(_useState9, 2),
129
+ interval = _useState10[0],
130
+ setInterval = _useState10[1];
131
+
96
132
  var _useState11 = (0, _react.useState)(''),
97
- _useState12 = _slicedToArray(_useState11, 2),
98
- errorFile = _useState12[0],
99
- setErrorFile = _useState12[1];
133
+ _useState12 = _slicedToArray(_useState11, 2),
134
+ errorFile = _useState12[0],
135
+ setErrorFile = _useState12[1];
136
+
100
137
  var _useState13 = (0, _react.useState)(false),
101
- _useState14 = _slicedToArray(_useState13, 2),
102
- uploading = _useState14[0],
103
- setUploading = _useState14[1];
138
+ _useState14 = _slicedToArray(_useState13, 2),
139
+ uploading = _useState14[0],
140
+ setUploading = _useState14[1];
141
+
104
142
  var _useState15 = (0, _react.useState)(0),
105
- _useState16 = _slicedToArray(_useState15, 2),
106
- count = _useState16[0],
107
- setCount = _useState16[1];
143
+ _useState16 = _slicedToArray(_useState15, 2),
144
+ count = _useState16[0],
145
+ setCount = _useState16[1];
146
+
108
147
  var fileInputRef = (0, _react.useRef)();
109
148
  var fileName = (0, _react.useRef)('');
110
149
  var indexRef = (0, _react.useRef)(0);
150
+
111
151
  var _useSet = (0, _useSet3["default"])({
112
- step: 1,
113
- chunkSize: props.chunkSize || 10 * 1024 * 1024,
114
- totalChunk: 0,
115
- currentIndex: 0,
116
- chunkId: '',
117
- chunks: []
118
- }),
119
- _useSet2 = _slicedToArray(_useSet, 2),
120
- state = _useSet2[0],
121
- setState = _useSet2[1];
152
+ step: 1,
153
+ chunkSize: props.chunkSize || 10 * 1024 * 1024,
154
+ totalChunk: 0,
155
+ currentIndex: 0,
156
+ chunkId: '',
157
+ chunks: []
158
+ }),
159
+ _useSet2 = _slicedToArray(_useSet, 2),
160
+ state = _useSet2[0],
161
+ setState = _useSet2[1];
162
+
122
163
  var token = (0, _getToken["default"])();
164
+
123
165
  if (!token) {
124
166
  token = props.token;
125
167
  }
168
+
126
169
  var newErrorDownloadName = errorDownloadName;
170
+
127
171
  if (!errorDownloadName) {
128
172
  newErrorDownloadName = fileName.current;
129
173
  }
174
+
130
175
  (0, _ahooks.useInterval)(function () {
131
176
  if (countdown === 0) {
132
177
  return close();
133
178
  }
179
+
134
180
  setCountdown(countdown - 1);
135
181
  }, interval);
136
182
  (0, _react.useEffect)(function () {
137
183
  if (fileList.length !== 0) {
138
184
  fileName.current = getFileName(fileList[0].name);
139
185
  }
140
- }, [fileList]);
186
+ }, [fileList]); // 开始准备文件
141
187
 
142
- // 开始准备文件
143
188
  function checkFile(file) {
144
189
  if (file.size <= state.chunkSize) {
145
190
  upload(file);
@@ -155,14 +200,15 @@ var VtxImport2 = function VtxImport2(props) {
155
200
  step: 2
156
201
  });
157
202
  }
158
- }
159
- // 开始上传
203
+ } // 开始上传
204
+
205
+
160
206
  function startUpload() {
161
207
  var dataArr = [];
162
208
  state.chunks.forEach(function (e, i) {
163
209
  //创建formdata对象
164
- var data = new FormData();
165
- // data.append("totalNumber", state.chunks.length)
210
+ var data = new FormData(); // data.append("totalNumber", state.chunks.length)
211
+
166
212
  data.append('chunkSize', state.chunks.length);
167
213
  data.append('chunkNo', i + 1);
168
214
  data.append('chunkId', state.chunkId);
@@ -171,11 +217,13 @@ var VtxImport2 = function VtxImport2(props) {
171
217
  dataArr.push(data);
172
218
  });
173
219
  uploadAsync(dataArr);
174
- }
175
- // 上传
220
+ } // 上传
221
+
222
+
176
223
  function uploadAsync(list) {
177
224
  if (indexRef.current < list.length) {
178
225
  var xhr = new XMLHttpRequest();
226
+
179
227
  xhr.onload = function () {
180
228
  if (xhr.status === 200) {
181
229
  setState({
@@ -185,35 +233,42 @@ var VtxImport2 = function VtxImport2(props) {
185
233
  uploadAsync(list);
186
234
  }
187
235
  };
236
+
188
237
  xhr.onerror = function () {
189
238
  _antd.message.error('上传失败');
190
- };
191
- // 发送请求
239
+ }; // 发送请求
240
+
241
+
192
242
  xhr.open('POST', '/cloudFile/common/uploadChunk', true);
193
243
  xhr.send(list[indexRef.current]);
194
244
  } else {
195
245
  mergeFile();
196
246
  }
197
- }
198
- // 合并分片
247
+ } // 合并分片
248
+
249
+
199
250
  function mergeFile() {
200
- var xhr = new XMLHttpRequest();
201
- // 当上传完成时调用
251
+ var xhr = new XMLHttpRequest(); // 当上传完成时调用
252
+
202
253
  xhr.onload = function () {
203
254
  if (xhr.status === 200) {
204
255
  var res = JSON.parse(xhr.responseText);
256
+
205
257
  if ((res === null || res === void 0 ? void 0 : res.result) == 0) {
206
258
  _antd.message.success('上传成功');
259
+
207
260
  chunkUpload(res.data);
208
261
  } else {
209
262
  _antd.message.error((res === null || res === void 0 ? void 0 : res.msg) || '上传失败');
210
263
  }
211
264
  }
212
265
  };
266
+
213
267
  xhr.onerror = function () {
214
268
  _antd.message.error('上传失败');
215
- };
216
- // 发送请求
269
+ }; // 发送请求
270
+
271
+
217
272
  xhr.open('POST', '/cloudFile/common/mergeChunk', true);
218
273
  var data = new FormData();
219
274
  data.append('chunkId', state.chunkId);
@@ -221,8 +276,9 @@ var VtxImport2 = function VtxImport2(props) {
221
276
  data.append('chunkSize', state.chunks.length);
222
277
  data.append('fileName', fileList[0].name);
223
278
  xhr.send(data);
224
- }
225
- // 合并切片后上传
279
+ } // 合并切片后上传
280
+
281
+
226
282
  function chunkUpload(data) {
227
283
  var postUrl = getPostURL();
228
284
  var fmd = new FormData();
@@ -230,18 +286,23 @@ var VtxImport2 = function VtxImport2(props) {
230
286
  var request = new XMLHttpRequest();
231
287
  request.open('POST', postUrl);
232
288
  var signature = (0, _getSignature["default"])(postData);
289
+
233
290
  for (var key in signature) {
234
291
  request.setRequestHeader(key, signature[key]);
235
292
  }
293
+
236
294
  request.setRequestHeader('Authorization', token ? "Bearer ".concat(token) : '');
237
295
  request.setRequestHeader('access_token', token ? "".concat(token) : '');
296
+
238
297
  request.onreadystatechange = function (e) {
239
298
  if (e.target.readyState == 4) {
240
299
  dealResult(e.target.response);
241
300
  }
242
301
  };
302
+
243
303
  request.send(fmd);
244
304
  }
305
+
245
306
  function upload(files) {
246
307
  var postUrl = getPostURL();
247
308
  var fmd = new FormData();
@@ -249,49 +310,61 @@ var VtxImport2 = function VtxImport2(props) {
249
310
  var request = new XMLHttpRequest();
250
311
  request.open('POST', postUrl);
251
312
  var signature = (0, _getSignature["default"])(postData);
313
+
252
314
  for (var key in signature) {
253
315
  request.setRequestHeader(key, signature[key]);
254
316
  }
317
+
255
318
  request.setRequestHeader('Authorization', token ? "Bearer ".concat(token) : '');
256
319
  request.setRequestHeader('access_token', token ? "".concat(token) : '');
320
+
257
321
  request.onreadystatechange = function (e) {
258
322
  if (e.target.readyState == 4) {
259
323
  dealResult(e.target.response);
260
324
  }
261
325
  };
326
+
262
327
  request.send(fmd);
263
- }
264
- // 切片文件
328
+ } // 切片文件
329
+
330
+
265
331
  function spreadFile(file) {
266
332
  var chunks = [];
267
333
  var start = 0;
268
334
  var end;
335
+
269
336
  while (start < file.size) {
270
337
  end = Math.min(start + state.chunkSize, file.size);
271
338
  chunks.push(file.slice(start, end));
272
339
  start = end;
273
340
  }
341
+
274
342
  return chunks;
275
- }
343
+ } // 获取上传地址(拼接参数)
344
+
276
345
 
277
- // 获取上传地址(拼接参数)
278
346
  var getPostURL = function getPostURL() {
279
347
  var postUrl = uploadURL;
280
348
  var postArray = [];
349
+
281
350
  for (var k in postData) {
282
351
  if (postData[k] !== undefined && postData[k] !== null && postData[k] !== '') {
283
352
  postArray.push("".concat(k, "=").concat(encodeURIComponent(postData[k])));
284
353
  }
285
354
  }
355
+
286
356
  return postArray.length > 0 ? "".concat(postUrl, "?").concat(postArray.join('&')) : postUrl;
287
357
  };
358
+
288
359
  var dealResult = function dealResult(response) {
289
360
  setUploading(false);
290
361
  var parseData = JSON.parse(response);
291
362
  setStatus(1);
363
+
292
364
  if (typeof props.afterUpload === 'function') {
293
365
  afterUpload(parseData);
294
366
  }
367
+
295
368
  if (parseData.result === 0) {
296
369
  setResult(true);
297
370
  setCountdown(5);
@@ -300,6 +373,7 @@ var VtxImport2 = function VtxImport2(props) {
300
373
  } else if (parseData.result === 1) {
301
374
  setResult(false);
302
375
  setFileList([]);
376
+
303
377
  if (parseData.data) {
304
378
  setErrorFile(parseData.data);
305
379
  } else {
@@ -307,35 +381,44 @@ var VtxImport2 = function VtxImport2(props) {
307
381
  }
308
382
  }
309
383
  };
384
+
310
385
  var onUpload = function onUpload(_ref) {
311
386
  var _ref$files = _ref.files,
312
- files = _ref$files === void 0 ? fileList : _ref$files;
387
+ files = _ref$files === void 0 ? fileList : _ref$files;
388
+
313
389
  if (typeof props.beforeUpload === 'function') {
314
390
  var flag = beforeUpload(files[0]);
391
+
315
392
  if (!flag) {
316
393
  setFileList([]);
317
394
  return;
318
395
  }
319
396
  }
397
+
320
398
  if (files.length === 0) {
321
399
  return _antd.message.info(TextEnum.msgUploadWarningText);
322
400
  }
323
- setUploading(true);
324
- // 上传文件
401
+
402
+ setUploading(true); // 上传文件
403
+
325
404
  checkFile(files[0]);
326
405
  };
406
+
327
407
  var againUpload = function againUpload() {
328
408
  setInterval(undefined);
329
409
  setFileList([]);
330
410
  fileInputRef.current && fileInputRef.current.click();
331
411
  };
412
+
332
413
  var onFileChange = function onFileChange() {
333
414
  var fileList = _toConsumableArray(fileInputRef.current.files);
415
+
334
416
  setFileList(fileList);
335
417
  onUpload({
336
418
  files: fileList
337
419
  });
338
420
  };
421
+
339
422
  (0, _react.useEffect)(function () {
340
423
  if (state.chunkId) {
341
424
  startUpload();
@@ -391,6 +474,7 @@ var VtxImport2 = function VtxImport2(props) {
391
474
  value: fileList.length === 0 ? '' : fileList[0].fileName
392
475
  }));
393
476
  };
477
+
394
478
  VtxImport2.defaultProps = {
395
479
  fileKey: 'file',
396
480
  accept: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv',
@@ -414,5 +498,6 @@ VtxImport2.propTypes = {
414
498
  beforeUpload: _propTypes["default"].func,
415
499
  chunkSize: _propTypes["default"].number
416
500
  };
417
- var _default = exports["default"] = VtxImport2;
501
+ var _default = VtxImport2;
502
+ exports["default"] = _default;
418
503
  //# sourceMappingURL=index.js.map