@vtx/components 3.1.133 → 3.1.135

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 (307) 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/ColumnSetting.js +89 -49
  46. package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
  47. package/lib/vtx-datagrid/ResizeableTitle.js +18 -6
  48. package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
  49. package/lib/vtx-datagrid/index.js +205 -132
  50. package/lib/vtx-datagrid/index.js.map +1 -1
  51. package/lib/vtx-datagrid/renderColumnButtons.js +46 -15
  52. package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
  53. package/lib/vtx-datagrid/style/css.js +10 -0
  54. package/lib/vtx-datagrid/style/css.js.map +1 -1
  55. package/lib/vtx-datagrid/style/index.js +10 -0
  56. package/lib/vtx-datagrid/style/index.js.map +1 -1
  57. package/lib/vtx-date-picker/QdatePicker.js +58 -28
  58. package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
  59. package/lib/vtx-date-picker/generatePicker.js +77 -35
  60. package/lib/vtx-date-picker/generatePicker.js.map +1 -1
  61. package/lib/vtx-date-picker/index.js +8 -2
  62. package/lib/vtx-date-picker/index.js.map +1 -1
  63. package/lib/vtx-date-picker/style/css.js +1 -0
  64. package/lib/vtx-date-picker/style/css.js.map +1 -1
  65. package/lib/vtx-date-picker/style/index.js +1 -0
  66. package/lib/vtx-date-picker/style/index.js.map +1 -1
  67. package/lib/vtx-date-picker/style/index.less +39 -39
  68. package/lib/vtx-editor/index.js +32 -13
  69. package/lib/vtx-editor/index.js.map +1 -1
  70. package/lib/vtx-editor/style/css.js +1 -0
  71. package/lib/vtx-editor/style/css.js.map +1 -1
  72. package/lib/vtx-editor/style/index.js +1 -0
  73. package/lib/vtx-editor/style/index.js.map +1 -1
  74. package/lib/vtx-editor/style/index.less +8 -8
  75. package/lib/vtx-ellipsis-text/index.js +29 -16
  76. package/lib/vtx-ellipsis-text/index.js.map +1 -1
  77. package/lib/vtx-ellipsis-text/style/css.js +1 -0
  78. package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
  79. package/lib/vtx-ellipsis-text/style/index.js +1 -0
  80. package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
  81. package/lib/vtx-ellipsis-text/style/index.less +13 -13
  82. package/lib/vtx-export/index.js +73 -38
  83. package/lib/vtx-export/index.js.map +1 -1
  84. package/lib/vtx-export/style/css.js +5 -0
  85. package/lib/vtx-export/style/css.js.map +1 -1
  86. package/lib/vtx-export/style/index.js +5 -0
  87. package/lib/vtx-export/style/index.js.map +1 -1
  88. package/lib/vtx-export-async/History.js +117 -75
  89. package/lib/vtx-export-async/History.js.map +1 -1
  90. package/lib/vtx-export-async/index.js +121 -80
  91. package/lib/vtx-export-async/index.js.map +1 -1
  92. package/lib/vtx-export-async/style/css.js.map +1 -1
  93. package/lib/vtx-export-async/style/index.js.map +1 -1
  94. package/lib/vtx-export-async/util.js +21 -9
  95. package/lib/vtx-export-async/util.js.map +1 -1
  96. package/lib/vtx-form-layout/Card.js +39 -17
  97. package/lib/vtx-form-layout/Card.js.map +1 -1
  98. package/lib/vtx-form-layout/Divider.js +12 -6
  99. package/lib/vtx-form-layout/Divider.js.map +1 -1
  100. package/lib/vtx-form-layout/FormItem.js +38 -16
  101. package/lib/vtx-form-layout/FormItem.js.map +1 -1
  102. package/lib/vtx-form-layout/Pane.js +10 -4
  103. package/lib/vtx-form-layout/Pane.js.map +1 -1
  104. package/lib/vtx-form-layout/Row.js +9 -2
  105. package/lib/vtx-form-layout/Row.js.map +1 -1
  106. package/lib/vtx-form-layout/context.js +4 -1
  107. package/lib/vtx-form-layout/context.js.map +1 -1
  108. package/lib/vtx-form-layout/demo/Modal.less +43 -43
  109. package/lib/vtx-form-layout/index.js +25 -10
  110. package/lib/vtx-form-layout/index.js.map +1 -1
  111. package/lib/vtx-form-layout/style/css.js +7 -0
  112. package/lib/vtx-form-layout/style/css.js.map +1 -1
  113. package/lib/vtx-form-layout/style/index.js +7 -0
  114. package/lib/vtx-form-layout/style/index.js.map +1 -1
  115. package/lib/vtx-form-layout/style/index.less +220 -220
  116. package/lib/vtx-image/Image.js +117 -77
  117. package/lib/vtx-image/Image.js.map +1 -1
  118. package/lib/vtx-image/Preview.js +63 -34
  119. package/lib/vtx-image/Preview.js.map +1 -1
  120. package/lib/vtx-image/PreviewGroup.js +54 -24
  121. package/lib/vtx-image/PreviewGroup.js.map +1 -1
  122. package/lib/vtx-image/index.js +11 -4
  123. package/lib/vtx-image/index.js.map +1 -1
  124. package/lib/vtx-image/style/css.js +1 -0
  125. package/lib/vtx-image/style/css.js.map +1 -1
  126. package/lib/vtx-image/style/index.js +1 -0
  127. package/lib/vtx-image/style/index.js.map +1 -1
  128. package/lib/vtx-import/index.js +82 -49
  129. package/lib/vtx-import/index.js.map +1 -1
  130. package/lib/vtx-import/result.js +33 -15
  131. package/lib/vtx-import/result.js.map +1 -1
  132. package/lib/vtx-import/style/css.js +3 -0
  133. package/lib/vtx-import/style/css.js.map +1 -1
  134. package/lib/vtx-import/style/index.js +3 -0
  135. package/lib/vtx-import/style/index.js.map +1 -1
  136. package/lib/vtx-import/style/index.less +8 -8
  137. package/lib/vtx-import2/CheckResult.js +9 -2
  138. package/lib/vtx-import2/CheckResult.js.map +1 -1
  139. package/lib/vtx-import2/Content.js +38 -16
  140. package/lib/vtx-import2/Content.js.map +1 -1
  141. package/lib/vtx-import2/DownloadSvg.js +7 -2
  142. package/lib/vtx-import2/DownloadSvg.js.map +1 -1
  143. package/lib/vtx-import2/ImportResult.js +15 -8
  144. package/lib/vtx-import2/ImportResult.js.map +1 -1
  145. package/lib/vtx-import2/UploadSvg.js +7 -2
  146. package/lib/vtx-import2/UploadSvg.js.map +1 -1
  147. package/lib/vtx-import2/index.js +117 -58
  148. package/lib/vtx-import2/index.js.map +1 -1
  149. package/lib/vtx-import2/style/css.js +3 -0
  150. package/lib/vtx-import2/style/css.js.map +1 -1
  151. package/lib/vtx-import2/style/index.js +3 -0
  152. package/lib/vtx-import2/style/index.js.map +1 -1
  153. package/lib/vtx-import2/style/index.less +102 -102
  154. package/lib/vtx-input/TextArea.js +31 -14
  155. package/lib/vtx-input/TextArea.js.map +1 -1
  156. package/lib/vtx-input/index.js +49 -24
  157. package/lib/vtx-input/index.js.map +1 -1
  158. package/lib/vtx-input/style/css.js +1 -0
  159. package/lib/vtx-input/style/css.js.map +1 -1
  160. package/lib/vtx-input/style/index.js +1 -0
  161. package/lib/vtx-input/style/index.js.map +1 -1
  162. package/lib/vtx-input/style/index.less +24 -24
  163. package/lib/vtx-input/useLength.js +23 -10
  164. package/lib/vtx-input/useLength.js.map +1 -1
  165. package/lib/vtx-modal/Title.js +9 -3
  166. package/lib/vtx-modal/Title.js.map +1 -1
  167. package/lib/vtx-modal/index.js +85 -52
  168. package/lib/vtx-modal/index.js.map +1 -1
  169. package/lib/vtx-modal/style/css.js +1 -0
  170. package/lib/vtx-modal/style/css.js.map +1 -1
  171. package/lib/vtx-modal/style/index.js +1 -0
  172. package/lib/vtx-modal/style/index.js.map +1 -1
  173. package/lib/vtx-page-layout/Basic.js +9 -4
  174. package/lib/vtx-page-layout/Basic.js.map +1 -1
  175. package/lib/vtx-page-layout/Content.js +27 -16
  176. package/lib/vtx-page-layout/Content.js.map +1 -1
  177. package/lib/vtx-page-layout/Pane.js +13 -4
  178. package/lib/vtx-page-layout/Pane.js.map +1 -1
  179. package/lib/vtx-page-layout/TableLayout.js +64 -34
  180. package/lib/vtx-page-layout/TableLayout.js.map +1 -1
  181. package/lib/vtx-page-layout/TableWrap.js +23 -12
  182. package/lib/vtx-page-layout/TableWrap.js.map +1 -1
  183. package/lib/vtx-page-layout/container.js +61 -32
  184. package/lib/vtx-page-layout/container.js.map +1 -1
  185. package/lib/vtx-page-layout/index.js +11 -2
  186. package/lib/vtx-page-layout/index.js.map +1 -1
  187. package/lib/vtx-page-layout/style/css.js.map +1 -1
  188. package/lib/vtx-page-layout/style/index.js.map +1 -1
  189. package/lib/vtx-page-layout/style/index.less +138 -138
  190. package/lib/vtx-rps-frame/index.js +69 -40
  191. package/lib/vtx-rps-frame/index.js.map +1 -1
  192. package/lib/vtx-rps-frame/style/css.js.map +1 -1
  193. package/lib/vtx-rps-frame/style/index.js.map +1 -1
  194. package/lib/vtx-scrollable-row/index.js +68 -34
  195. package/lib/vtx-scrollable-row/index.js.map +1 -1
  196. package/lib/vtx-scrollable-row/style/css.js.map +1 -1
  197. package/lib/vtx-scrollable-row/style/index.js.map +1 -1
  198. package/lib/vtx-scrollable-row/style/index.less +113 -113
  199. package/lib/vtx-search/VtxCol.js +27 -8
  200. package/lib/vtx-search/VtxCol.js.map +1 -1
  201. package/lib/vtx-search/VtxRow.js +15 -8
  202. package/lib/vtx-search/VtxRow.js.map +1 -1
  203. package/lib/vtx-search/index.js +112 -67
  204. package/lib/vtx-search/index.js.map +1 -1
  205. package/lib/vtx-search/style/css.js +4 -0
  206. package/lib/vtx-search/style/css.js.map +1 -1
  207. package/lib/vtx-search/style/index.js +4 -0
  208. package/lib/vtx-search/style/index.js.map +1 -1
  209. package/lib/vtx-search-map-input/index.js +98 -63
  210. package/lib/vtx-search-map-input/index.js.map +1 -1
  211. package/lib/vtx-search-map-input/style/css.js +2 -0
  212. package/lib/vtx-search-map-input/style/css.js.map +1 -1
  213. package/lib/vtx-search-map-input/style/index.js +2 -0
  214. package/lib/vtx-search-map-input/style/index.js.map +1 -1
  215. package/lib/vtx-select/index.js +99 -47
  216. package/lib/vtx-select/index.js.map +1 -1
  217. package/lib/vtx-select/style/css.js +8 -0
  218. package/lib/vtx-select/style/css.js.map +1 -1
  219. package/lib/vtx-select/style/index.js +8 -0
  220. package/lib/vtx-select/style/index.js.map +1 -1
  221. package/lib/vtx-select/style/index.less +68 -68
  222. package/lib/vtx-signature/index.js +34 -19
  223. package/lib/vtx-signature/index.js.map +1 -1
  224. package/lib/vtx-signature/style/css.js +2 -0
  225. package/lib/vtx-signature/style/css.js.map +1 -1
  226. package/lib/vtx-signature/style/index.js +2 -0
  227. package/lib/vtx-signature/style/index.js.map +1 -1
  228. package/lib/vtx-signature/style/index.less +33 -33
  229. package/lib/vtx-split-pane/Pane.js +23 -12
  230. package/lib/vtx-split-pane/Pane.js.map +1 -1
  231. package/lib/vtx-split-pane/Resizer.js +41 -21
  232. package/lib/vtx-split-pane/Resizer.js.map +1 -1
  233. package/lib/vtx-split-pane/SplitPane.js +111 -55
  234. package/lib/vtx-split-pane/SplitPane.js.map +1 -1
  235. package/lib/vtx-split-pane/index.js +7 -2
  236. package/lib/vtx-split-pane/index.js.map +1 -1
  237. package/lib/vtx-split-pane/style/css.js +3 -0
  238. package/lib/vtx-split-pane/style/css.js.map +1 -1
  239. package/lib/vtx-split-pane/style/index.js +3 -0
  240. package/lib/vtx-split-pane/style/index.js.map +1 -1
  241. package/lib/vtx-split-pane/style/index.less +76 -76
  242. package/lib/vtx-statistics-column/Back.js +11 -4
  243. package/lib/vtx-statistics-column/Back.js.map +1 -1
  244. package/lib/vtx-statistics-column/Item.js +32 -16
  245. package/lib/vtx-statistics-column/Item.js.map +1 -1
  246. package/lib/vtx-statistics-column/Total.js +31 -15
  247. package/lib/vtx-statistics-column/Total.js.map +1 -1
  248. package/lib/vtx-statistics-column/context.js +4 -1
  249. package/lib/vtx-statistics-column/context.js.map +1 -1
  250. package/lib/vtx-statistics-column/index.js +19 -2
  251. package/lib/vtx-statistics-column/index.js.map +1 -1
  252. package/lib/vtx-statistics-column/style/css.js +1 -0
  253. package/lib/vtx-statistics-column/style/css.js.map +1 -1
  254. package/lib/vtx-statistics-column/style/index.js +1 -0
  255. package/lib/vtx-statistics-column/style/index.js.map +1 -1
  256. package/lib/vtx-statistics-column/style/index.less +59 -59
  257. package/lib/vtx-time-picker/index.js +22 -8
  258. package/lib/vtx-time-picker/index.js.map +1 -1
  259. package/lib/vtx-time-picker/style/css.js.map +1 -1
  260. package/lib/vtx-time-picker/style/index.js.map +1 -1
  261. package/lib/vtx-tree/index.js +153 -83
  262. package/lib/vtx-tree/index.js.map +1 -1
  263. package/lib/vtx-tree/style/css.js +2 -0
  264. package/lib/vtx-tree/style/css.js.map +1 -1
  265. package/lib/vtx-tree/style/index.js +2 -0
  266. package/lib/vtx-tree/style/index.js.map +1 -1
  267. package/lib/vtx-tree/utils.js +31 -10
  268. package/lib/vtx-tree/utils.js.map +1 -1
  269. package/lib/vtx-tree-select/index.js +81 -37
  270. package/lib/vtx-tree-select/index.js.map +1 -1
  271. package/lib/vtx-tree-select/style/css.js +4 -0
  272. package/lib/vtx-tree-select/style/css.js.map +1 -1
  273. package/lib/vtx-tree-select/style/index.js +4 -0
  274. package/lib/vtx-tree-select/style/index.js.map +1 -1
  275. package/lib/vtx-upload/FilePreview.js +41 -17
  276. package/lib/vtx-upload/FilePreview.js.map +1 -1
  277. package/lib/vtx-upload/index.js +171 -91
  278. package/lib/vtx-upload/index.js.map +1 -1
  279. package/lib/vtx-upload/style/css.js +6 -0
  280. package/lib/vtx-upload/style/css.js.map +1 -1
  281. package/lib/vtx-upload/style/index.js +6 -0
  282. package/lib/vtx-upload/style/index.js.map +1 -1
  283. package/lib/vtx-upload/style/index.less +61 -61
  284. package/lib/vtx-wang-editor/index.js +126 -84
  285. package/lib/vtx-wang-editor/index.js.map +1 -1
  286. package/lib/vtx-wang-editor/style/css.js +1 -0
  287. package/lib/vtx-wang-editor/style/css.js.map +1 -1
  288. package/lib/vtx-wang-editor/style/index.js +1 -0
  289. package/lib/vtx-wang-editor/style/index.js.map +1 -1
  290. package/lib/vtx-wang-editor/style/index.less +12 -12
  291. package/lib/vtx-wang-editor/wangEditorUtil.js +141 -80
  292. package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
  293. package/lib/vtx-ztree/index.js +133 -77
  294. package/lib/vtx-ztree/index.js.map +1 -1
  295. package/lib/vtx-ztree/style/css.js +1 -0
  296. package/lib/vtx-ztree/style/css.js.map +1 -1
  297. package/lib/vtx-ztree/style/index.js +1 -0
  298. package/lib/vtx-ztree/style/index.js.map +1 -1
  299. package/lib/vtx-ztree/style/index.less +45 -45
  300. package/lib/vtx-ztree-select/index.js +159 -91
  301. package/lib/vtx-ztree-select/index.js.map +1 -1
  302. package/lib/vtx-ztree-select/style/css.js +3 -0
  303. package/lib/vtx-ztree-select/style/css.js.map +1 -1
  304. package/lib/vtx-ztree-select/style/index.js +3 -0
  305. package/lib/vtx-ztree-select/style/index.js.map +1 -1
  306. package/lib/vtx-ztree-select/style/index.less +109 -109
  307. package/package.json +122 -122
