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