@vtx/components 3.1.76 → 3.1.78

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 (306) hide show
  1. package/lib/_util/filterSpecialCharacters.js +44 -55
  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 +15 -7
  6. package/lib/_util/getToken.js.map +1 -1
  7. package/lib/_util/getUrlParam.js +8 -1
  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 +12 -2
  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 +39 -23
  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 +29 -0
  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 +26 -9
  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 +86 -46
  36. package/lib/vtx-combogrid/Combogrid.js.map +1 -1
  37. package/lib/vtx-combogrid/index.js +59 -30
  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 +13 -4
  44. package/lib/vtx-datagrid/Alert.js.map +1 -1
  45. package/lib/vtx-datagrid/ColumnSetting.js +75 -36
  46. package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
  47. package/lib/vtx-datagrid/ResizeableTitle.js +15 -3
  48. package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
  49. package/lib/vtx-datagrid/index.js +170 -100
  50. package/lib/vtx-datagrid/index.js.map +1 -1
  51. package/lib/vtx-datagrid/renderColumnButtons.js +38 -7
  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 +51 -21
  58. package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
  59. package/lib/vtx-date-picker/generatePicker.js +65 -24
  60. package/lib/vtx-date-picker/generatePicker.js.map +1 -1
  61. package/lib/vtx-date-picker/index.js +7 -1
  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 +28 -9
  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 +27 -14
  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 +61 -28
  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 +93 -56
  89. package/lib/vtx-export-async/History.js.map +1 -1
  90. package/lib/vtx-export-async/index.js +97 -56
  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 +13 -2
  95. package/lib/vtx-export-async/util.js.map +1 -1
  96. package/lib/vtx-form-layout/Card.js +33 -11
  97. package/lib/vtx-form-layout/Card.js.map +1 -1
  98. package/lib/vtx-form-layout/Divider.js +11 -5
  99. package/lib/vtx-form-layout/Divider.js.map +1 -1
  100. package/lib/vtx-form-layout/FormItem.js +33 -11
  101. package/lib/vtx-form-layout/FormItem.js.map +1 -1
  102. package/lib/vtx-form-layout/Pane.js +9 -3
  103. package/lib/vtx-form-layout/Pane.js.map +1 -1
  104. package/lib/vtx-form-layout/Row.js +8 -1
  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 +24 -9
  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 +216 -216
  116. package/lib/vtx-image/Image.js +113 -73
  117. package/lib/vtx-image/Image.js.map +1 -1
  118. package/lib/vtx-image/Preview.js +59 -30
  119. package/lib/vtx-image/Preview.js.map +1 -1
  120. package/lib/vtx-image/PreviewGroup.js +47 -17
  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 +78 -45
  129. package/lib/vtx-import/index.js.map +1 -1
  130. package/lib/vtx-import/result.js +28 -10
  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 +8 -1
  138. package/lib/vtx-import2/CheckResult.js.map +1 -1
  139. package/lib/vtx-import2/Content.js +33 -11
  140. package/lib/vtx-import2/Content.js.map +1 -1
  141. package/lib/vtx-import2/DownloadSvg.js +6 -1
  142. package/lib/vtx-import2/DownloadSvg.js.map +1 -1
  143. package/lib/vtx-import2/ImportResult.js +14 -7
  144. package/lib/vtx-import2/ImportResult.js.map +1 -1
  145. package/lib/vtx-import2/UploadSvg.js +6 -1
  146. package/lib/vtx-import2/UploadSvg.js.map +1 -1
  147. package/lib/vtx-import2/index.js +107 -52
  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 +27 -10
  155. package/lib/vtx-input/TextArea.js.map +1 -1
  156. package/lib/vtx-input/index.js +45 -20
  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 +20 -7
  164. package/lib/vtx-input/useLength.js.map +1 -1
  165. package/lib/vtx-modal/Title.js +8 -2
  166. package/lib/vtx-modal/Title.js.map +1 -1
  167. package/lib/vtx-modal/index.js +82 -49
  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 +8 -3
  174. package/lib/vtx-page-layout/Basic.js.map +1 -1
  175. package/lib/vtx-page-layout/Content.js +26 -15
  176. package/lib/vtx-page-layout/Content.js.map +1 -1
  177. package/lib/vtx-page-layout/Pane.js +12 -3
  178. package/lib/vtx-page-layout/Pane.js.map +1 -1
  179. package/lib/vtx-page-layout/TableLayout.js +60 -30
  180. package/lib/vtx-page-layout/TableLayout.js.map +1 -1
  181. package/lib/vtx-page-layout/TableWrap.js +22 -11
  182. package/lib/vtx-page-layout/TableWrap.js.map +1 -1
  183. package/lib/vtx-page-layout/container.js +51 -23
  184. package/lib/vtx-page-layout/container.js.map +1 -1
  185. package/lib/vtx-page-layout/index.js +10 -1
  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 +57 -37
  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 +64 -30
  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 +26 -7
  200. package/lib/vtx-search/VtxCol.js.map +1 -1
  201. package/lib/vtx-search/VtxRow.js +14 -7
  202. package/lib/vtx-search/VtxRow.js.map +1 -1
  203. package/lib/vtx-search/index.js +106 -61
  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 +89 -56
  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 +87 -37
  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 +33 -18
  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 +22 -11
  230. package/lib/vtx-split-pane/Pane.js.map +1 -1
  231. package/lib/vtx-split-pane/Resizer.js +39 -19
  232. package/lib/vtx-split-pane/Resizer.js.map +1 -1
  233. package/lib/vtx-split-pane/SplitPane.js +107 -51
  234. package/lib/vtx-split-pane/SplitPane.js.map +1 -1
  235. package/lib/vtx-split-pane/index.js +6 -1
  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 +9 -2
  243. package/lib/vtx-statistics-column/Back.js.map +1 -1
  244. package/lib/vtx-statistics-column/Item.js +30 -14
  245. package/lib/vtx-statistics-column/Item.js.map +1 -1
  246. package/lib/vtx-statistics-column/Total.js +30 -14
  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 +18 -1
  251. package/lib/vtx-statistics-column/index.js.map +1 -1
  252. package/lib/vtx-statistics-column/style/css.js.map +1 -1
  253. package/lib/vtx-statistics-column/style/index.js.map +1 -1
  254. package/lib/vtx-statistics-column/style/index.less +59 -59
  255. package/lib/vtx-time-picker/index.js +18 -4
  256. package/lib/vtx-time-picker/index.js.map +1 -1
  257. package/lib/vtx-time-picker/style/css.js.map +1 -1
  258. package/lib/vtx-time-picker/style/index.js.map +1 -1
  259. package/lib/vtx-tree/index.js +114 -49
  260. package/lib/vtx-tree/index.js.map +1 -1
  261. package/lib/vtx-tree/style/css.js +2 -0
  262. package/lib/vtx-tree/style/css.js.map +1 -1
  263. package/lib/vtx-tree/style/index.js +2 -0
  264. package/lib/vtx-tree/style/index.js.map +1 -1
  265. package/lib/vtx-tree/style/index.less +53 -53
  266. package/lib/vtx-tree/utils.js +27 -6
  267. package/lib/vtx-tree/utils.js.map +1 -1
  268. package/lib/vtx-tree-select/index.js +71 -27
  269. package/lib/vtx-tree-select/index.js.map +1 -1
  270. package/lib/vtx-tree-select/style/css.js +3 -0
  271. package/lib/vtx-tree-select/style/css.js.map +1 -1
  272. package/lib/vtx-tree-select/style/index.js +3 -0
  273. package/lib/vtx-tree-select/style/index.js.map +1 -1
  274. package/lib/vtx-upload/FilePreview.js +33 -15
  275. package/lib/vtx-upload/FilePreview.js.map +1 -1
  276. package/lib/vtx-upload/index.js +169 -90
  277. package/lib/vtx-upload/index.js.map +1 -1
  278. package/lib/vtx-upload/style/css.js +7 -0
  279. package/lib/vtx-upload/style/css.js.map +1 -1
  280. package/lib/vtx-upload/style/index.js +7 -0
  281. package/lib/vtx-upload/style/index.js.map +1 -1
  282. package/lib/vtx-upload/style/index.less +61 -61
  283. package/lib/vtx-wang-editor/index.js +116 -74
  284. package/lib/vtx-wang-editor/index.js.map +1 -1
  285. package/lib/vtx-wang-editor/style/css.js +1 -0
  286. package/lib/vtx-wang-editor/style/css.js.map +1 -1
  287. package/lib/vtx-wang-editor/style/index.js +1 -0
  288. package/lib/vtx-wang-editor/style/index.js.map +1 -1
  289. package/lib/vtx-wang-editor/style/index.less +12 -12
  290. package/lib/vtx-wang-editor/wangEditorUtil.js +136 -75
  291. package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
  292. package/lib/vtx-ztree/index.js +119 -69
  293. package/lib/vtx-ztree/index.js.map +1 -1
  294. package/lib/vtx-ztree/style/css.js +1 -0
  295. package/lib/vtx-ztree/style/css.js.map +1 -1
  296. package/lib/vtx-ztree/style/index.js +1 -0
  297. package/lib/vtx-ztree/style/index.js.map +1 -1
  298. package/lib/vtx-ztree/style/index.less +45 -45
  299. package/lib/vtx-ztree-select/index.js +142 -73
  300. package/lib/vtx-ztree-select/index.js.map +1 -1
  301. package/lib/vtx-ztree-select/style/css.js +3 -0
  302. package/lib/vtx-ztree-select/style/css.js.map +1 -1
  303. package/lib/vtx-ztree-select/style/index.js +3 -0
  304. package/lib/vtx-ztree-select/style/index.js.map +1 -1
  305. package/lib/vtx-ztree-select/style/index.less +107 -107
  306. package/package.json +127 -126