@@ -1,52 +1,86 @@
1
1
  "use strict";
2
2
 
3
- 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); }
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
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = void 0;
9
+
8
10
  var _react = _interopRequireWildcard(require("react"));
11
+
9
12
  var _useSetState3 = _interopRequireDefault(require("ahooks/es/useSetState"));
13
+
10
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
+
11
16
  var _viewerjs = _interopRequireDefault(require("viewerjs"));
17
+
12
18
  var _upload = _interopRequireDefault(require("antd/lib/upload"));
19
+
13
20
  var _button = _interopRequireDefault(require("antd/lib/button"));
21
+
14
22
  var _InboxOutlined = _interopRequireDefault(require("@ant-design/icons/InboxOutlined"));
23
+
15
24
  var _PlusOutlined = _interopRequireDefault(require("@ant-design/icons/PlusOutlined"));
25
+
16
26
  var _UploadOutlined = _interopRequireDefault(require("@ant-design/icons/UploadOutlined"));
27
+
17
28
  var _message = _interopRequireDefault(require("antd/lib/message"));
29
+
18
30
  var _downloadFile = _interopRequireDefault(require("@vtx/utils/lib/downloadFile"));
31
+
19
32
  var _lodash = _interopRequireDefault(require("lodash.debounce"));
33
+
20
34
  var _FilePreview = _interopRequireDefault(require("./FilePreview"));
