cloud-b2b 1.1.58 → 1.1.59

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 (308) hide show
  1. package/package.json +44 -22
  2. package/src/Area/Area.js +94 -0
  3. package/src/Card/Card.js +16 -0
  4. package/src/CodeInput/CodeInput.js +76 -0
  5. package/src/Control/Control.js +338 -0
  6. package/src/Control/event.js +45 -0
  7. package/src/Enhance/Dialogs.js +24 -0
  8. package/src/Enhance/Loading.js +83 -0
  9. package/{es → src}/Enhance/index.js +8 -6
  10. package/src/Header/Header.js +149 -0
  11. package/src/Header/Vertical.js +74 -0
  12. package/src/ImageView/ImageView.js +62 -0
  13. package/src/Indent/Indent.js +12 -0
  14. package/src/InpurCascader/InputCascader.js +83 -0
  15. package/src/InputEditor/InputEditor.js +93 -0
  16. package/src/InputSearch/InputSearch.js +186 -0
  17. package/src/InputSelect/InputSelect.js +103 -0
  18. package/src/InputTreeSelect/InputTreeSelect.js +87 -0
  19. package/src/InputWriting/InputWriting.js +65 -0
  20. package/src/Layout/Layout.js +121 -0
  21. package/src/LayoutLink/LayoutLink.js +59 -0
  22. package/src/Link/Link.js +57 -0
  23. package/src/Loading/Loading.js +15 -0
  24. package/src/Loading2/Loading2.js +15 -0
  25. package/src/ModalWithDrag/ModalWithDrag.js +17 -0
  26. package/{es → src}/ModalWithDrag/drag.js +128 -116
  27. package/src/NumberInput/NumberInput.js +137 -0
  28. package/src/Search/Search.js +368 -0
  29. package/src/Search2/Search.js +436 -0
  30. package/{lib/Search → src/Search2}/Search.less +65 -63
  31. package/{lib/Search → src/Search2}/package.json +6 -6
  32. package/src/Sidebar/Sidebar.js +111 -0
  33. package/src/Sidebar2/Sidebar.js +143 -0
  34. package/src/SuperForm/SuperForm.js +519 -0
  35. package/src/SuperForm2/SuperForm.js +588 -0
  36. package/src/SuperIcon/SuperIcon.js +14 -0
  37. package/src/SuperPagination/SuperPagination.js +65 -0
  38. package/src/SuperTab/SuperTab.js +84 -0
  39. package/src/SuperTab2/SuperTab2.js +94 -0
  40. package/src/SuperTable/DragSortRow.js +62 -0
  41. package/src/SuperTable/FilterDropDown.js +111 -0
  42. package/src/SuperTable/SuperTable.js +590 -0
  43. package/src/SuperTable/fixed.js +34 -0
  44. package/src/SuperTable2/SuperTable2.js +624 -0
  45. package/src/SuperTable2/SuperTableCell.js +175 -0
  46. package/src/SuperTable3/FilterDropDown.js +111 -0
  47. package/src/SuperTable3/SuperTable.js +498 -0
  48. package/src/SuperTable3/fixed.js +34 -0
  49. package/src/SuperToolbar/SuperToolbar.js +128 -0
  50. package/src/SuperUpload/SuperUpload.js +137 -0
  51. package/src/Title/Title.js +18 -0
  52. package/src/Viewer/ImageViews.js +220 -0
  53. package/src/Viewer/Viewer.js +97 -0
  54. package/src/WingBlank/WingBlank.js +14 -0
  55. package/src/helper.js +185 -0
  56. package/{es → src}/history.js +6 -6
  57. package/src/index.js +39 -0
  58. package/src/variables.js +5 -0
  59. package/test/index.html +10 -0
  60. package/test/test.js +16 -0
  61. package/test/test.less +12 -0
  62. package/test/webpack.config.js +71 -0
  63. package/tools/babel.config.js +14 -0
  64. package/tools/build.js +70 -0
  65. package/tools/publish.js +9 -0
  66. package/tools/util.js +53 -0
  67. package/es/Area/Area.js +0 -141
  68. package/es/Card/Card.js +0 -19
  69. package/es/CodeInput/CodeInput.js +0 -123
  70. package/es/Control/Control.js +0 -444
  71. package/es/Control/event.js +0 -43
  72. package/es/Enhance/Dialogs.js +0 -52
  73. package/es/Enhance/Loading.js +0 -131
  74. package/es/Header/Header.js +0 -162
  75. package/es/Header/Vertical.js +0 -106
  76. package/es/ImageView/ImageView.js +0 -100
  77. package/es/Indent/Indent.js +0 -19
  78. package/es/InpurCascader/InputCascader.js +0 -117
  79. package/es/InputEditor/InputEditor.js +0 -173
  80. package/es/InputSearch/InputSearch.js +0 -266
  81. package/es/InputSelect/InputSelect.js +0 -160
  82. package/es/InputTreeSelect/InputTreeSelect.js +0 -121
  83. package/es/InputWriting/InputWriting.js +0 -85
  84. package/es/Layout/Layout.js +0 -201
  85. package/es/LayoutLink/LayoutLink.js +0 -73
  86. package/es/Link/Link.js +0 -85
  87. package/es/Loading/Loading.js +0 -13
  88. package/es/Loading2/Loading2.js +0 -9
  89. package/es/ModalWithDrag/ModalWithDrag.js +0 -29
  90. package/es/NumberInput/NumberInput.js +0 -200
  91. package/es/Search/Search.js +0 -497
  92. package/es/Sidebar/Sidebar.js +0 -144
  93. package/es/Sidebar2/Sidebar.js +0 -165
  94. package/es/SuperForm/SuperForm.js +0 -598
  95. package/es/SuperForm2/SuperForm.js +0 -687
  96. package/es/SuperIcon/SuperIcon.js +0 -27
  97. package/es/SuperPagination/SuperPagination.js +0 -109
  98. package/es/SuperTab/SuperTab.js +0 -107
  99. package/es/SuperTab2/SuperTab2.js +0 -145
  100. package/es/SuperTable/DragSortRow.js +0 -97
  101. package/es/SuperTable/FilterDropDown.js +0 -164
  102. package/es/SuperTable/SuperTable.js +0 -808
  103. package/es/SuperTable/fixed.js +0 -34
  104. package/es/SuperTable2/SuperTable2.js +0 -926
  105. package/es/SuperTable2/SuperTableCell.js +0 -225
  106. package/es/SuperTable3/FilterDropDown.js +0 -164
  107. package/es/SuperTable3/SuperTable.js +0 -665
  108. package/es/SuperTable3/fixed.js +0 -34
  109. package/es/SuperToolbar/SuperToolbar.js +0 -195
  110. package/es/SuperUpload/SuperUpload.js +0 -356
  111. package/es/Title/Title.js +0 -33
  112. package/es/Viewer/ImageViews.js +0 -258
  113. package/es/Viewer/Viewer.js +0 -122
  114. package/es/WingBlank/WingBlank.js +0 -16
  115. package/es/helper.js +0 -240
  116. package/es/index.js +0 -37
  117. package/es/variables.js +0 -6
  118. package/lib/Area/Area.js +0 -149
  119. package/lib/Area/package.json +0 -6
  120. package/lib/Card/Card.js +0 -27
  121. package/lib/Card/package.json +0 -6
  122. package/lib/CodeInput/CodeInput.js +0 -131
  123. package/lib/CodeInput/package.json +0 -6
  124. package/lib/Control/Control.js +0 -450
  125. package/lib/Control/event.js +0 -51
  126. package/lib/Control/package.json +0 -6
  127. package/lib/Enhance/Dialogs.js +0 -60
  128. package/lib/Enhance/Loading.js +0 -138
  129. package/lib/Enhance/index.js +0 -25
  130. package/lib/Enhance/package.json +0 -6
  131. package/lib/Header/Header.js +0 -169
  132. package/lib/Header/Header.less +0 -95
  133. package/lib/Header/Vertical.js +0 -114
  134. package/lib/Header/Vertical.less +0 -60
  135. package/lib/Header/package.json +0 -6
  136. package/lib/ImageView/ImageView.js +0 -108
  137. package/lib/ImageView/ImageView.less +0 -14
  138. package/lib/ImageView/package.json +0 -6
  139. package/lib/Indent/Indent.js +0 -27
  140. package/lib/Indent/package.json +0 -6
  141. package/lib/InpurCascader/InputCascader.js +0 -124
  142. package/lib/InpurCascader/package.json +0 -6
  143. package/lib/InputEditor/InputEditor.js +0 -181
  144. package/lib/InputEditor/inputEditor.less +0 -8
  145. package/lib/InputEditor/package.json +0 -6
  146. package/lib/InputSearch/InputSearch.js +0 -274
  147. package/lib/InputSearch/package.json +0 -6
  148. package/lib/InputSelect/InputSelect.js +0 -168
  149. package/lib/InputSelect/package.json +0 -6
  150. package/lib/InputTreeSelect/InputTreeSelect.js +0 -128
  151. package/lib/InputTreeSelect/package.json +0 -6
  152. package/lib/InputWriting/InputWriting.js +0 -93
  153. package/lib/InputWriting/package.json +0 -6
  154. package/lib/Layout/Layout.js +0 -209
  155. package/lib/Layout/Layout.less +0 -28
  156. package/lib/Layout/package.json +0 -6
  157. package/lib/LayoutLink/LayoutLink.js +0 -86
  158. package/lib/LayoutLink/LayoutLink.less +0 -53
  159. package/lib/LayoutLink/package.json +0 -6
  160. package/lib/Link/Link.js +0 -93
  161. package/lib/Link/package.json +0 -6
  162. package/lib/Loading/Loading.js +0 -21
  163. package/lib/Loading/Loading.less +0 -13
  164. package/lib/Loading/package.json +0 -6
  165. package/lib/Loading2/Loading2.js +0 -17
  166. package/lib/Loading2/Loading2.less +0 -19
  167. package/lib/Loading2/package.json +0 -6
  168. package/lib/ModalWithDrag/ModalWithDrag.js +0 -37
  169. package/lib/ModalWithDrag/ModalWithDrag.less +0 -6
  170. package/lib/ModalWithDrag/drag.js +0 -124
  171. package/lib/ModalWithDrag/package.json +0 -6
  172. package/lib/NumberInput/NumberInput.js +0 -208
  173. package/lib/NumberInput/package.json +0 -6
  174. package/lib/Search/Search.js +0 -510
  175. package/lib/Sidebar/Sidebar.js +0 -152
  176. package/lib/Sidebar/Sidebar.less +0 -78
  177. package/lib/Sidebar/package.json +0 -6
  178. package/lib/Sidebar2/Sidebar.js +0 -173
  179. package/lib/Sidebar2/Sidebar.less +0 -153
  180. package/lib/Sidebar2/package.json +0 -6
  181. package/lib/SuperForm/SuperForm.js +0 -610
  182. package/lib/SuperForm/SuperForm.less +0 -52
  183. package/lib/SuperForm/package.json +0 -6
  184. package/lib/SuperForm2/SuperForm.js +0 -699
  185. package/lib/SuperForm2/SuperForm.less +0 -52
  186. package/lib/SuperForm2/package.json +0 -6
  187. package/lib/SuperIcon/SuperIcon.js +0 -35
  188. package/lib/SuperIcon/package.json +0 -6
  189. package/lib/SuperPagination/SuperPagination.js +0 -117
  190. package/lib/SuperPagination/package.json +0 -6
  191. package/lib/SuperTab/SuperTab.js +0 -115
  192. package/lib/SuperTab/SuperTab.less +0 -43
  193. package/lib/SuperTab/package.json +0 -6
  194. package/lib/SuperTab2/SuperTab2.js +0 -153
  195. package/lib/SuperTab2/SuperTab2.less +0 -18
  196. package/lib/SuperTab2/package.json +0 -6
  197. package/lib/SuperTable/DragSortRow.js +0 -105
  198. package/lib/SuperTable/DragSortRow.less +0 -17
  199. package/lib/SuperTable/FilterDropDown.js +0 -172
  200. package/lib/SuperTable/FilterDropDown.less +0 -30
  201. package/lib/SuperTable/SuperTable.js +0 -816
  202. package/lib/SuperTable/SuperTable.less +0 -132
  203. package/lib/SuperTable/fixed.js +0 -42
  204. package/lib/SuperTable/package.json +0 -6
  205. package/lib/SuperTable2/SuperTable2.js +0 -939
  206. package/lib/SuperTable2/SuperTable2.less +0 -118
  207. package/lib/SuperTable2/SuperTableCell.js +0 -230
  208. package/lib/SuperTable2/package.json +0 -6
  209. package/lib/SuperTable3/FilterDropDown.js +0 -172
  210. package/lib/SuperTable3/FilterDropDown.less +0 -29
  211. package/lib/SuperTable3/SuperTable.js +0 -673
  212. package/lib/SuperTable3/SuperTable.less +0 -99
  213. package/lib/SuperTable3/fixed.js +0 -42
  214. package/lib/SuperTable3/package.json +0 -6
  215. package/lib/SuperToolbar/SuperToolbar.js +0 -203
  216. package/lib/SuperToolbar/SuperToolbar.less +0 -17
  217. package/lib/SuperToolbar/package.json +0 -6
  218. package/lib/SuperUpload/SuperUpload.js +0 -368
  219. package/lib/SuperUpload/SuperUpload.less +0 -28
  220. package/lib/SuperUpload/package.json +0 -6
  221. package/lib/Title/Title.js +0 -41
  222. package/lib/Title/Title.less +0 -35
  223. package/lib/Title/package.json +0 -6
  224. package/lib/Viewer/ImageViews.js +0 -266
  225. package/lib/Viewer/Viewer.js +0 -130
  226. package/lib/Viewer/Viewer.less +0 -67
  227. package/lib/Viewer/imgView.less +0 -59
  228. package/lib/Viewer/package.json +0 -7
  229. package/lib/WingBlank/WingBlank.js +0 -24
  230. package/lib/WingBlank/WingBlank.less +0 -12
  231. package/lib/WingBlank/package.json +0 -6
  232. package/lib/adjust.less +0 -89
  233. package/lib/helper.js +0 -246
  234. package/lib/history.js +0 -12
  235. package/lib/index.js +0 -271
  236. package/lib/index.less +0 -31
  237. package/lib/style.less +0 -30
  238. package/lib/variables.js +0 -14
  239. package/lib/variables.less +0 -73
  240. /package/{es → src}/Area/package.json +0 -0
  241. /package/{es → src}/Card/package.json +0 -0
  242. /package/{es → src}/CodeInput/package.json +0 -0
  243. /package/{es → src}/Control/package.json +0 -0
  244. /package/{es → src}/Enhance/package.json +0 -0
  245. /package/{es → src}/Header/Header.less +0 -0
  246. /package/{es → src}/Header/Vertical.less +0 -0
  247. /package/{es → src}/Header/package.json +0 -0
  248. /package/{es → src}/ImageView/ImageView.less +0 -0
  249. /package/{es → src}/ImageView/package.json +0 -0
  250. /package/{es → src}/Indent/package.json +0 -0
  251. /package/{es → src}/InpurCascader/package.json +0 -0
  252. /package/{es → src}/InputEditor/inputEditor.less +0 -0
  253. /package/{es → src}/InputEditor/package.json +0 -0
  254. /package/{es → src}/InputSearch/package.json +0 -0
  255. /package/{es → src}/InputSelect/package.json +0 -0
  256. /package/{es → src}/InputTreeSelect/package.json +0 -0
  257. /package/{es → src}/InputWriting/package.json +0 -0
  258. /package/{es → src}/Layout/Layout.less +0 -0
  259. /package/{es → src}/Layout/package.json +0 -0
  260. /package/{es → src}/LayoutLink/LayoutLink.less +0 -0
  261. /package/{es → src}/LayoutLink/package.json +0 -0
  262. /package/{es → src}/Link/package.json +0 -0
  263. /package/{es → src}/Loading/Loading.less +0 -0
  264. /package/{es → src}/Loading/package.json +0 -0
  265. /package/{es → src}/Loading2/Loading2.less +0 -0
  266. /package/{es → src}/Loading2/package.json +0 -0
  267. /package/{es → src}/ModalWithDrag/ModalWithDrag.less +0 -0
  268. /package/{es → src}/ModalWithDrag/package.json +0 -0
  269. /package/{es → src}/NumberInput/package.json +0 -0
  270. /package/{es → src}/Search/Search.less +0 -0
  271. /package/{es → src}/Search/package.json +0 -0
  272. /package/{es → src}/Sidebar/Sidebar.less +0 -0
  273. /package/{es → src}/Sidebar/package.json +0 -0
  274. /package/{es → src}/Sidebar2/Sidebar.less +0 -0
  275. /package/{es → src}/Sidebar2/package.json +0 -0
  276. /package/{es → src}/SuperForm/SuperForm.less +0 -0
  277. /package/{es → src}/SuperForm/package.json +0 -0
  278. /package/{es → src}/SuperForm2/SuperForm.less +0 -0
  279. /package/{es → src}/SuperForm2/package.json +0 -0
  280. /package/{es → src}/SuperIcon/package.json +0 -0
  281. /package/{es → src}/SuperPagination/package.json +0 -0
  282. /package/{es → src}/SuperTab/SuperTab.less +0 -0
  283. /package/{es → src}/SuperTab/package.json +0 -0
  284. /package/{es → src}/SuperTab2/SuperTab2.less +0 -0
  285. /package/{es → src}/SuperTab2/package.json +0 -0
  286. /package/{es → src}/SuperTable/DragSortRow.less +0 -0
  287. /package/{es → src}/SuperTable/FilterDropDown.less +0 -0
  288. /package/{es → src}/SuperTable/SuperTable.less +0 -0
  289. /package/{es → src}/SuperTable/package.json +0 -0
  290. /package/{es → src}/SuperTable2/SuperTable2.less +0 -0
  291. /package/{es → src}/SuperTable2/package.json +0 -0
  292. /package/{es → src}/SuperTable3/FilterDropDown.less +0 -0
  293. /package/{es → src}/SuperTable3/SuperTable.less +0 -0
  294. /package/{es → src}/SuperTable3/package.json +0 -0
  295. /package/{es → src}/SuperToolbar/SuperToolbar.less +0 -0
  296. /package/{es → src}/SuperToolbar/package.json +0 -0
  297. /package/{es → src}/SuperUpload/SuperUpload.less +0 -0
  298. /package/{es → src}/SuperUpload/package.json +0 -0
  299. /package/{es → src}/Title/Title.less +0 -0
  300. /package/{es → src}/Title/package.json +0 -0
  301. /package/{es → src}/Viewer/Viewer.less +0 -0
  302. /package/{es → src}/Viewer/imgView.less +0 -0
  303. /package/{es → src}/Viewer/package.json +0 -0
  304. /package/{es → src}/WingBlank/WingBlank.less +0 -0
  305. /package/{es → src}/WingBlank/package.json +0 -0
  306. /package/{es → src}/adjust.less +0 -0
  307. /package/{es → src}/style.less +0 -0
  308. /package/{es → src}/variables.less +0 -0