@@ -1,8 +1,8 @@
1
- @import (reference) '~antd/lib/style/themes/index.less';
2
-
3
- .vtx-editor {
4
- border: @border-width-base @border-style-base @border-color-base;
5
- .bf-content {
6
- height: 300px;
7
- }
8
- }
1
+ @import (reference) '~antd/lib/style/themes/index.less';
2
+
3
+ .vtx-editor {
4
+ border: @border-width-base @border-style-base @border-color-base;
5
+ .bf-content {
6
+ height: 300px;
7
+ }
8
+ }
@@ -4,39 +4,51 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _classnames2 = _interopRequireDefault(require("classnames"));
11
+
9
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
10
14
  var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
15
+
11
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
- 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); }
17
+
13
18
  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); }
14
- 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; }
15
- 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; }
16
- 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; }
17
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
18
- 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); }
19
+
20
+ 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; }
21
+
22
+ 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; }
23
+
24
+ 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; }
25
+
19
26
  function VtxEllipsisText(props) {
27
+ var _classnames;
28
+
20
29
  var text = props.text,
21
- _props$lineClamp = props.lineClamp,
22
- lineClamp = _props$lineClamp === void 0 ? 1 : _props$lineClamp,
23
- _props$tooltip = props.tooltip,
24
- tooltip = _props$tooltip === void 0 ? {} : _props$tooltip,
25
- className = props.className,
26
- style = props.style;
30
+ _props$lineClamp = props.lineClamp,
31
+ lineClamp = _props$lineClamp === void 0 ? 1 : _props$lineClamp,
32
+ _props$tooltip = props.tooltip,
33
+ tooltip = _props$tooltip === void 0 ? {} : _props$tooltip,
34
+ className = props.className,
35
+ style = props.style;
27
36
  var textStyle = {};
37
+
28
38
  if (lineClamp > 2) {
29
39
  textStyle['WebkitLineClamp'] = lineClamp;
30
40
  }
41
+
31
42
  return /*#__PURE__*/_react["default"].createElement(_tooltip["default"], _extends({
32
43
  title: text,
33
44
  placement: "topLeft",
34
45
  mouseEnterDelay: 0.3
35
46
  }, tooltip), /*#__PURE__*/_react["default"].createElement("p", {
36
- className: (0, _classnames2["default"])('vtx-ellipsis-text', _defineProperty(_defineProperty({}, 'vtx-ellipsis-text--single', lineClamp < 2), 'vtx-ellipsis-text--multi', lineClamp >= 2), className),
47
+ className: (0, _classnames2["default"])('vtx-ellipsis-text', (_classnames = {}, _defineProperty(_classnames, 'vtx-ellipsis-text--single', lineClamp < 2), _defineProperty(_classnames, 'vtx-ellipsis-text--multi', lineClamp >= 2), _classnames), className),
37
48
  style: _objectSpread(_objectSpread({}, style), textStyle)
38
49
  }, text));
39
50
  }