35
+
21
36
  var _getToken = _interopRequireDefault(require("../_util/getToken"));
37
+
22
38
  var _antdImgCrop = _interopRequireDefault(require("antd-img-crop"));
23
- var _excluded = ["isDragger", "draggerConfig", "accept", "mode", "viewMode", "showUploadList", "customizedButton", "listType", "onSuccess", "onError", "onRemove", "maxFileSize", "beforeUpload", "maxNum", "flag", "crop"];
24
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
25
- 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); }
26
- 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; }
27
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
28
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
39
+
40
+ var _excluded = ["isDragger", "draggerConfig", "accept", "mode", "viewMode", "showUploadList", "customizedButton", "listType", "onSuccess", "onError", "onRemove", "maxFileSize", "beforeUpload", "maxNum", "flag", "crop", "customDownload"];
41
+
42
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
43
+
44
+ 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); }
45
+
46
+ 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; }
47
+
48
+ 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); }
49
+
50
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
51
+
29
52
  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."); }
30
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
31
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(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); }
37
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
53
+
54
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
55
+
56
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(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
+
64
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
65
+
38
66
  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."); }
39
- 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; } }
40
- 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; }
41
- 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; } }
42
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
43
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
44
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
67
+
68
+ 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); }
69
+
70
+ 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; }
71
+
72
+ 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; }
73
+
74
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
75
+
76
+ 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; }
77
+
78
+ 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; }
79
+
45
80
  var debouncedMessage = (0, _lodash["default"])(function (msg) {
46
81
  _message["default"].error(msg);
47
- }, 500);
82
+ }, 500); //文件预览
48
83
 