@@ -1,673 +0,0 @@
1
- "use strict";
2
-
3
- var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
4
- var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
5
- var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
6
- var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
7
- var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
8
- var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
9
- var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
10
- var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
11
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
12
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
13
- _Object$defineProperty(exports, "__esModule", {
14
- value: true
15
- });
16
- exports["default"] = void 0;
17
- var _table = _interopRequireDefault(require("antd/lib/table"));
18
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
19
- var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
20
- var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
21
- var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
22
- var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
23
- var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
24
- var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
25
- var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
26
- var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
27
- var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
28
- var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
29
- var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
30
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
31
- var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
32
- var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
33
- var _parseFloat2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-float"));
34
- var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
35
- var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
36
- var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
37
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
38
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
39
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
40
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
41
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
42
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
43
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
44
- var _react = _interopRequireDefault(require("react"));
45
- var _propTypes = _interopRequireDefault(require("prop-types"));
46
- var _reactDom = _interopRequireDefault(require("react-dom"));
47
- var _Control = require("../Control");
48
- var _FilterDropDown = _interopRequireDefault(require("./FilterDropDown"));
49
- var _fixed = _interopRequireDefault(require("./fixed"));
50
- var _variables = _interopRequireDefault(require("../variables"));
51
- var _excluded = ["onRowClick"];
52
- function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
53
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context11, _context12; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context11 = ownKeys(Object(t), !0)).call(_context11, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context12 = ownKeys(Object(t))).call(_context12, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
54
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
55
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
56
- /**
57
- * sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
58
- * filter: [可选],是否支持过滤,默认为false
59
- * link: [可选],为true表示超链接,内容来至items;为字符串表示超链接,内容就是该字符串;为字符串‘list’表示超链接数组,内容就是该items对应key对象数组的linkTitleKey属性拼接
60
- * linkTitleKey: [可选],当link为'list'表示超链接组时,该值表示要拼接展示的属性key值
61
- * isDateFilterByStartAndEnd: [可选],为true时做过滤操作会显示时间段搜索,默认为false
62
- *
63
- */
64
- var ColType = {
65
- key: _propTypes["default"].string.isRequired,
66
- title: _propTypes["default"].string,
67
- align: _propTypes["default"].oneOf(['left', 'center', 'right']),
68
- sorter: _propTypes["default"].oneOf(['string', 'number']),
69
- filter: _propTypes["default"].bool,
70
- hide: _propTypes["default"].bool,
71
- options: _propTypes["default"].array,
72
- link: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),
73
- linkTitleKey: _propTypes["default"].string,
74
- noWrap: _propTypes["default"].bool,
75
- isDateFilterByStartAndEnd: _propTypes["default"].bool
76
- };
77
- var ItemType = {
78
- checked: _propTypes["default"].bool
79
- };
80
-
81
- /**
82
- * onCheck:点击复选框时触发, 原型为onCheck(checkedRows)
83
- * onRadio: 点击单选按钮时触发,原型为func(checkedRows)
84
- * onDoubleClick: 行双击时触发,原型func(rowIndex)
85
- * onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
86
- * onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
87
- */
88
- var CallbackType = {
89
- onCheck: _propTypes["default"].func,
90
- onRadio: _propTypes["default"].func,
91
- onDoubleClick: _propTypes["default"].func,
92
- onLink: _propTypes["default"].func,
93
- onTableChange: _propTypes["default"].func
94
- };
95
-
96
- /**
97
- * checkbox: [可选],是否有复选框,默认为true
98
- * isPaging: [可选],是否分页,默认为false
99
- * radio: [可选],是否为单选按钮,当checkbox为true时生效,默认值为false
100
- * checkedRows: [可选],选中的行数,radio为true时生效
101
- * index: [可选],是否有序号,默认值为true
102
- * indexTitle:[可选],序号标题,默认为'序号'
103
- * sortInfo: [可选],排序信息,默认为null
104
- * filterInfo: [可选],过滤信息,默认为null
105
- * maxHeight: [可选],设置表格的最大高度
106
- * childrenKey: [可选],设置子列表数据的key,默认children
107
- */
108
- var SuperTable = /*#__PURE__*/function (_React$Component) {
109
- (0, _inherits2["default"])(SuperTable, _React$Component);
110
- var _super = _createSuper(SuperTable);
111
- function SuperTable() {
112
- var _context;
113
- var _this;
114
- (0, _classCallCheck2["default"])(this, SuperTable);
115
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
116
- args[_key] = arguments[_key];
117
- }
118
- _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
119
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
120
- filterVisibleKey: ''
121
- });
122
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTableChange", function (pagination, filters, sorter) {
123
- var _ref = _this.props.callback || {},
124
- onTableChange = _ref.onTableChange;
125
- var _this$props$filterInf = _this.props.filterInfo,
126
- filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
127
- onTableChange && onTableChange(sorter, filterInfo);
128
- });
129
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function () {
130
- var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
131
- var _ref2 = _this.props.callback || {},
132
- onCheck = _ref2.onCheck;
133
- if (onCheck) {
134
- var _this$props$items = _this.props.items,
135
- items = _this$props$items === void 0 ? [] : _this$props$items;
136
- var offset = 0;
137
- var realSlectedList = selectedKeyArr.length > items.length ? (0, _slice["default"])(selectedKeyArr).call(selectedKeyArr, 0, selectedKeyArr.length + offset) : selectedKeyArr;
138
- var selectedKeys = realSlectedList;
139
- var newItems = items;
140
- if (selectedKeys.length === 0) {
141
- onCheck(true, false, -1);
142
- } else if (selectedKeys.length === newItems.length) {
143
- var checked = (0, _every["default"])(newItems).call(newItems, function (o) {
144
- return o.checked;
145
- });
146
- onCheck(true, !checked, -1);
147
- } else {
148
- var defaultSelectedKeys = _this.getSelectedRowKeys(newItems);
149
- if (selectedKeys.length > defaultSelectedKeys.length) {
150
- if (_this.props.isPaging && selectedKeys.length - defaultSelectedKeys.length > 1) {
151
- return onCheck(true, true, -1);
152
- }
153
- onCheck(false, true, selectedKeys[selectedKeys.length - 1]);
154
- } else {
155
- var index = (0, _findIndex["default"])(defaultSelectedKeys).call(defaultSelectedKeys, function (key) {
156
- return !(0, _some["default"])(selectedKeys).call(selectedKeys, function (select) {
157
- return select === key;
158
- });
159
- });
160
- onCheck(false, false, defaultSelectedKeys[index]);
161
- }
162
- }
163
- }
164
- });
165
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheckChange", function (selectedKeys) {
166
- var _ref3 = _this.props.callback || {},
167
- onCheck = _ref3.onCheck;
168
- onCheck && onCheck(selectedKeys);
169
- });
170
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioChange", function (selectedKeys) {
171
- var _ref4 = _this.props.callback || {},
172
- onRadio = _ref4.onRadio;
173
- onRadio && onRadio(selectedKeys);
174
- });
175
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioRowClick", function (record) {
176
- var _ref5 = _this.props.callback || {},
177
- onRadio = _ref5.onRadio;
178
- onRadio && onRadio([record.key]);
179
- });
180
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowClick", function (record) {
181
- var items = _this.props.items;
182
- if (items.length <= record.key) return;
183
- clearTimeout(_this.timer);
184
- _this.timer = (0, _setTimeout2["default"])(function () {
185
- var _ref6 = _this.props.callback || {},
186
- onCheck = _ref6.onCheck;
187
- if (onCheck) {
188
- var _this$props$checkedRo = _this.props.checkedRows,
189
- checkedRows = _this$props$checkedRo === void 0 ? [] : _this$props$checkedRo;
190
- if ((0, _includes["default"])(checkedRows).call(checkedRows, record.key)) {
191
- onCheck((0, _filter["default"])(checkedRows).call(checkedRows, function (key) {
192
- return record.key !== key;
193
- }));
194
- } else {
195
- onCheck((0, _concat["default"])(checkedRows).call(checkedRows, record.key));
196
- }
197
- }
198
- }, 250);
199
- });
200
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (record) {
201
- clearTimeout(_this.timer);
202
- var _ref7 = _this.props.callback || {},
203
- onDoubleClick = _ref7.onDoubleClick;
204
- onDoubleClick && onDoubleClick(record.key);
205
- });
206
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLink", function (key, index, item, e) {
207
- var _ref8 = _this.props.callback || {},
208
- onLink = _ref8.onLink;
209
- onLink && onLink(key, index, item);
210
- e.stopPropagation();
211
- });
212
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLinkDouble", function (e) {
213
- e.stopPropagation();
214
- });
215
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
216
- return (0, _reduce["default"])(items).call(items, function (result, item, index) {
217
- item.checked && result.push(index);
218
- return result;
219
- }, []);
220
- });
221
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndexInfo", function () {
222
- var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
223
- var _this$props = _this.props,
224
- _this$props$index = _this$props.index,
225
- index = _this$props$index === void 0 ? true : _this$props$index,
226
- _this$props$indexTitl = _this$props.indexTitle,
227
- indexTitle = _this$props$indexTitl === void 0 ? '序号' : _this$props$indexTitl;
228
- return index ? [{
229
- key: 'index',
230
- title: indexTitle,
231
- render: function render(text, record, index) {
232
- return index + 1;
233
- }
234
- }] : [];
235
- });
236
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setSortInfo", function (col, sortInfo) {
237
- if (col.sorter === 'string') {
238
- col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
239
- col.sorter = function (row1, row2) {
240
- var a = !col.link ? row1[col.key] : row1[col.key].props.children;
241
- var b = !col.link ? row2[col.key] : row2[col.key].props.children;
242
- if (a > b) {
243
- return 1;
244
- } else if (a === b) {
245
- return 0;
246
- } else {
247
- return -1;
248
- }
249
- };
250
- } else if (col.sorter === 'number') {
251
- col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
252
- col.sorter = function (a, b) {
253
- return a[col.key] - b[col.key];
254
- };
255
- } else {
256
- delete col.sorter;
257
- }
258
- });
259
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
260
- if ((0, _filter["default"])(col)) {
261
- var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
262
- isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
263
- var onSearch = function onSearch(value) {
264
- var _ref9 = _this.props.callback || {},
265
- onTableChange = _ref9.onTableChange;
266
- var _this$props$sortInfo = _this.props.sortInfo,
267
- sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
268
- var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
269
- _this.setState({
270
- filterVisibleKey: ''
271
- });
272
- onTableChange && onTableChange(sortInfo, newFilterInfo);
273
- };
274
- var value = filterInfo[col.key];
275
- col.filteredValue = value ? [value] : null;
276
- col.filterDropdownVisible = visibleKey === col.key;
277
- var onClose = function onClose() {
278
- _this.setState({
279
- filterVisibleKey: ''
280
- });
281
- };
282
- col.filterDropdown = /*#__PURE__*/_react["default"].createElement(_FilterDropDown["default"], {
283
- value: value,
284
- onSearch: onSearch,
285
- onClose: onClose,
286
- isDateFilterByStartAndEnd: isDateFilterByStartAndEnd
287
- });
288
- col.onFilterDropdownVisibleChange = function (visible) {
289
- if (isDateFilterByStartAndEnd) {
290
- visible && _this.setState({
291
- filterVisibleKey: col.key
292
- });
293
- } else {
294
- _this.setState({
295
- filterVisibleKey: visible ? col.key : ''
296
- });
297
- }
298
- };
299
- col.onFilter = function (value, record) {
300
- var content = !col.link ? record[col.key] : record[col.key].props.children;
301
- if (!col.isDateFilterByStartAndEnd) {
302
- var con = (0, _isArray["default"])(content) ? content : String(content);
303
- return (0, _includes["default"])(con).call(con, value);
304
- } else {
305
- return !(value.start && new Date(value.start) > new Date(content) || value.end && value.end < content);
306
- }
307
- };
308
- }
309
- delete col.filter;
310
- });
311
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "linkList", function (key, index, item) {
312
- var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
313
- var list = item[key] || [];
314
- return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
315
- var _context2, _context3;
316
- var split = index2 === list.length - 1 ? '' : ',';
317
- var onClick = (0, _bind["default"])(_context2 = _this.onLink).call(_context2, null, key, index, item2);
318
- return /*#__PURE__*/_react["default"].createElement("a", {
319
- key: index2,
320
- onClick: onClick,
321
- onDoubleClick: _this.onLinkDouble
322
- }, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
323
- }));
324
- });
325
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "waring", function (key, index, item, warningKey) {
326
- var text = item[key] ? item[key] : '';
327
- var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
328
- return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
329
- style: {
330
- color: color
331
- }
332
- }, text.title ? text.title : text));
333
- });
334
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultList", function (key, index, item, text, link) {
335
- var _context4;
336
- var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
337
- if (link && typeof link === 'string') {
338
- return /*#__PURE__*/_react["default"].createElement("a", {
339
- onClick: onClick,
340
- onDoubleClick: _this.onLinkDouble
341
- }, text);
342
- }
343
- return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
344
- });
345
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols, items) {
346
- var _context5, _context6;
347
- var _this$props2 = _this.props,
348
- sortInfo = _this$props2.sortInfo,
349
- filterInfo = _this$props2.filterInfo;
350
- var filterVisibleKey = _this.state.filterVisibleKey;
351
- return (0, _map["default"])(_context5 = (0, _concat["default"])(_context6 = _this.getIndexInfo(items)).call(_context6, (0, _filter["default"])(cols).call(cols, function (col) {
352
- return !col.hide;
353
- }))).call(_context5, function (_ref10) {
354
- var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref10), _ref10));
355
- col.dataIndex = col.key;
356
- col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? s[col.align] : '';
357
- col.noWrap && (col.className = (0, _variables["default"])('SuperTable3').noWrap);
358
- _this.setSortInfo(col, sortInfo || {});
359
- _this.setFilterInfo(col, filterInfo || {}, filterVisibleKey);
360
- if (col.defaultValue) {
361
- col.render = function (text, record, index) {
362
- return _this.defaultList(col.key, index, items[index], col.defaultValue, col.link);
363
- };
364
- } else if (col.link === 'list') {
365
- col.render = function (text, record, index) {
366
- return _this.linkList(col.key, index, items[index], col.linkTitleKey);
367
- };
368
- } else if (col.link && typeof col.link === 'string') {
369
- col.render = function (text, record, index) {
370
- return _this.link(col.key, index, items[index], col.link);
371
- };
372
- } else if (col.isWarning) {
373
- col.render = function (text, record, index) {
374
- return _this.waring(col.key, index, items[index], col.warningKey);
375
- };
376
- } else if (col.tooltip) {
377
- col.render = function (text, record, index) {
378
- return _this.tooltip(col.key, index, items[index], col);
379
- };
380
- }
381
- return col;
382
- });
383
- });
384
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
385
- if ((0, _isArray["default"])(value)) {
386
- return (0, _map["default"])(value).call(value, function (v) {
387
- return (0, _Control.getTitle)(v, options);
388
- }).toString();
389
- } else {
390
- return (0, _Control.getTitle)(value, options);
391
- }
392
- });
393
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "link", function (key, index, item, text) {
394
- var _context7;
395
- var onClick = (0, _bind["default"])(_context7 = _this.onLink).call(_context7, null, key, index, item);
396
- return /*#__PURE__*/_react["default"].createElement("a", {
397
- onClick: onClick,
398
- onDoubleClick: _this.onLinkDouble
399
- }, text);
400
- });
401
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tooltip", function (key, index, item, _ref11) {
402
- var tipLen = _ref11.tooltip,
403
- options = _ref11.options;
404
- var text = _this.getText(item[key], options);
405
- var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
406
- return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
407
- title: text
408
- }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _slice["default"])(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/_react["default"].createElement("span", null, (0, _isArray["default"])(text) ? text.join(',') : text);
409
- });
410
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getImgSrc", function (value, options) {
411
- var index = (0, _findIndex["default"])(options).call(options, function (obj) {
412
- return obj.value == value;
413
- });
414
- return index === -1 ? null : options[index].img;
415
- });
416
- /**
417
- *
418
- * @param item{array}:列数据
419
- * @param key{string}:字段key
420
- * @param options{array}:字段options
421
- * @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
422
- */
423
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSourceText", function (item, key, options, dataSource) {
424
- var value = {};
425
- if (typeof dataSource === 'string') {
426
- value = item[dataSource] || {};
427
- } else if ((0, _isArray["default"])(dataSource)) {
428
- (0, _forEach["default"])(dataSource).call(dataSource, function (source, index) {
429
- /*如果字段重复则用dataSource取到结果,key不作为取字段的标准*/
430
- if (index === 0) {
431
- value = item[source] || {};
432
- } else {
433
- value = value[source] || {};
434
- }
435
- });
436
- }
437
- /*如果上面已经取到结果则不进入*/
438
- if (typeof value !== 'string') {
439
- value = value[key];
440
- }
441
- return _this.getText(value, options);
442
- });
443
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
444
- var getItemObj = function getItemObj(item, index) {
445
- return (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
446
- var key = _ref12.key,
447
- options = _ref12.options,
448
- link = _ref12.link,
449
- icon = _ref12.icon,
450
- dataSource = _ref12.dataSource;
451
- if (link) {
452
- if (typeof link === 'boolean') {
453
- result[key] = _this.link(key, index, item, _this.getText(item[key], options));
454
- }
455
- } else if (icon) {
456
- var _context8;
457
- //单独的icon列,icon=true数据值根据options获得显示的图片url
458
- var src = _this.getImgSrc(item[key], options);
459
- var onClick = (0, _bind["default"])(_context8 = _this.onLink).call(_context8, null, key, index, item);
460
- result[key] = src ? /*#__PURE__*/_react["default"].createElement("img", {
461
- src: src,
462
- onClick: onClick
463
- }) : '';
464
- } else if (dataSource) {
465
- result[key] = _this.getSourceText(item, key, options, dataSource);
466
- } else {
467
- result[key] = _this.getText(item[key], options);
468
- }
469
- return result;
470
- }, {
471
- key: index,
472
- checked: !!item.checked
473
- });
474
- };
475
- var data = (0, _map["default"])(items).call(items, function (item, index) {
476
- var _context9;
477
- return _objectSpread(_objectSpread({}, getItemObj(item, index)), {}, {
478
- children: item.children ? (0, _map["default"])(_context9 = item.children).call(_context9, function (item2, index2) {
479
- var _context10;
480
- return getItemObj(item2, (0, _concat["default"])(_context10 = "".concat(index, "-")).call(_context10, index2));
481
- }) : null
482
- });
483
- });
484
- return data;
485
- });
486
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
487
- var _this$props3 = _this.props,
488
- _this$props3$checkbox = _this$props3.checkbox,
489
- checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
490
- _this$props3$checkedR = _this$props3.checkedRows,
491
- checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR;
492
- var rowClassName1 = function rowClassName1(record) {
493
- return (0, _includes["default"])(checkedRows).call(checkedRows, record.key) ? (0, _variables["default"])('SuperTable3').select : '';
494
- };
495
- if (checkbox) {
496
- return {
497
- rowClassName: rowClassName1,
498
- onRowClick: _this.onRowClick,
499
- rowSelection: {
500
- selectedRowKeys: checkedRows,
501
- onChange: _this.onCheckChange,
502
- getCheckboxProps: function getCheckboxProps(record) {
503
- var checked = (0, _includes["default"])(checkedRows).call(checkedRows, record.key);
504
- return {
505
- checked: checked
506
- };
507
- }
508
- }
509
- };
510
- }
511
- });
512
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
513
- return function (record) {
514
- return {
515
- onClick: function onClick() {
516
- return onRowClick && onRowClick(record);
517
- },
518
- onDoubleClick: function onDoubleClick() {
519
- return _this.onDoubleClick(record);
520
- }
521
- };
522
- };
523
- });
524
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getItems", function () {
525
- var _this$props4 = _this.props,
526
- items = _this$props4.items,
527
- childrenKey = _this$props4.childrenKey;
528
- var resItems = items;
529
- if (childrenKey) {
530
- resItems = (0, _map["default"])(items).call(items, function (o) {
531
- return o[childrenKey] && o[childrenKey].length ? _objectSpread(_objectSpread({}, o), {}, {
532
- children: o[childrenKey]
533
- }) : o;
534
- });
535
- }
536
- return resItems;
537
- });
538
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTotalFooter", function () {
539
- var _this$props5 = _this.props,
540
- cols = _this$props5.cols,
541
- items = _this$props5.items,
542
- checkedRows = _this$props5.checkedRows;
543
- var totalCols = (0, _filter["default"])(cols).call(cols, function (item) {
544
- return item.total;
545
- });
546
- if (totalCols.length > 0) {
547
- var checkedItems = (0, _filter["default"])(items).call(items, function (item, index) {
548
- return (0, _includes["default"])(checkedRows).call(checkedRows, index);
549
- });
550
- var countItems = checkedItems.length ? checkedItems : items;
551
- var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref13) {
552
- var title = _ref13.title,
553
- key = _ref13.key,
554
- _ref13$props = _ref13.props,
555
- props = _ref13$props === void 0 ? {} : _ref13$props;
556
- var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
557
- return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
558
- }, 0);
559
- return {
560
- title: title,
561
- value: value
562
- };
563
- });
564
- return /*#__PURE__*/_react["default"].createElement("div", {
565
- style: {
566
- height: '36px',
567
- lineHeight: '36px'
568
- }
569
- }, /*#__PURE__*/_react["default"].createElement("span", {
570
- style: {
571
- marginRight: "15px"
572
- }
573
- }, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref14, index) {
574
- var title = _ref14.title,
575
- value = _ref14.value;
576
- return /*#__PURE__*/_react["default"].createElement("span", {
577
- key: index,
578
- style: {
579
- marginRight: "10px"
580
- }
581
- }, /*#__PURE__*/_react["default"].createElement("span", null, title, ": "), /*#__PURE__*/_react["default"].createElement("span", {
582
- style: {
583
- color: '#01a4ff'
584
- }
585
- }, value));
586
- }));
587
- } else {
588
- return null;
589
- }
590
- });
591
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
592
- var _this$props6 = _this.props,
593
- cols = _this$props6.cols,
594
- _this$props6$isPaging = _this$props6.isPaging,
595
- isPaging = _this$props6$isPaging === void 0 ? false : _this$props6$isPaging,
596
- _this$props6$footer = _this$props6.footer,
597
- footer = _this$props6$footer === void 0 ? null : _this$props6$footer;
598
- var items = _this.getItems();
599
- var _this$getPropsByCheck = _this.getPropsByCheckbox(items),
600
- onRowClick = _this$getPropsByCheck.onRowClick,
601
- extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
602
- var renderProps = _objectSpread({
603
- className: (0, _variables["default"])('SuperTable3'),
604
- columns: _this.getColumns(cols, items),
605
- dataSource: _this.getDataSource(items, cols),
606
- size: 'small',
607
- pagination: isPaging,
608
- scroll: {
609
- x: true
610
- },
611
- onChange: _this.onTableChange,
612
- onRow: _this.getRowProps(onRowClick),
613
- components: {},
614
- footer: footer ? footer : _this.toTotalFooter
615
- }, extraProps);
616
- return renderProps;
617
- });
618
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
619
- var maxHeight = _this.props.maxHeight;
620
- if (maxHeight && _this.getItems().length) {
621
- var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
622
- var container = root.getElementsByClassName('ant-table-body')[0];
623
- var header = root.getElementsByClassName('ant-table-thead')[0];
624
- (0, _fixed["default"])(container, header, maxHeight);
625
- }
626
- });
627
- return _this;
628
- }
629
- (0, _createClass2["default"])(SuperTable, [{
630
- key: "shouldComponentUpdate",
631
- value: function shouldComponentUpdate(props, state) {
632
- var _this2 = this;
633
- var keys = ['cols', 'items', 'maxHeight', 'checkedRows', 'sortInfo', 'filterInfo'];
634
- return (0, _some["default"])(keys).call(keys, function (key) {
635
- return props[key] !== _this2.props[key];
636
- }) || state.filterVisibleKey !== this.state.filterVisibleKey;
637
- }
638
- }, {
639
- key: "componentDidMount",
640
- value: function componentDidMount() {
641
- this.setScroll();
642
- }
643
- }, {
644
- key: "componentDidUpdate",
645
- value: function componentDidUpdate() {
646
- this.setScroll();
647
- }
648
- }, {
649
- key: "render",
650
- value: function render() {
651
- return /*#__PURE__*/_react["default"].createElement(_table["default"], (0, _extends2["default"])({}, this.getProps(), {
652
- key: this.props.items.length
653
- }));
654
- }
655
- }]);
656
- return SuperTable;
657
- }(_react["default"].Component);
658
- (0, _defineProperty2["default"])(SuperTable, "propTypes", {
659
- cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
660
- items: _propTypes["default"].arrayOf(_propTypes["default"].shape(ItemType)).isRequired,
661
- isPaging: _propTypes["default"].bool,
662
- checkbox: _propTypes["default"].bool,
663
- radio: _propTypes["default"].bool,
664
- checkedRows: _propTypes["default"].array,
665
- index: _propTypes["default"].bool,
666
- indexTitle: _propTypes["default"].string,
667
- sortInfo: _propTypes["default"].object,
668
- filterInfo: _propTypes["default"].object,
669
- maxHeight: _propTypes["default"].string,
670
- callback: _propTypes["default"].shape(CallbackType),
671
- childrenKey: _propTypes["default"].string
672
- });
673
- var _default = exports["default"] = SuperTable;