51
+
40
52
  VtxEllipsisText.propTypes = {
41
53
  text: _propTypes["default"].string,
42
54
  lineClamp: _propTypes["default"].number,
@@ -44,5 +56,6 @@ VtxEllipsisText.propTypes = {
44
56
  className: _propTypes["default"].string,
45
57
  style: _propTypes["default"].object
46
58
  };
47
- var _default = exports["default"] = VtxEllipsisText;
59
+ var _default = VtxEllipsisText;
60
+ exports["default"] = _default;
48
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_classnames2","_propTypes","_tooltip","obj","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","_extends","Object","assign","bind","target","i","arguments","length","source","key","hasOwnProperty","call","apply","ownKeys","e","r","t","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","value","_toPropertyKey","configurable","writable","_toPrimitive","String","toPrimitive","TypeError","Number","VtxEllipsisText","props","text","_props$lineClamp","lineClamp","_props$tooltip","tooltip","className","style","textStyle","createElement","title","placement","mouseEnterDelay","classnames","propTypes","PropTypes","string","number","object","_default","exports"],"sources":["vtx-ellipsis-text/index.jsx"],"sourcesContent":["import React from 'react';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport Tooltip from 'antd/lib/tooltip';\r\n\r\nfunction VtxEllipsisText(props) {\r\n const { text, lineClamp = 1, tooltip = {}, className, style } = props;\r\n\r\n const textStyle = {};\r\n if (lineClamp > 2) {\r\n textStyle['WebkitLineClamp'] = lineClamp;\r\n }\r\n\r\n return (\r\n <Tooltip title={text} placement=\"topLeft\" mouseEnterDelay={0.3} {...tooltip}>\r\n <p\r\n className={classnames(\r\n 'vtx-ellipsis-text',\r\n {\r\n ['vtx-ellipsis-text--single']: lineClamp < 2,\r\n ['vtx-ellipsis-text--multi']: lineClamp >= 2,\r\n },\r\n className,\r\n )}\r\n style={{ ...style, ...textStyle }}\r\n >\r\n {text}\r\n </p>\r\n </Tooltip>\r\n );\r\n}\r\n\r\nVtxEllipsisText.propTypes = {\r\n text: PropTypes.string,\r\n lineClamp: PropTypes.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GAC3C,0BAA0B,EAAGA,SAAS,IAAI,CAAC,GAEhDG,SACJ,CAAE;IACFC,KAAK,EAAAvB,aAAA,CAAAA,aAAA,KAAOuB,KAAK,GAAKC,SAAS;EAAG,GAEjCP,IACF,CACE,CAAC;AAElB;AAEAF,eAAe,CAACe,SAAS,GAAG;EACxBb,IAAI,EAAEc,qBAAS,CAACC,MAAM;EACtBb,SAAS,EAAEY,qBAAS,CAACE,MAAM;EAC3BZ,OAAO,EAAEU,qBAAS,CAACG,MAAM;EACzBZ,SAAS,EAAES,qBAAS,CAACC,MAAM;EAC3BT,KAAK,EAAEQ,qBAAS,CAACG;AACrB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEarB,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["VtxEllipsisText","props","text","lineClamp","tooltip","className","style","textStyle","classnames","propTypes","PropTypes","string","number","object"],"sources":["vtx-ellipsis-text/index.jsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport Tooltip from 'antd/lib/tooltip';\n\nfunction VtxEllipsisText(props) {\n const { text, lineClamp = 1, tooltip = {}, className, style } = props;\n\n const textStyle = {};\n if (lineClamp > 2) {\n textStyle['WebkitLineClamp'] = lineClamp;\n }\n\n return (\n <Tooltip title={text} placement=\"topLeft\" mouseEnterDelay={0.3} {...tooltip}>\n <p\n className={classnames(\n 'vtx-ellipsis-text',\n {\n ['vtx-ellipsis-text--single']: lineClamp < 2,\n ['vtx-ellipsis-text--multi']: lineClamp >= 2,\n },\n className,\n )}\n style={{ ...style, ...textStyle }}\n >\n {text}\n </p>\n </Tooltip>\n );\n}\n\nVtxEllipsisText.propTypes = {\n text: PropTypes.string,\n lineClamp: PropTypes.number,\n tooltip: PropTypes.object,\n className: PropTypes.string,\n style: PropTypes.object,\n};\n\nexport default VtxEllipsisText;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,SAASA,eAAT,CAAyBC,KAAzB,EAAgC;EAAA;;EAC5B,IAAQC,IAAR,GAAgED,KAAhE,CAAQC,IAAR;EAAA,uBAAgED,KAAhE,CAAcE,SAAd;EAAA,IAAcA,SAAd,iCAA0B,CAA1B;EAAA,qBAAgEF,KAAhE,CAA6BG,OAA7B;EAAA,IAA6BA,OAA7B,+BAAuC,EAAvC;EAAA,IAA2CC,SAA3C,GAAgEJ,KAAhE,CAA2CI,SAA3C;EAAA,IAAsDC,KAAtD,GAAgEL,KAAhE,CAAsDK,KAAtD;EAEA,IAAMC,SAAS,GAAG,EAAlB;;EACA,IAAIJ,SAAS,GAAG,CAAhB,EAAmB;IACfI,SAAS,CAAC,iBAAD,CAAT,GAA+BJ,SAA/B;EACH;;EAED,oBACI,gCAAC,mBAAD;IAAS,KAAK,EAAED,IAAhB;IAAsB,SAAS,EAAC,SAAhC;IAA0C,eAAe,EAAE;EAA3D,GAAoEE,OAApE,gBACI;IACI,SAAS,EAAE,IAAAI,uBAAA,EACP,mBADO,kDAGF,2BAHE,EAG4BL,SAAS,GAAG,CAHxC,gCAIF,0BAJE,EAI2BA,SAAS,IAAI,CAJxC,iBAMPE,SANO,CADf;IASI,KAAK,kCAAOC,KAAP,GAAiBC,SAAjB;EATT,GAWKL,IAXL,CADJ,CADJ;AAiBH;;AAEDF,eAAe,CAACS,SAAhB,GAA4B;EACxBP,IAAI,EAAEQ,qBAAA,CAAUC,MADQ;EAExBR,SAAS,EAAEO,qBAAA,CAAUE,MAFG;EAGxBR,OAAO,EAAEM,qBAAA,CAAUG,MAHK;EAIxBR,SAAS,EAAEK,qBAAA,CAAUC,MAJG;EAKxBL,KAAK,EAAEI,qBAAA,CAAUG;AALO,CAA5B;eAQeb,e"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  require("antd/lib/tooltip/style/css");
4
+
4
5
  require("./index.css");
5
6
  //# sourceMappingURL=css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"css.js","names":["require"],"sources":["vtx-ellipsis-text/style/index.js"],"sourcesContent":["import 'antd/lib/tooltip/style';\r\nimport './index.less';\r\n"],"mappings":";;AAAAA,OAAA;AACAA,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"css.js","names":[],"sources":["vtx-ellipsis-text/style/index.js"],"sourcesContent":["import 'antd/lib/tooltip/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  require("antd/lib/tooltip/style");
4
+
4
5
  require("./index.less");
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["require"],"sources":["vtx-ellipsis-text/style/index.js"],"sourcesContent":["import 'antd/lib/tooltip/style';\r\nimport './index.less';\r\n"],"mappings":";;AAAAA,OAAA;AACAA,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["vtx-ellipsis-text/style/index.js"],"sourcesContent":["import 'antd/lib/tooltip/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA"}
@@ -1,13 +1,13 @@
1
- .vtx-ellipsis-text {
2
- margin: 0;
3
- overflow: hidden;
4
- text-overflow: ellipsis;
5
- &--single {
6
- white-space: nowrap;
7
- }
8
- &--multi {
9
- display: -webkit-box;
10
- -webkit-line-clamp: 2;
11
- -webkit-box-orient: vertical;
12
- }
13
- }
1
+ .vtx-ellipsis-text {
2
+ margin: 0;
3
+ overflow: hidden;
4
+ text-overflow: ellipsis;
5
+ &--single {
6
+ white-space: nowrap;
7
+ }
8
+ &--multi {
9
+ display: -webkit-box;
10
+ -webkit-line-clamp: 2;
11
+ -webkit-box-orient: vertical;
12
+ }
13
+ }
@@ -4,59 +4,79 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _reactDom = _interopRequireDefault(require("react-dom"));
11
+
9
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
10
14
  var _axios = _interopRequireDefault(require("axios"));
15
+
11
16
  var _querystring = _interopRequireDefault(require("querystring"));
17
+
12
18
  var _button = _interopRequireDefault(require("antd/lib/button"));
19
+
13
20
  var _menu = _interopRequireDefault(require("antd/lib/menu"));
21
+
14
22
  var _dropdown = _interopRequireDefault(require("antd/lib/dropdown"));
23
+
15
24
  var _message = _interopRequireDefault(require("antd/lib/message"));
25
+
16
26
  var _spin = _interopRequireDefault(require("antd/lib/spin"));
27
+
17
28
  var _getToken = _interopRequireDefault(require("../_util/getToken"));
29
+
18
30
  var _DownOutlined = _interopRequireDefault(require("@ant-design/icons/DownOutlined"));
31
+
19
32
  var _ExportOutlined = _interopRequireDefault(require("@ant-design/icons/ExportOutlined"));
33
+
20
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
- var token = (0, _getToken["default"])();
22
- // 默认60秒超时
35
+
36
+ var token = (0, _getToken["default"])(); // 默认60秒超时
37
+
23
38
  var SECOND = 60;
24
39
  var MILL_SECOND = 1000;
40
+
25
41
  var VtxExport = function VtxExport(props) {
26
42
  var _props$exportText = props.exportText,
27
- exportText = _props$exportText === void 0 ? '导出' : _props$exportText,
28
- _props$rowButton = props.rowButton,
29
- rowButton = _props$rowButton === void 0 ? true : _props$rowButton,
30
- _props$pageButton = props.pageButton,
31
- pageButton = _props$pageButton === void 0 ? true : _props$pageButton,
32
- _props$allButton = props.allButton,
33
- allButton = _props$allButton === void 0 ? true : _props$allButton,
34
- downloadURL = props.downloadURL,
35
- _props$timeout = props.timeout,
36
- timeout = _props$timeout === void 0 ? SECOND : _props$timeout,
37
- _props$customEnumText = props.customEnumText,
38
- customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText;
43
+ exportText = _props$exportText === void 0 ? '导出' : _props$exportText,
44
+ _props$rowButton = props.rowButton,
45
+ rowButton = _props$rowButton === void 0 ? true : _props$rowButton,
46
+ _props$pageButton = props.pageButton,
47
+ pageButton = _props$pageButton === void 0 ? true : _props$pageButton,
48
+ _props$allButton = props.allButton,
49
+ allButton = _props$allButton === void 0 ? true : _props$allButton,
50
+ downloadURL = props.downloadURL,
51
+ _props$timeout = props.timeout,
52
+ timeout = _props$timeout === void 0 ? SECOND : _props$timeout,
53
+ _props$customEnumText = props.customEnumText,
54
+ customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText;
39
55
  var getExportParams = props.getExportParams,
40
- afterExport = props.afterExport;
41
-
56
+ afterExport = props.afterExport;
42
57
  /* 菜单点击 */
58
+
43
59
  function exportButtonClick(param) {
44
60
  var passVal = typeof getExportParams == 'function' ? getExportParams(param.key) : null;
61
+
45
62
  if (!downloadURL) {
46
63
  return;
47
64
  }
65
+
48
66
  if (!passVal) {
49
67
  return;
50
68
  }
69
+
51
70
  downLoadFile(passVal);
52
- }
71
+ } // eslint-disable-next-line valid-jsdoc
53
72
 
54
- // eslint-disable-next-line valid-jsdoc
55
73
  /**
56
74
  * 发送http请求
57
75
  * @param {Object} postData api参数
58
76
  * @return reponse
59
77
  */
78
+
79
+
60
80
  function requestToResponse(postData) {
61
81
  var params = {
62
82
  url: downloadURL,
@@ -77,57 +97,66 @@ var VtxExport = function VtxExport(props) {
77
97
  });
78
98
  });
79
99
  }
80
-
81
100
  /* 下载文件 */
101
+
102
+
82
103
  function downLoadFile(postData) {
83
104
  var div = document.createElement('div');
105
+
84
106
  _reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(_spin["default"], {
85
107
  spinning: true,
86
108
  className: "vtx-spin"
87
109
  }), div);
110
+
88
111
  document.body.appendChild(div);
89
112
  requestToResponse(postData).then(function (res) {
90
- var status = false;
91
- // 文件存在
113
+ var status = false; // 文件存在
114
+
92
115
  if (res.headers['content-disposition']) {
93
116
  var contentDisposition = res.headers['content-disposition'];
94
117
  var filename;
118
+
95
119
  if (contentDisposition.indexOf('filename*=') > -1) {
96
120
  filename = decodeURI(contentDisposition.split('filename*=')[1].replace("utf-8'zh_cn'", ''));
97
121
  } else {
98
122
  filename = decodeURI(contentDisposition.split('filename=')[1]);
99
123
  }
124
+
100
125
  if ('download' in document.createElement('a')) {
101
126
  download(res.data, filename);
102
127
  status = true;
103
128
  } else {
104
129
  _message["default"].warn('浏览器不支持');
105
130
  }
106
- }
107
- // 关闭loading,执行回调
131
+ } // 关闭loading,执行回调
132
+
133
+
108
134
  document.body.removeChild(div);
135
+
109
136
  if (afterExport && typeof afterExport === 'function') {
110
137
  afterExport(status);
111
138
  }
112
139
  });
113
140
  }
114
-
115
141
  /* 下载并 兼容IE */
142
+
143
+
116
144
  function download(content, filename) {
117
- var blob = new Blob([content]);
118
- // IE
145
+ var blob = new Blob([content]); // IE
146
+
119
147
  if (window.navigator && window.navigator.msSaveOrOpenBlob) {
120
148
  window.navigator.msSaveOrOpenBlob(blob, filename);
121
149
  } else {
122
150
  downloadByATag(window.URL.createObjectURL(blob), filename);
123
151
  }
124
152
  }
125
-
126
153
  /**
127
154
  * 通过a标签模拟下载
128
155
  * @param {String} href
129
156
  * @param {String} filename
130
157
  */
158
+
159
+
131
160
  function downloadByATag(href, filename) {
132
161
  var a = document.createElement('a');
133
162
  a.download = filename;
@@ -138,6 +167,7 @@ var VtxExport = function VtxExport(props) {
138
167
  a.remove();
139
168
  window.URL.revokeObjectURL(href);
140
169
  }
170
+
141
171
  var exportMenu = /*#__PURE__*/_react["default"].createElement(_menu["default"], {
142
172
  onClick: exportButtonClick
143
173
  }, rowButton === false ? null : /*#__PURE__*/_react["default"].createElement(_menu["default"].Item, {
@@ -147,6 +177,7 @@ var VtxExport = function VtxExport(props) {
147
177
  }, (customEnumText === null || customEnumText === void 0 ? void 0 : customEnumText.selectPageText) || '导出当前页'), allButton === false ? null : /*#__PURE__*/_react["default"].createElement(_menu["default"].Item, {
148
178
  key: "all"
149
179
  }, (customEnumText === null || customEnumText === void 0 ? void 0 : customEnumText.selectAllText) || '导出全部'));
180
+
150
181
  return /*#__PURE__*/_react["default"].createElement(_dropdown["default"], {
151
182
  overlay: exportMenu,
152
183
  trigger: ['click']
@@ -154,6 +185,7 @@ var VtxExport = function VtxExport(props) {
154
185
  icon: /*#__PURE__*/_react["default"].createElement(_ExportOutlined["default"], null)
155
186
  }, exportText, " ", /*#__PURE__*/_react["default"].createElement(_DownOutlined["default"], null)));
156
187
  };
188
+
157
189
  VtxExport.propTypes = {
158
190
  exportText: _propTypes["default"].string,
159
191
  rowButton: _propTypes["default"].bool,
@@ -165,5 +197,6 @@ VtxExport.propTypes = {
165
197
  timeout: _propTypes["default"].number,
166
198
  customEnumText: _propTypes["default"].object
167
199
  };
168
- var _default = exports["default"] = VtxExport;
200
+ var _default = VtxExport;
201
+ exports["default"] = _default;
169
202
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_reactDom","_propTypes","_axios","_querystring","_button","_menu","_dropdown","_message","_spin","_getToken","_DownOutlined","_ExportOutlined","obj","__esModule","token","getToken","SECOND","MILL_SECOND","VtxExport","props","_props$exportText","exportText","_props$rowButton","rowButton","_props$pageButton","pageButton","_props$allButton","allButton","downloadURL","_props$timeout","timeout","_props$customEnumText","customEnumText","getExportParams","afterExport","exportButtonClick","param","passVal","key","downLoadFile","requestToResponse","postData","params","url","method","responseType","headers","Authorization","concat","data","qs","stringify","Promise","resolve","reject","axios","then","res","err","div","document","createElement","ReactDOM","render","spinning","className","body","appendChild","status","contentDisposition","filename","indexOf","decodeURI","split","replace","download","message","warn","removeChild","content","blob","Blob","window","navigator","msSaveOrOpenBlob","downloadByATag","URL","createObjectURL","href","a","style","display","click","remove","revokeObjectURL","exportMenu","onClick","Item","selectRowText","selectPageText","selectAllText","overlay","trigger","icon","propTypes","PropTypes","string","bool","func","number","object","_default","exports"],"sources":["vtx-export/index.jsx"],"sourcesContent":["import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport PropTypes from 'prop-types';\r\nimport axios from 'axios';\r\nimport qs from 'querystring';\r\nimport Button from 'antd/lib/button';\r\nimport Menu from 'antd/lib/menu';\r\nimport Dropdown from 'antd/lib/dropdown';\r\nimport message from 'antd/lib/message';\r\nimport Spin from 'antd/lib/spin';\r\nimport getToken from '../_util/getToken';\r\nimport DownOutlined from '@ant-design/icons/DownOutlined';\r\nimport ExportOutlined from '@ant-design/icons/ExportOutlined';\r\n\r\nconst token = getToken();\r\n// 默认60秒超时\r\nconst SECOND = 60;\r\nconst MILL_SECOND = 1000;\r\n\r\nconst VtxExport = props => {\r\n const {\r\n exportText = '导出',\r\n rowButton = true,\r\n pageButton = true,\r\n allButton = true,\r\n downloadURL,\r\n timeout = SECOND,\r\n customEnumText = {},\r\n } = props;\r\n\r\n const { getExportParams, afterExport } = props;\r\n\r\n /* 菜单点击 */\r\n function exportButtonClick(param) {\r\n const passVal = typeof getExportParams == 'function' ? getExportParams(param.key) : null;\r\n if (!downloadURL) {\r\n return;\r\n }\r\n if (!passVal) {\r\n return;\r\n }\r\n downLoadFile(passVal);\r\n }\r\n\r\n // eslint-disable-next-line valid-jsdoc\r\n /**\r\n * 发送http请求\r\n * @param {Object} postData api参数\r\n * @return reponse\r\n */\r\n function requestToResponse(postData) {\r\n const params = {\r\n url: downloadURL,\r\n method: 'post',\r\n timeout: timeout * MILL_SECOND,\r\n responseType: 'blob',\r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n Authorization: token ? `Bearer ${token}` : '',\r\n },\r\n data: qs.stringify(postData),\r\n };\r\n return new Promise((resolve, reject) => {\r\n axios(params)\r\n .then(res => {\r\n resolve(res);\r\n })\r\n .catch(err => {\r\n reject(err);\r\n });\r\n });\r\n }\r\n\r\n /* 下载文件 */\r\n function downLoadFile(postData) {\r\n const div = document.createElement('div');\r\n ReactDOM.render(<Spin spinning className=\"vtx-spin\" />, div);\r\n document.body.appendChild(div);\r\n\r\n requestToResponse(postData).then(res => {\r\n let status = false;\r\n // 文件存在\r\n if (res.headers['content-disposition']) {\r\n const contentDisposition = res.headers['content-disposition'];\r\n let filename;\r\n if (contentDisposition.indexOf('filename*=') > -1) {\r\n filename = decodeURI(\r\n contentDisposition.split('filename*=')[1].replace(\"utf-8'zh_cn'\", ''),\r\n );\r\n } else {\r\n filename = decodeURI(contentDisposition.split('filename=')[1]);\r\n }\r\n if ('download' in document.createElement('a')) {\r\n download(res.data, filename);\r\n status = true;\r\n } else {\r\n message.warn('浏览器不支持');\r\n }\r\n }\r\n // 关闭loading,执行回调\r\n document.body.removeChild(div);\r\n if (afterExport && typeof afterExport === 'function') {\r\n afterExport(status);\r\n }\r\n });\r\n }\r\n\r\n /* 下载并 兼容IE */\r\n function download(content, filename) {\r\n const blob = new Blob([content]);\r\n // IE\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n window.navigator.msSaveOrOpenBlob(blob, filename);\r\n } else {\r\n downloadByATag(window.URL.createObjectURL(blob), filename);\r\n }\r\n }\r\n\r\n /**\r\n * 通过a标签模拟下载\r\n * @param {String} href\r\n * @param {String} filename\r\n */\r\n function downloadByATag(href, filename) {\r\n const a = document.createElement('a');\r\n a.download = filename;\r\n a.style.display = 'none';\r\n a.href = href;\r\n document.body.appendChild(a);\r\n a.click();\r\n a.remove();\r\n window.URL.revokeObjectURL(href);\r\n }\r\n\r\n const exportMenu = (\r\n <Menu onClick={exportButtonClick}>\r\n {rowButton === false ? null : (\r\n <Menu.Item key=\"rows\">{customEnumText?.selectRowText || '导出选中行'}</Menu.Item>\r\n )}\r\n {pageButton === false ? null : (\r\n <Menu.Item key=\"page\">{customEnumText?.selectPageText || '导出当前页'}</Menu.Item>\r\n )}\r\n {allButton === false ? null : (\r\n <Menu.Item key=\"all\">{customEnumText?.selectAllText || '导出全部'}</Menu.Item>\r\n )}\r\n </Menu>\r\n );\r\n return (\r\n <Dropdown overlay={exportMenu} trigger={['click']}>\r\n <Button icon={<ExportOutlined />}>\r\n {exportText} <DownOutlined />\r\n </Button>\r\n </Dropdown>\r\n );\r\n};\r\n\r\nVtxExport.propTypes = {\r\n exportText: PropTypes.string,\r\n rowButton: PropTypes.bool,\r\n pageButton: PropTypes.bool,\r\n allButton: PropTypes.bool,\r\n downloadURL: PropTypes.string,\r\n getExportParams: PropTypes.func,\r\n afterExport: PropTypes.func,\r\n timeout: PropTypes.number,\r\n customEnumText: PropTypes.object,\r\n};\r\nexport default VtxExport;\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,SAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,QAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,KAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,SAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,aAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,eAAA,GAAAb,sBAAA,CAAAC,OAAA;AAA8D,SAAAD,uBAAAc,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAE9D,IAAME,KAAK,GAAG,IAAAC,oBAAQ,EAAC,CAAC;AACxB;AACA,IAAMC,MAAM,GAAG,EAAE;AACjB,IAAMC,WAAW,GAAG,IAAI;AAExB,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAGC,KAAK,EAAI;EACvB,IAAAC,iBAAA,GAQID,KAAK,CAPLE,UAAU;IAAVA,UAAU,GAAAD,iBAAA,cAAG,IAAI,GAAAA,iBAAA;IAAAE,gBAAA,GAOjBH,KAAK,CANLI,SAAS;IAAT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,UAAU,EAAEgF,qBAAS,CAACE,IAAI;EAC1BhF,SAAS,EAAE8E,qBAAS,CAACE,IAAI;EACzB/E,WAAW,EAAE6E,qBAAS,CAACC,MAAM;EAC7BzE,eAAe,EAAEwE,qBAAS,CAACG,IAAI;EAC/B1E,WAAW,EAAEuE,qBAAS,CAACG,IAAI;EAC3B9E,OAAO,EAAE2E,qBAAS,CAACI,MAAM;EACzB7E,cAAc,EAAEyE,qBAAS,CAACK;AAC9B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cACa9F,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["token","getToken","SECOND","MILL_SECOND","VtxExport","props","exportText","rowButton","pageButton","allButton","downloadURL","timeout","customEnumText","getExportParams","afterExport","exportButtonClick","param","passVal","key","downLoadFile","requestToResponse","postData","params","url","method","responseType","headers","Authorization","data","qs","stringify","Promise","resolve","reject","axios","then","res","err","div","document","createElement","ReactDOM","render","body","appendChild","status","contentDisposition","filename","indexOf","decodeURI","split","replace","download","message","warn","removeChild","content","blob","Blob","window","navigator","msSaveOrOpenBlob","downloadByATag","URL","createObjectURL","href","a","style","display","click","remove","revokeObjectURL","exportMenu","selectRowText","selectPageText","selectAllText","propTypes","PropTypes","string","bool","func","number","object"],"sources":["vtx-export/index.jsx"],"sourcesContent":["import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport PropTypes from 'prop-types';\r\nimport axios from 'axios';\r\nimport qs from 'querystring';\r\nimport Button from 'antd/lib/button';\r\nimport Menu from 'antd/lib/menu';\r\nimport Dropdown from 'antd/lib/dropdown';\r\nimport message from 'antd/lib/message';\r\nimport Spin from 'antd/lib/spin';\r\nimport getToken from '../_util/getToken';\r\nimport DownOutlined from '@ant-design/icons/DownOutlined';\r\nimport ExportOutlined from '@ant-design/icons/ExportOutlined';\r\n\r\nconst token = getToken();\r\n// 默认60秒超时\r\nconst SECOND = 60;\r\nconst MILL_SECOND = 1000;\r\n\r\nconst VtxExport = props => {\r\n const {\r\n exportText = '导出',\r\n rowButton = true,\r\n pageButton = true,\r\n allButton = true,\r\n downloadURL,\r\n timeout = SECOND,\r\n customEnumText = {},\r\n } = props;\r\n\r\n const { getExportParams, afterExport } = props;\r\n\r\n /* 菜单点击 */\r\n function exportButtonClick(param) {\r\n const passVal = typeof getExportParams == 'function' ? getExportParams(param.key) : null;\r\n if (!downloadURL) {\r\n return;\r\n }\r\n if (!passVal) {\r\n return;\r\n }\r\n downLoadFile(passVal);\r\n }\r\n\r\n // eslint-disable-next-line valid-jsdoc\r\n /**\r\n * 发送http请求\r\n * @param {Object} postData api参数\r\n * @return reponse\r\n */\r\n function requestToResponse(postData) {\r\n const params = {\r\n url: downloadURL,\r\n method: 'post',\r\n timeout: timeout * MILL_SECOND,\r\n responseType: 'blob',\r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n Authorization: token ? `Bearer ${token}` : '',\r\n },\r\n data: qs.stringify(postData),\r\n };\r\n return new Promise((resolve, reject) => {\r\n axios(params)\r\n .then(res => {\r\n resolve(res);\r\n })\r\n .catch(err => {\r\n reject(err);\r\n });\r\n });\r\n }\r\n\r\n /* 下载文件 */\r\n function downLoadFile(postData) {\r\n const div = document.createElement('div');\r\n ReactDOM.render(<Spin spinning className=\"vtx-spin\" />, div);\r\n document.body.appendChild(div);\r\n\r\n requestToResponse(postData).then(res => {\r\n let status = false;\r\n // 文件存在\r\n if (res.headers['content-disposition']) {\r\n const contentDisposition = res.headers['content-disposition'];\r\n let filename;\r\n if (contentDisposition.indexOf('filename*=') > -1) {\r\n filename = decodeURI(\r\n contentDisposition.split('filename*=')[1].replace(\"utf-8'zh_cn'\", ''),\r\n );\r\n } else {\r\n filename = decodeURI(contentDisposition.split('filename=')[1]);\r\n }\r\n if ('download' in document.createElement('a')) {\r\n download(res.data, filename);\r\n status = true;\r\n } else {\r\n message.warn('浏览器不支持');\r\n }\r\n }\r\n // 关闭loading,执行回调\r\n document.body.removeChild(div);\r\n if (afterExport && typeof afterExport === 'function') {\r\n afterExport(status);\r\n }\r\n });\r\n }\r\n\r\n /* 下载并 兼容IE */\r\n function download(content, filename) {\r\n const blob = new Blob([content]);\r\n // IE\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n window.navigator.msSaveOrOpenBlob(blob, filename);\r\n } else {\r\n downloadByATag(window.URL.createObjectURL(blob), filename);\r\n }\r\n }\r\n\r\n /**\r\n * 通过a标签模拟下载\r\n * @param {String} href\r\n * @param {String} filename\r\n */\r\n function downloadByATag(href, filename) {\r\n const a = document.createElement('a');\r\n a.download = filename;\r\n a.style.display = 'none';\r\n a.href = href;\r\n document.body.appendChild(a);\r\n a.click();\r\n a.remove();\r\n window.URL.revokeObjectURL(href);\r\n }\r\n\r\n const exportMenu = (\r\n <Menu onClick={exportButtonClick}>\r\n {rowButton === false ? null : (\r\n <Menu.Item key=\"rows\">{customEnumText?.selectRowText || '导出选中行'}</Menu.Item>\r\n )}\r\n {pageButton === false ? null : (\r\n <Menu.Item key=\"page\">{customEnumText?.selectPageText || '导出当前页'}</Menu.Item>\r\n )}\r\n {allButton === false ? null : (\r\n <Menu.Item key=\"all\">{customEnumText?.selectAllText || '导出全部'}</Menu.Item>\r\n )}\r\n </Menu>\r\n );\r\n return (\r\n <Dropdown overlay={exportMenu} trigger={['click']}>\r\n <Button icon={<ExportOutlined />}>\r\n {exportText} <DownOutlined />\r\n </Button>\r\n </Dropdown>\r\n );\r\n};\r\n\r\nVtxExport.propTypes = {\r\n exportText: PropTypes.string,\r\n rowButton: PropTypes.bool,\r\n pageButton: PropTypes.bool,\r\n allButton: PropTypes.bool,\r\n downloadURL: PropTypes.string,\r\n getExportParams: PropTypes.func,\r\n afterExport: PropTypes.func,\r\n timeout: PropTypes.number,\r\n customEnumText: PropTypes.object,\r\n};\r\nexport default VtxExport;\r\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,I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BrE,WAAW,EAAEmE,qBAAA,CAAUC,MALL;EAMlBjE,eAAe,EAAEgE,qBAAA,CAAUG,IANT;EAOlBlE,WAAW,EAAE+D,qBAAA,CAAUG,IAPL;EAQlBrE,OAAO,EAAEkE,qBAAA,CAAUI,MARD;EASlBrE,cAAc,EAAEiE,qBAAA,CAAUK;AATR,CAAtB;eAWe9E,S"}
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  require("antd/lib/button/style/css");
4
+
4
5
  require("antd/lib/menu/style/css");
6
+
5
7
  require("antd/lib/dropdown/style/css");
8
+
6
9
  require("antd/lib/message/style/css");
10
+
7
11
  require("antd/lib/spin/style/css");
12
+
8
13
  require("./index.css");
9
14
  //# sourceMappingURL=css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"css.js","names":["require"],"sources":["vtx-export/style/index.js"],"sourcesContent":["import 'antd/lib/button/style';\r\nimport 'antd/lib/menu/style';\r\nimport 'antd/lib/dropdown/style';\r\nimport 'antd/lib/message/style';\r\nimport 'antd/lib/spin/style';\r\nimport './index.less';\r\n"],"mappings":";;AAAAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"css.js","names":[],"sources":["vtx-export/style/index.js"],"sourcesContent":["import 'antd/lib/button/style';\nimport 'antd/lib/menu/style';\nimport 'antd/lib/dropdown/style';\nimport 'antd/lib/message/style';\nimport 'antd/lib/spin/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA"}
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  require("antd/lib/button/style");
4
+
4
5
  require("antd/lib/menu/style");
6
+
5
7
  require("antd/lib/dropdown/style");
8
+
6
9
  require("antd/lib/message/style");
10
+
7
11
  require("antd/lib/spin/style");
12
+
8
13
  require("./index.less");
9
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["require"],"sources":["vtx-export/style/index.js"],"sourcesContent":["import 'antd/lib/button/style';\r\nimport 'antd/lib/menu/style';\r\nimport 'antd/lib/dropdown/style';\r\nimport 'antd/lib/message/style';\r\nimport 'antd/lib/spin/style';\r\nimport './index.less';\r\n"],"mappings":";;AAAAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["vtx-export/style/index.js"],"sourcesContent":["import 'antd/lib/button/style';\nimport 'antd/lib/menu/style';\nimport 'antd/lib/dropdown/style';\nimport 'antd/lib/message/style';\nimport 'antd/lib/spin/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA"}