49
- //文件预览
50
84
  var initVPrev = {
51
85
  type: '',
52
86
  //video or file
@@ -58,87 +92,101 @@ var initVPrev = {
58
92
  var initUrl = {
59
93
  action: '/cloudFile/common/uploadFile',
60
94
  downloadUrl: '/cloudFile/common/downloadFile?id=',
61
- thumbnailUrl: '/vortex/rest/cloud/np/file/downloadFileThumbnail?outputQuality=0.5&scale=0.2&id='
62
- //previewUrl: '/onlinePreview',
63
- };
64
- //禁止上传的文件类型
95
+ thumbnailUrl: '/vortex/rest/cloud/np/file/downloadFileThumbnail?outputQuality=0.5&scale=0.2&id=' //previewUrl: '/onlinePreview',
96
+
97
+ }; //禁止上传的文件类型
98
+
65
99
  var rejectTypes = ['.asp', '.aspx', '.jsp', '.exe', '.cgi', '.asa', '.cer', '.cdx', '.hta'];
66
100
  var Dragger = _upload["default"].Dragger;
67
101
  var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
68
102
  var _window;
103
+
69
104
  var _props$isDragger = props.isDragger,
70
- isDragger = _props$isDragger === void 0 ? false : _props$isDragger,
71
- _props$draggerConfig = props.draggerConfig,
72
- draggerConfig = _props$draggerConfig === void 0 ? {} : _props$draggerConfig,
73
- accept = props.accept,
74
- _props$mode = props.mode,
75
- mode = _props$mode === void 0 ? 'multiple' : _props$mode,
76
- viewMode = props.viewMode,
77
- showUploadList = props.showUploadList,
78
- customizedButton = props.customizedButton,
79
- _props$listType = props.listType,
80
- listType = _props$listType === void 0 ? 'text' : _props$listType,
81
- onSuccess = props.onSuccess,
82
- onError = props.onError,
83
- _onRemove = props.onRemove,
84
- _props$maxFileSize = props.maxFileSize,
85
- maxFileSize = _props$maxFileSize === void 0 ? 5 * 1024 * 1024 : _props$maxFileSize,
86
- _beforeUpload = props.beforeUpload,
87
- maxNum = props.maxNum,
88
- flag = props.flag,
89
- crop = props.crop,
90
- rest = _objectWithoutProperties(props, _excluded);
91
- // 是否使用缩略图
105
+ isDragger = _props$isDragger === void 0 ? false : _props$isDragger,
106
+ _props$draggerConfig = props.draggerConfig,
107
+ draggerConfig = _props$draggerConfig === void 0 ? {} : _props$draggerConfig,
108
+ accept = props.accept,
109
+ _props$mode = props.mode,
110
+ mode = _props$mode === void 0 ? 'multiple' : _props$mode,
111
+ viewMode = props.viewMode,
112
+ showUploadList = props.showUploadList,
113
+ customizedButton = props.customizedButton,
114
+ _props$listType = props.listType,
115
+ listType = _props$listType === void 0 ? 'text' : _props$listType,
116
+ onSuccess = props.onSuccess,
117
+ onError = props.onError,
118
+ _onRemove = props.onRemove,
119
+ _props$maxFileSize = props.maxFileSize,
120
+ maxFileSize = _props$maxFileSize === void 0 ? 5 * 1024 * 1024 : _props$maxFileSize,
121
+ _beforeUpload = props.beforeUpload,
122
+ maxNum = props.maxNum,
123
+ flag = props.flag,
124
+ crop = props.crop,
125
+ customDownload = props.customDownload,
126
+ rest = _objectWithoutProperties(props, _excluded); // 是否使用缩略图
127
+
128
+
92
129
  var useThumbnail = (props.useThumbnail === undefined ? true : props.useThumbnail) && (listType == 'picture' || listType == 'picture-card');
130
+
93
131
  var _useState = (0, _react.useState)([]),
94
- _useState2 = _slicedToArray(_useState, 2),
95
- fileList = _useState2[0],
96
- setFileList = _useState2[1]; //初始化文件列表
132
+ _useState2 = _slicedToArray(_useState, 2),
133
+ fileList = _useState2[0],
134
+ setFileList = _useState2[1]; //初始化文件列表
135
+
136
+
97
137
  var _useState3 = (0, _react.useState)(null),
98
- _useState4 = _slicedToArray(_useState3, 2),
99
- imageViewer = _useState4[0],
100
- setImageViewer = _useState4[1]; //图片预览
138
+ _useState4 = _slicedToArray(_useState3, 2),
139
+ imageViewer = _useState4[0],
140
+ setImageViewer = _useState4[1]; //图片预览
141
+
142
+
101
143
  var _useState5 = (0, _react.useState)([]),
102
- _useState6 = _slicedToArray(_useState5, 2),
103
- imageList = _useState6[0],
104
- setImageList = _useState6[1];
144
+ _useState6 = _slicedToArray(_useState5, 2),
145
+ imageList = _useState6[0],
146
+ setImageList = _useState6[1];
147
+
105
148
  var _useState7 = (0, _react.useState)(null),
106
- _useState8 = _slicedToArray(_useState7, 2),
107
- imageCt = _useState8[0],
108
- setImageCt = _useState8[1];
109
- var _useSetState = (0, _useSetState3["default"])(initVPrev),
110
- _useSetState2 = _slicedToArray(_useSetState, 2),
111
- vPrev = _useSetState2[0],
112
- setVPrev = _useSetState2[1]; //文件预览相关
149
+ _useState8 = _slicedToArray(_useState7, 2),
150
+ imageCt = _useState8[0],
151
+ setImageCt = _useState8[1];
113
152
 
153
+ var _useSetState = (0, _useSetState3["default"])(initVPrev),
154
+ _useSetState2 = _slicedToArray(_useSetState, 2),
155
+ vPrev = _useSetState2[0],
156
+ setVPrev = _useSetState2[1]; //文件预览相关
114
157
  // 参数中拼接token
158
+
159
+
115
160
  function joinToken(str) {
116
161
  if (str.indexOf('token=') === -1 && str.indexOf('?') > -1) {
117
162
  return str.replace('?', "?token=".concat((0, _getToken["default"])() || '', "&"));
118
163
  } else if (str.indexOf('?') === -1) {
119
164
  return str + "?token=".concat((0, _getToken["default"])() || '');
120
165
  }
166
+
121
167
  return str;
122
168
  }
169
+
123
170
  var url = {
124
171
  action: props.action || initUrl.action,
125
172
  downloadUrl: joinToken(props.downloadUrl || initUrl.downloadUrl),
126
- thumbnailUrl: joinToken((_window = window) !== null && _window !== void 0 && _window.flsPrefix ? "".concat(window.flsPrefix).concat(initUrl.thumbnailUrl) : "".concat(props.thumbnailUrl || initUrl.thumbnailUrl))
127
- //previewUrl: props.previewUrl || initUrl.previewUrl,
173
+ thumbnailUrl: joinToken((_window = window) !== null && _window !== void 0 && _window.flsPrefix ? "".concat(window.flsPrefix).concat(initUrl.thumbnailUrl) : "".concat(props.thumbnailUrl || initUrl.thumbnailUrl)) //previewUrl: props.previewUrl || initUrl.previewUrl,
174
+
128
175
  };
129
176
  var action = url.action,
130
- downloadUrl = url.downloadUrl,
131
- thumbnailUrl = url.thumbnailUrl;
177
+ downloadUrl = url.downloadUrl,
178
+ thumbnailUrl = url.thumbnailUrl;
132
179
  (0, _react.useEffect)(function () {
133
180
  setFileList(getSynFileList(props) || []);
134
181
  }, [flag]);
135
182
  (0, _react.useEffect)(function () {
136
183
  if (Array.isArray(fileList)) {
137
184
  // 只有图片的才可以预览,这边需要判断是否是图片
138
- var imagelist = [];
139
- // 只能通过后缀来判断
185
+ var imagelist = []; // 只能通过后缀来判断
186
+
140
187
  fileList.map(function (file) {
141
188
  var _file$type;
189
+
142
190
  if (((_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf('image')) > -1) {
143
191
  imagelist.push(file);
144
192
  }
@@ -151,8 +199,10 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
151
199
  setImageViewer(new _viewerjs["default"](imageCt, {}));
152
200
  }
153
201
  }, [imageCt]);
202
+
154
203
  var getConfig = function getConfig() {
155
204
  var token = (0, _getToken["default"])() || '';
205
+
156
206
  var config = _objectSpread(_objectSpread({}, rest), {}, {
157
207
  accept: accept,
158
208
  action: action,
@@ -164,14 +214,18 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
164
214
  }, rest.headers),
165
215
  onChange: function onChange(info) {
166
216
  setFileList(info.fileList);
217
+
167
218
  if (info.file.response && info.file.response.result === 1) {
168
219
  _message["default"].error(info.file.response.errMsg || '上传失败!');
220
+
169
221
  var flt = _toConsumableArray(fileList);
222
+
170
223
  flt.pop();
171
224
  setFileList(flt);
172
225
  return;
173
- }
174
- // 此处根据后台返回的数据结构取得文件ID
226
+ } // 此处根据后台返回的数据结构取得文件ID
227
+
228
+
175
229
  if (info.file.status !== 'uploading' && info.file.status !== 'removed') {
176
230
  var vtxId = info.file.response && Array.isArray(info.file.response.data) && info.file.response.data.length > 0 ? info.file.response.data[0].id : undefined;
177
231
  var newFileList = info.fileList;
@@ -192,21 +246,23 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
192
246
  thumbUrl: useThumbnail ? thumbnailUrl + vtxId : undefined
193
247
  });
194
248
  }
249
+
195
250
  return item;
196
251
  });
252
+
197
253
  if (mode == 'single') {
198
254
  setFileList([newFile]);
199
255
  } else {
200
256
  setFileList(newFileList);
201
- }
202
- // 更新组件状态
257
+ } // 更新组件状态
203
258
  // if (mode == 'single' && info.file.status === 'done') {
204
259
  // setFileList([newFile]);
205
260
  // } else {
206
261
  // setFileList(newFileList);
207
262
  // }
208
-
209
263
  // 触发外部方法
264
+
265
+
210
266
  if (info.file.status === 'done') {
211
267
  if (typeof onSuccess == 'function') {
212
268
  onSuccess(newFile);
@@ -227,29 +283,38 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
227
283
  //限制文件大小
228
284
  if (maxFileSize && typeof maxFileSize === 'number') {
229
285
  var limit = file.size < maxFileSize;
286
+
230
287
  if (!limit) {
231
288
  _message["default"].error("\u8BF7\u4E0A\u4F20".concat(maxFileSize / 1024 / 1024, "M\u4EE5\u5185\u7684\u6587\u4EF6"));
289
+
232
290
  return false;
233
291
  }
234
- }
235
- //限制不允许上传的文件类型(通过文件名后缀)
292
+ } //限制不允许上传的文件类型(通过文件名后缀)
293
+
294
+
236
295
  var pointIndex = file.name ? file.name.lastIndexOf('.') : -1;
296
+
237
297
  if (pointIndex > -1) {
238
298
  var fileType = file.name.substring(pointIndex);
299
+
239
300
  if (rejectTypes.includes(fileType)) {
240
301
  _message["default"].error('不支持该文件类型');
302
+
241
303
  return false;
242
304
  }
243
- }
244
- // 多选限制文件数量
305
+ } // 多选限制文件数量
306
+
307
+
245
308
  if (typeof maxNum === 'number' && afterFileList.length + fileList.length > maxNum) {
246
309
  // 减少提示错误次数, 思路,防抖 这边有个问题 就是防抖的这个方法 return fasle 不上传
247
310
  debouncedMessage("\u6700\u591A\u4E0A\u4F20".concat(maxNum, "\u4E2A"));
248
311
  return false;
249
312
  }
313
+
250
314
  if (typeof _beforeUpload === 'function') {
251
315
  return _beforeUpload(file, afterFileList);
252
316
  }
317
+
253
318
  return true;
254
319
  },
255
320
  onDownload: function onDownload(file) {
@@ -258,11 +323,13 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
258
323
  }, 'blob');
259
324
  }
260
325
  });
326
+
261
327
  if (props.onPreview && typeof props.onPreview === 'function') {
262
328
  config.onPreview = props.onPreview;
263
329
  } else {
264
330
  config.onPreview = function (file) {
265
331
  var _file$type2, _file$type3;
332
+
266
333
  if (!file.type) {
267
334
  (0, _downloadFile["default"])(downloadUrl + file.id, {
268
335
  fileName: file.name
@@ -276,15 +343,14 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
276
343
  name: file.name || '视频预览',
277
344
  url: downloadUrl + file.id,
278
345
  downloadUrl: downloadUrl + file.id,
279
- visible: true
346
+ visible: true,
347
+ customDownload: customDownload
280
348
  });
281
349
  } else {
282
350
  (0, _downloadFile["default"])(downloadUrl + file.id, {
283
351
  fileName: file.name
284
352
  }, 'blob');
285
- }
286
-
287
- // TODO 暂无好的文件预览服务,等后续完善,只提供下载
353
+ } // TODO 暂无好的文件预览服务,等后续完善,只提供下载
288
354
  // else if (
289
355
  // file.type == 'application/PDF' ||
290
356
  // file.type == 'application/vnd.ms-excel' ||
@@ -302,7 +368,6 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
302
368
  // '?id=' + file.id + '&fullfilename=' + file.name.replace(/\s*/g, ''),
303
369
  // )}`;
304
370
  // }
305
-
306
371
  // setVPrev({
307
372
  // type: 'file',
308
373
  // name: file.name || '文件预览',
@@ -311,18 +376,21 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
311
376
  // visible: true,
312
377
  // });
313
378
  // }
379
+
314
380
  };
315
- }
381
+ } // viewMode
382
+
316
383
 
317
- // viewMode
318
384
  if (viewMode) {
319
385
  config.showUploadList = {
320
386
  showRemoveIcon: false,
321
387
  showDownloadIcon: true
322
388
  };
323
389
  }
390
+
324
391
  return config;
325
392
  };
393
+
326
394
  var handlePreview = function handlePreview(file) {
327
395
  var imageIndex = imageList.map(function (item) {
328
396
  return item.id;
@@ -331,23 +399,28 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
331
399
  imageViewer.update();
332
400
  imageViewer.view(imageIndex);
333
401
  };
402
+
334
403
  var getSynFileList = function getSynFileList(props) {
335
- var processedFileList = props.fileList || [];
336
- // 单文件模式只取第一个
404
+ var processedFileList = props.fileList || []; // 单文件模式只取第一个
405
+
337
406
  if (props.mode == 'single' && processedFileList.length > 1) {
338
407
  processedFileList = [processedFileList[0]];
339
408
  }
409
+
340
410
  processedFileList = processedFileList.map(function (item, index) {
341
411
  // 将外部传入的简易文件数组处理成为组件需要的数组结构
342
412
  if (item.name === undefined || item.id === undefined) {
343
413
  // eslint-disable-next-line no-console
344
414
  console.error('文件列表的name和id属性不能为空');
345
415
  }
416
+
346
417
  var url = item.url || downloadUrl + item.id,
347
- thumbUrl = useThumbnail ? item.thumbUrl || thumbnailUrl + item.id : undefined;
418
+ thumbUrl = useThumbnail ? item.thumbUrl || thumbnailUrl + item.id : undefined;
419
+
348
420
  if (!isSupportThumbnail(item.type)) {
349
421
  thumbUrl = url;
350
422
  }
423
+
351
424
  return _objectSpread(_objectSpread({}, item), {}, {
352
425
  uid: -1 - index,
353
426
  status: 'done',
@@ -357,6 +430,7 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
357
430
  });
358
431
  return processedFileList;
359
432
  };
433
+
360
434
  var upload = /*#__PURE__*/_react["default"].createElement(_upload["default"], _extends({}, getConfig(), {
361
435
  ref: ref
362
436
  }), viewMode || fileList.length >= maxNum ? null : customizedButton || (listType == 'picture-card' ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_PlusOutlined["default"], {
@@ -367,6 +441,7 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
367
441
  }), /*#__PURE__*/_react["default"].createElement("div", {
368
442
  className: "ant-upload-text"
369
443
  }, "\u4E0A\u4F20")) : /*#__PURE__*/_react["default"].createElement(_button["default"], null, /*#__PURE__*/_react["default"].createElement(_UploadOutlined["default"], null), "\u4E0A\u4F20")));
444
+
370
445
  var comp = listType == 'picture-card' && !!crop ? /*#__PURE__*/_react["default"].createElement(_antdImgCrop["default"], {
371
446
  rotationSlider: true
372
447
  }, upload) : upload;
@@ -397,6 +472,7 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
397
472
  }
398
473
  }, imageList.filter(function (item) {
399
474
  var _item$type;
475
+
400
476
  return item.type && ((_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.indexOf('image')) > -1;
401
477
  }).map(function (item, index) {
402
478
  return /*#__PURE__*/_react["default"].createElement("li", {
@@ -428,6 +504,7 @@ VtxUpload.propTypes = {
428
504
  onError: _propTypes["default"].func,
429
505
  onRemove: _propTypes["default"].func,
430
506
  onPreview: _propTypes["default"].func,
507
+ customDownload: _propTypes["default"].func,
431
508
  maxFileSize: _propTypes["default"].number,
432
509
  beforeUpload: _propTypes["default"].func,
433
510
  maxNum: _propTypes["default"].number,
@@ -436,11 +513,14 @@ VtxUpload.propTypes = {
436
513
  useThumbnail: _propTypes["default"].bool,
437
514
  crop: _propTypes["default"].bool
438
515
  };
439
- var _default = exports["default"] = VtxUpload;
516
+ var _default = VtxUpload;
517
+ exports["default"] = _default;
518
+
440
519
  function isSupportThumbnail(type) {
441
520
  if (['image/webp'].includes(type)) {
442
521
  return false;
443
522
  }
523
+
444
524
  return true;
445
525
  }
446
526
  //# sourceMappingURL=index.js.map