cloud-b2b 1.0.0 → 1.0.3

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 (208) hide show
  1. package/es/Area/Area.js +166 -0
  2. package/es/Area/package.json +6 -0
  3. package/es/Card/Card.js +20 -0
  4. package/es/Card/package.json +6 -0
  5. package/es/Control/Control.js +428 -0
  6. package/es/Control/event.js +57 -0
  7. package/es/Control/package.json +6 -0
  8. package/es/Enhance/Dialogs.js +67 -0
  9. package/es/Enhance/Loading.js +151 -0
  10. package/es/Enhance/index.js +8 -0
  11. package/es/Enhance/package.json +6 -0
  12. package/es/Header/Header.js +194 -0
  13. package/es/Header/Header.less +95 -0
  14. package/es/Header/Vertical.js +129 -0
  15. package/es/Header/Vertical.less +60 -0
  16. package/es/Header/package.json +6 -0
  17. package/es/HomeHeader/Header.js +75 -0
  18. package/es/HomeHeader/Header.less +73 -0
  19. package/es/HomeHeader/package.json +6 -0
  20. package/es/ImageView/ImageView.js +117 -0
  21. package/es/ImageView/ImageView.less +14 -0
  22. package/es/ImageView/package.json +6 -0
  23. package/es/InpurCascader/InputCascader.js +135 -0
  24. package/es/InpurCascader/package.json +6 -0
  25. package/es/InputEditor/InputEditor.js +118 -0
  26. package/es/InputEditor/inputEditor.less +8 -0
  27. package/es/InputEditor/package.json +6 -0
  28. package/es/InputSearch/InputSearch.js +306 -0
  29. package/es/InputSearch/package.json +6 -0
  30. package/es/InputSelect/InputSelect.js +185 -0
  31. package/es/InputSelect/package.json +6 -0
  32. package/es/InputWriting/InputWriting.js +107 -0
  33. package/es/InputWriting/package.json +6 -0
  34. package/es/Layout/Layout.js +232 -0
  35. package/es/Layout/Layout.less +28 -0
  36. package/es/Layout/package.json +6 -0
  37. package/es/LayoutLink/LayoutLink.js +82 -0
  38. package/es/LayoutLink/LayoutLink.less +53 -0
  39. package/es/LayoutLink/package.json +6 -0
  40. package/es/Link/Link.js +108 -0
  41. package/es/Link/package.json +6 -0
  42. package/es/Loading/Loading.js +15 -0
  43. package/es/Loading/Loading.less +13 -0
  44. package/es/Loading/package.json +6 -0
  45. package/es/Loading2/Loading2.js +11 -0
  46. package/es/Loading2/Loading2.less +19 -0
  47. package/es/Loading2/package.json +6 -0
  48. package/es/ModalWithDrag/ModalWithDrag.js +34 -0
  49. package/es/ModalWithDrag/ModalWithDrag.less +6 -0
  50. package/es/ModalWithDrag/drag.js +133 -0
  51. package/es/ModalWithDrag/package.json +6 -0
  52. package/es/NumberInput/NumberInput.js +237 -0
  53. package/es/NumberInput/package.json +6 -0
  54. package/es/Search/Search.js +581 -0
  55. package/es/Search/Search.less +63 -0
  56. package/es/Search/package.json +6 -0
  57. package/es/Sidebar/Sidebar.js +165 -0
  58. package/es/Sidebar/Sidebar.less +78 -0
  59. package/es/Sidebar/package.json +6 -0
  60. package/es/Sidebar2/Sidebar.js +192 -0
  61. package/es/Sidebar2/Sidebar.less +153 -0
  62. package/es/Sidebar2/package.json +6 -0
  63. package/es/SuperForm/SuperForm.js +688 -0
  64. package/es/SuperForm/SuperForm.less +52 -0
  65. package/es/SuperForm/package.json +6 -0
  66. package/es/SuperIcon/SuperIcon.js +30 -0
  67. package/es/SuperIcon/package.json +6 -0
  68. package/es/SuperPagination/SuperPagination.js +126 -0
  69. package/es/SuperPagination/package.json +6 -0
  70. package/es/SuperTable/DragSortRow.js +125 -0
  71. package/es/SuperTable/DragSortRow.less +17 -0
  72. package/es/SuperTable/FilterDropDown.js +188 -0
  73. package/es/SuperTable/FilterDropDown.less +30 -0
  74. package/es/SuperTable/SuperTable.js +933 -0
  75. package/es/SuperTable/SuperTable.less +135 -0
  76. package/es/SuperTable/fixed.js +42 -0
  77. package/es/SuperTable/package.json +6 -0
  78. package/es/SuperTable2/SuperTable2.js +700 -0
  79. package/es/SuperTable2/SuperTable2.less +100 -0
  80. package/es/SuperTable2/SuperTableCell.js +215 -0
  81. package/es/SuperTable2/package.json +6 -0
  82. package/es/SuperToolbar/SuperToolbar.js +223 -0
  83. package/es/SuperToolbar/SuperToolbar.less +17 -0
  84. package/es/SuperToolbar/package.json +6 -0
  85. package/es/SuperUpload/SuperUpload.js +282 -0
  86. package/es/SuperUpload/SuperUpload.less +27 -0
  87. package/es/SuperUpload/package.json +6 -0
  88. package/es/Title/Title.less +35 -35
  89. package/es/Title/package.json +6 -6
  90. package/es/Viewer/ImageViews.js +311 -0
  91. package/es/Viewer/Viewer.js +149 -0
  92. package/es/Viewer/Viewer.less +67 -0
  93. package/es/Viewer/imgView.less +59 -0
  94. package/es/Viewer/package.json +7 -0
  95. package/es/WingBlank/WingBlank.js +20 -0
  96. package/es/WingBlank/WingBlank.less +12 -0
  97. package/es/WingBlank/package.json +6 -0
  98. package/es/adjust.less +89 -0
  99. package/es/helper.js +118 -0
  100. package/es/history.js +5 -0
  101. package/es/index.js +27 -1
  102. package/es/style.less +20 -1
  103. package/es/variables.less +73 -73
  104. package/lib/Area/Area.js +194 -0
  105. package/lib/Area/package.json +6 -0
  106. package/lib/Card/Card.js +38 -0
  107. package/lib/Card/package.json +6 -0
  108. package/lib/Control/Control.js +477 -0
  109. package/lib/Control/event.js +68 -0
  110. package/lib/Control/package.json +6 -0
  111. package/lib/Enhance/Dialogs.js +87 -0
  112. package/lib/Enhance/Loading.js +175 -0
  113. package/lib/Enhance/index.js +35 -0
  114. package/lib/Enhance/package.json +6 -0
  115. package/lib/Header/Header.js +215 -0
  116. package/lib/Header/Header.less +95 -0
  117. package/lib/Header/Vertical.js +150 -0
  118. package/lib/Header/Vertical.less +60 -0
  119. package/lib/Header/package.json +6 -0
  120. package/lib/HomeHeader/Header.js +95 -0
  121. package/lib/HomeHeader/Header.less +73 -0
  122. package/lib/HomeHeader/package.json +6 -0
  123. package/lib/ImageView/ImageView.js +134 -0
  124. package/lib/ImageView/ImageView.less +14 -0
  125. package/lib/ImageView/package.json +6 -0
  126. package/lib/InpurCascader/InputCascader.js +156 -0
  127. package/lib/InpurCascader/package.json +6 -0
  128. package/lib/InputEditor/InputEditor.js +136 -0
  129. package/lib/InputEditor/inputEditor.less +8 -0
  130. package/lib/InputEditor/package.json +6 -0
  131. package/lib/InputSearch/InputSearch.js +322 -0
  132. package/lib/InputSearch/package.json +6 -0
  133. package/lib/InputSelect/InputSelect.js +208 -0
  134. package/lib/InputSelect/package.json +6 -0
  135. package/lib/InputWriting/InputWriting.js +123 -0
  136. package/lib/InputWriting/package.json +6 -0
  137. package/lib/Layout/Layout.js +258 -0
  138. package/lib/Layout/Layout.less +28 -0
  139. package/lib/Layout/package.json +6 -0
  140. package/lib/LayoutLink/LayoutLink.js +114 -0
  141. package/lib/LayoutLink/LayoutLink.less +53 -0
  142. package/lib/LayoutLink/package.json +6 -0
  143. package/lib/Link/Link.js +130 -0
  144. package/lib/Link/package.json +6 -0
  145. package/lib/Loading/Loading.js +30 -0
  146. package/lib/Loading/Loading.less +13 -0
  147. package/lib/Loading/package.json +6 -0
  148. package/lib/Loading2/Loading2.js +26 -0
  149. package/lib/Loading2/Loading2.less +19 -0
  150. package/lib/Loading2/package.json +6 -0
  151. package/lib/ModalWithDrag/ModalWithDrag.js +53 -0
  152. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  153. package/lib/ModalWithDrag/drag.js +147 -0
  154. package/lib/ModalWithDrag/package.json +6 -0
  155. package/lib/NumberInput/NumberInput.js +259 -0
  156. package/lib/NumberInput/package.json +6 -0
  157. package/lib/Search/Search.js +603 -0
  158. package/lib/Search/Search.less +63 -0
  159. package/lib/Search/package.json +6 -0
  160. package/lib/Sidebar/Sidebar.js +186 -0
  161. package/lib/Sidebar/Sidebar.less +78 -0
  162. package/lib/Sidebar/package.json +6 -0
  163. package/lib/Sidebar2/Sidebar.js +213 -0
  164. package/lib/Sidebar2/Sidebar.less +153 -0
  165. package/lib/Sidebar2/package.json +6 -0
  166. package/lib/SuperForm/SuperForm.js +702 -0
  167. package/lib/SuperForm/SuperForm.less +52 -0
  168. package/lib/SuperForm/package.json +6 -0
  169. package/lib/SuperIcon/SuperIcon.js +47 -0
  170. package/lib/SuperIcon/package.json +6 -0
  171. package/lib/SuperPagination/SuperPagination.js +145 -0
  172. package/lib/SuperPagination/package.json +6 -0
  173. package/lib/SuperTable/DragSortRow.js +142 -0
  174. package/lib/SuperTable/DragSortRow.less +17 -0
  175. package/lib/SuperTable/FilterDropDown.js +205 -0
  176. package/lib/SuperTable/FilterDropDown.less +30 -0
  177. package/lib/SuperTable/SuperTable.js +937 -0
  178. package/lib/SuperTable/SuperTable.less +135 -0
  179. package/lib/SuperTable/fixed.js +55 -0
  180. package/lib/SuperTable/package.json +6 -0
  181. package/lib/SuperTable2/SuperTable2.js +725 -0
  182. package/lib/SuperTable2/SuperTable2.less +100 -0
  183. package/lib/SuperTable2/SuperTableCell.js +231 -0
  184. package/lib/SuperTable2/package.json +6 -0
  185. package/lib/SuperToolbar/SuperToolbar.js +248 -0
  186. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  187. package/lib/SuperToolbar/package.json +6 -0
  188. package/lib/SuperUpload/SuperUpload.js +324 -0
  189. package/lib/SuperUpload/SuperUpload.less +27 -0
  190. package/lib/SuperUpload/package.json +6 -0
  191. package/lib/Title/Title.less +35 -35
  192. package/lib/Title/package.json +6 -6
  193. package/lib/Viewer/ImageViews.js +323 -0
  194. package/lib/Viewer/Viewer.js +167 -0
  195. package/lib/Viewer/Viewer.less +67 -0
  196. package/lib/Viewer/imgView.less +59 -0
  197. package/lib/Viewer/package.json +7 -0
  198. package/lib/WingBlank/WingBlank.js +37 -0
  199. package/lib/WingBlank/WingBlank.less +12 -0
  200. package/lib/WingBlank/package.json +6 -0
  201. package/lib/adjust.less +89 -0
  202. package/lib/helper.js +147 -0
  203. package/lib/history.js +18 -0
  204. package/lib/index.js +235 -1
  205. package/lib/index.less +25 -1
  206. package/lib/style.less +20 -1
  207. package/lib/variables.less +73 -73
  208. package/package.json +3 -2
@@ -0,0 +1,937 @@
1
+ "use strict";
2
+
3
+ var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
4
+
5
+ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
6
+
7
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
8
+
9
+ var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
10
+
11
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
12
+
13
+ var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
14
+
15
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
16
+
17
+ var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
18
+
19
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
20
+
21
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
22
+
23
+ _Object$defineProperty(exports, "__esModule", {
24
+ value: true
25
+ });
26
+
27
+ exports["default"] = void 0;
28
+
29
+ var _table = _interopRequireDefault(require("antd/lib/table"));
30
+
31
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
32
+
33
+ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
34
+
35
+ var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
36
+
37
+ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
38
+
39
+ var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
40
+
41
+ var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
42
+
43
+ var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
44
+
45
+ var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
46
+
47
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
48
+
49
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
50
+
51
+ var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
52
+
53
+ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
54
+
55
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
56
+
57
+ var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
58
+
59
+ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
60
+
61
+ var _parseFloat2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-float"));
62
+
63
+ var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
64
+
65
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
66
+
67
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
68
+
69
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
70
+
71
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
72
+
73
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
74
+
75
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
76
+
77
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
78
+
79
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
80
+
81
+ var _react = _interopRequireDefault(require("react"));
82
+
83
+ var _propTypes = _interopRequireDefault(require("prop-types"));
84
+
85
+ var _reactDom = _interopRequireDefault(require("react-dom"));
86
+
87
+ var _Control = require("../Control");
88
+
89
+ var _FilterDropDown = _interopRequireDefault(require("./FilterDropDown"));
90
+
91
+ var _fixed = _interopRequireDefault(require("./fixed"));
92
+
93
+ var _DragSortRow = _interopRequireDefault(require("./DragSortRow"));
94
+
95
+ var _variables = _interopRequireDefault(require("../variables"));
96
+
97
+ var _excluded = ["onRowClick"];
98
+
99
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
100
+
101
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context9, _context10; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty2(_context9 = ownKeys(Object(source), !0)).call(_context9, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(_context10 = ownKeys(Object(source))).call(_context10, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
102
+
103
+ 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); }; }
104
+
105
+ 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; } }
106
+
107
+ /**
108
+ * sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
109
+ * filter: [可选],是否支持过滤,默认为false
110
+ * link: [可选],为true表示超链接,内容来至items;为字符串表示超链接,内容就是该字符串;为字符串‘list’表示超链接数组,内容就是该items对应key对象数组的linkTitleKey属性拼接
111
+ * linkTitleKey: [可选],当link为'list'表示超链接组时,该值表示要拼接展示的属性key值
112
+ * isDateFilterByStartAndEnd: [可选],为true时做过滤操作会显示时间段搜索,默认为false
113
+ *
114
+ */
115
+ var ColType = {
116
+ key: _propTypes["default"].string.isRequired,
117
+ title: _propTypes["default"].string,
118
+ align: _propTypes["default"].oneOf(['left', 'center', 'right']),
119
+ sorter: _propTypes["default"].oneOf(['string', 'number']),
120
+ filter: _propTypes["default"].bool,
121
+ hide: _propTypes["default"].bool,
122
+ options: _propTypes["default"].array,
123
+ link: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),
124
+ linkTitleKey: _propTypes["default"].string,
125
+ noWrap: _propTypes["default"].bool,
126
+ isDateFilterByStartAndEnd: _propTypes["default"].bool
127
+ };
128
+ var ItemType = {
129
+ checked: _propTypes["default"].bool
130
+ };
131
+ /**
132
+ * onCheck:点击复选框时触发,原型func(isAll, checked, rowIndex);isolation为true时,原型为onCheck(checkedRows)
133
+ * onRadio: 点击单选按钮时触发,原型为func(checkedRows)
134
+ * onDoubleClick: 行双击时触发,原型func(rowIndex)
135
+ * onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
136
+ * onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
137
+ * onMoveRow:行拖曳排序时触发,原型为func(dragIndex, targetIndex)
138
+ */
139
+
140
+ var CallbackType = {
141
+ onCheck: _propTypes["default"].func,
142
+ onRadio: _propTypes["default"].func,
143
+ onDoubleClick: _propTypes["default"].func,
144
+ onLink: _propTypes["default"].func,
145
+ onTableChange: _propTypes["default"].func,
146
+ onMoveRow: _propTypes["default"].func
147
+ };
148
+ /**
149
+ * checkbox: [可选],是否有复选框,默认为true
150
+ * isPaging: [可选],是否分页,默认为false
151
+ * radio: [可选],是否为单选按钮,当checkbox为true时生效,默认值为false
152
+ * isolation: [可选],为true时,复选框的选中行采用checkedRows存储
153
+ * checkedRows: [可选],选中的行数,radio为true时生效
154
+ * index: [可选],是否有序号,默认值为true
155
+ * indexTitle:[可选],序号标题,默认为'序号'
156
+ * sortInfo: [可选],排序信息,默认为null
157
+ * filterInfo: [可选],过滤信息,默认为null
158
+ * maxHeight: [可选],设置表格的最大高度
159
+ * dragSort: [可选], 为true表示支持行拖曳排序,且不支持行单击选中复选或单选按钮和双击事件,默认为false
160
+ * isEmphasized: [可选],是否强调,行字体加粗显示;要实现字体加粗显示除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
161
+ * isWeaken: [可选],是否弱化行字体置灰显示,除了isWeaken设置为true之外,置灰行数据里要设置__isWeaken为true
162
+ * pageTotal: [可选], 为true表示开启表格末行自动汇总表格列数据,默认为false || searchTotal,当开启时,需要汇总的列需设置属性total为true,当dragSort为true时,该选项失效
163
+ * searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
164
+ */
165
+
166
+ var SuperTable = /*#__PURE__*/function (_React$Component) {
167
+ (0, _inherits2["default"])(SuperTable, _React$Component);
168
+
169
+ var _super = _createSuper(SuperTable);
170
+
171
+ function SuperTable() {
172
+ var _context;
173
+
174
+ var _this;
175
+
176
+ (0, _classCallCheck2["default"])(this, SuperTable);
177
+
178
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
179
+ args[_key] = arguments[_key];
180
+ }
181
+
182
+ _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
183
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
184
+ filterVisibleKey: ''
185
+ });
186
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTableChange", function (pagination, filters, sorter) {
187
+ var _ref = _this.props.callback || {},
188
+ onTableChange = _ref.onTableChange;
189
+
190
+ var _this$props$filterInf = _this.props.filterInfo,
191
+ filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
192
+ onTableChange && onTableChange(sorter, filterInfo);
193
+ });
194
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function () {
195
+ var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
196
+
197
+ var _ref2 = _this.props.callback || {},
198
+ onCheck = _ref2.onCheck;
199
+
200
+ if (onCheck) {
201
+ var _this$props = _this.props,
202
+ _this$props$items = _this$props.items,
203
+ items = _this$props$items === void 0 ? [] : _this$props$items,
204
+ _this$props$isWeaken = _this$props.isWeaken,
205
+ isWeaken = _this$props$isWeaken === void 0 ? false : _this$props$isWeaken,
206
+ pageTotal = _this$props.pageTotal,
207
+ searchTotal = _this$props.searchTotal;
208
+ var offset = 0;
209
+ pageTotal && offset--;
210
+ searchTotal && offset--;
211
+ var realSlectedList = selectedKeyArr.length > items.length ? (0, _slice["default"])(selectedKeyArr).call(selectedKeyArr, 0, selectedKeyArr.length + offset) : selectedKeyArr;
212
+ var selectedKeys = isWeaken ? (0, _filter["default"])(realSlectedList).call(realSlectedList, function (o) {
213
+ return !items[o].__isWeaken;
214
+ }) : realSlectedList;
215
+ var newItems = isWeaken ? (0, _filter["default"])(items).call(items, function (o) {
216
+ return !o.__isWeaken;
217
+ }) : items;
218
+
219
+ if (selectedKeys.length === 0) {
220
+ onCheck(true, false, -1);
221
+ } else if (selectedKeys.length === newItems.length) {
222
+ var checked = (0, _every["default"])(newItems).call(newItems, function (o) {
223
+ return o.checked;
224
+ });
225
+ onCheck(true, !checked, -1);
226
+ } else {
227
+ var defaultSelectedKeys = _this.getSelectedRowKeys(newItems);
228
+
229
+ if (selectedKeys.length > defaultSelectedKeys.length) {
230
+ if (_this.props.isPaging && selectedKeys.length - defaultSelectedKeys.length > 1) {
231
+ return onCheck(true, true, -1);
232
+ }
233
+
234
+ onCheck(false, true, selectedKeys[selectedKeys.length - 1]);
235
+ } else {
236
+ var index = (0, _findIndex["default"])(defaultSelectedKeys).call(defaultSelectedKeys, function (key) {
237
+ return !(0, _some["default"])(selectedKeys).call(selectedKeys, function (select) {
238
+ return select === key;
239
+ });
240
+ });
241
+ onCheck(false, false, defaultSelectedKeys[index]);
242
+ }
243
+ }
244
+ }
245
+ });
246
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheckChange", function (selectedKeys) {
247
+ var _ref3 = _this.props.callback || {},
248
+ onCheck = _ref3.onCheck;
249
+
250
+ onCheck && onCheck(selectedKeys);
251
+ });
252
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioChange", function (selectedKeys) {
253
+ var _ref4 = _this.props.callback || {},
254
+ onRadio = _ref4.onRadio;
255
+
256
+ onRadio && onRadio(selectedKeys);
257
+ });
258
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioRowClick", function (record) {
259
+ var _ref5 = _this.props.callback || {},
260
+ onRadio = _ref5.onRadio;
261
+
262
+ onRadio && onRadio([record.key]);
263
+ });
264
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowClick", function (record) {
265
+ var _this$props2 = _this.props,
266
+ _this$props2$isWeaken = _this$props2.isWeaken,
267
+ isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
268
+ items = _this$props2.items;
269
+ if (items.length <= record.key) return;
270
+ clearTimeout(_this.timer);
271
+ _this.timer = (0, _setTimeout2["default"])(function () {
272
+ var _ref6 = _this.props.callback || {},
273
+ onCheck = _ref6.onCheck;
274
+
275
+ if (onCheck) {
276
+ var _this$props3 = _this.props,
277
+ isolation = _this$props3.isolation,
278
+ _this$props3$checkedR = _this$props3.checkedRows,
279
+ checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR;
280
+
281
+ if (isolation) {
282
+ if ((0, _includes["default"])(checkedRows).call(checkedRows, record.key)) {
283
+ onCheck((0, _filter["default"])(checkedRows).call(checkedRows, function (key) {
284
+ return record.key !== key;
285
+ }));
286
+ } else {
287
+ onCheck((0, _concat["default"])(checkedRows).call(checkedRows, record.key));
288
+ }
289
+ } else {
290
+ var checked = isWeaken && items[record.key].__isWeaken ? false : !record.checked;
291
+ onCheck(false, checked, record.key);
292
+ }
293
+ }
294
+ }, 250);
295
+ });
296
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (record) {
297
+ clearTimeout(_this.timer);
298
+
299
+ var _ref7 = _this.props.callback || {},
300
+ onDoubleClick = _ref7.onDoubleClick;
301
+
302
+ onDoubleClick && onDoubleClick(record.key);
303
+ });
304
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLink", function (key, index, item, e) {
305
+ var _ref8 = _this.props.callback || {},
306
+ onLink = _ref8.onLink;
307
+
308
+ onLink && onLink(key, index, item);
309
+ e.stopPropagation();
310
+ });
311
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLinkDouble", function (e) {
312
+ e.stopPropagation();
313
+ });
314
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
315
+ var _ref9 = _this.props.callback || {},
316
+ onMoveRow = _ref9.onMoveRow;
317
+
318
+ onMoveRow && onMoveRow(dragIndex, targetIndex);
319
+ });
320
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
321
+ return (0, _reduce["default"])(items).call(items, function (result, item, index) {
322
+ item.checked && result.push(index);
323
+ return result;
324
+ }, []);
325
+ });
326
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndexInfo", function () {
327
+ var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
328
+ var _this$props4 = _this.props,
329
+ _this$props4$index = _this$props4.index,
330
+ index = _this$props4$index === void 0 ? true : _this$props4$index,
331
+ _this$props4$indexTit = _this$props4.indexTitle,
332
+ indexTitle = _this$props4$indexTit === void 0 ? '序号' : _this$props4$indexTit;
333
+ return index ? [{
334
+ key: 'index',
335
+ title: indexTitle,
336
+ render: function render(text, record, index) {
337
+ return items[record.key].__totalIndexTitle || index + 1;
338
+ }
339
+ }] : [];
340
+ });
341
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setSortInfo", function (col, sortInfo) {
342
+ if (col.sorter === 'string') {
343
+ col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
344
+
345
+ col.sorter = function (row1, row2) {
346
+ var a = !col.link ? row1[col.key] : row1[col.key].props.children;
347
+ var b = !col.link ? row2[col.key] : row2[col.key].props.children;
348
+
349
+ if (a > b) {
350
+ return 1;
351
+ } else if (a === b) {
352
+ return 0;
353
+ } else {
354
+ return -1;
355
+ }
356
+ };
357
+ } else if (col.sorter === 'number') {
358
+ col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
359
+
360
+ col.sorter = function (a, b) {
361
+ return a[col.key] - b[col.key];
362
+ };
363
+ } else {
364
+ delete col.sorter;
365
+ }
366
+ });
367
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
368
+ if ((0, _filter["default"])(col)) {
369
+ var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
370
+ isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
371
+
372
+ var onSearch = function onSearch(value) {
373
+ var _ref10 = _this.props.callback || {},
374
+ onTableChange = _ref10.onTableChange;
375
+
376
+ var _this$props$sortInfo = _this.props.sortInfo,
377
+ sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
378
+ var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
379
+
380
+ _this.setState({
381
+ filterVisibleKey: ''
382
+ });
383
+
384
+ onTableChange && onTableChange(sortInfo, newFilterInfo);
385
+ };
386
+
387
+ var value = filterInfo[col.key];
388
+ col.filteredValue = value ? [value] : null;
389
+ col.filterDropdownVisible = visibleKey === col.key;
390
+
391
+ var onClose = function onClose() {
392
+ _this.setState({
393
+ filterVisibleKey: ''
394
+ });
395
+ };
396
+
397
+ col.filterDropdown = /*#__PURE__*/_react["default"].createElement(_FilterDropDown["default"], {
398
+ value: value,
399
+ onSearch: onSearch,
400
+ onClose: onClose,
401
+ isDateFilterByStartAndEnd: isDateFilterByStartAndEnd
402
+ });
403
+
404
+ col.onFilterDropdownVisibleChange = function (visible) {
405
+ if (isDateFilterByStartAndEnd) {
406
+ visible && _this.setState({
407
+ filterVisibleKey: col.key
408
+ });
409
+ } else {
410
+ _this.setState({
411
+ filterVisibleKey: visible ? col.key : ''
412
+ });
413
+ }
414
+ };
415
+
416
+ col.onFilter = function (value, record) {
417
+ var items = _this.getItems();
418
+
419
+ if (items[record.key].__total) return true;
420
+ var content = !col.link ? record[col.key] : record[col.key].props.children;
421
+
422
+ if (!col.isDateFilterByStartAndEnd) {
423
+ var con = (0, _isArray["default"])(content) ? content : String(content);
424
+ return (0, _includes["default"])(con).call(con, value);
425
+ } else {
426
+ return !(value.start && new Date(value.start) > new Date(content) || value.end && value.end < content);
427
+ }
428
+ };
429
+ }
430
+
431
+ delete col.filter;
432
+ });
433
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "linkList", function (key, index, item) {
434
+ var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
435
+ var list = item[key] || [];
436
+ return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
437
+ var _context2, _context3;
438
+
439
+ var split = index2 === list.length - 1 ? '' : ',';
440
+ var onClick = (0, _bind["default"])(_context2 = _this.onLink).call(_context2, null, key, index, item2);
441
+ return /*#__PURE__*/_react["default"].createElement("a", {
442
+ key: index2,
443
+ onClick: onClick,
444
+ onDoubleClick: _this.onLinkDouble
445
+ }, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
446
+ }));
447
+ });
448
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "waring", function (key, index, item, warningKey) {
449
+ var text = item[key] ? item[key] : '';
450
+ var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
451
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
452
+ style: {
453
+ color: color
454
+ }
455
+ }, text.title ? text.title : text));
456
+ });
457
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultList", function (key, index, item, text, link) {
458
+ var _context4;
459
+
460
+ var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
461
+
462
+ if (link && typeof link === 'string') {
463
+ return /*#__PURE__*/_react["default"].createElement("a", {
464
+ onClick: onClick,
465
+ onDoubleClick: _this.onLinkDouble
466
+ }, text);
467
+ }
468
+
469
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
470
+ });
471
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols, items) {
472
+ var _context5, _context6;
473
+
474
+ var _this$props5 = _this.props,
475
+ sortInfo = _this$props5.sortInfo,
476
+ filterInfo = _this$props5.filterInfo;
477
+ var filterVisibleKey = _this.state.filterVisibleKey;
478
+ return (0, _map["default"])(_context5 = (0, _concat["default"])(_context6 = _this.getIndexInfo(items)).call(_context6, (0, _filter["default"])(cols).call(cols, function (col) {
479
+ return !col.hide;
480
+ }))).call(_context5, function (_ref11) {
481
+ var col = (0, _extends2["default"])({}, _ref11);
482
+ col.dataIndex = col.key;
483
+ col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? (0, _variables["default"])('SuperTable')[col.align] : '';
484
+ col.noWrap && (col.className = (0, _variables["default"])('SuperTable').noWrap);
485
+
486
+ _this.setSortInfo(col, sortInfo || {});
487
+
488
+ _this.setFilterInfo(col, filterInfo || {}, filterVisibleKey);
489
+
490
+ if (col.defaultValue) {
491
+ col.render = function (text, record, index) {
492
+ return _this.defaultList(col.key, index, items[index], col.defaultValue, col.link);
493
+ };
494
+ } else if (col.link === 'list') {
495
+ col.render = function (text, record, index) {
496
+ return _this.linkList(col.key, index, items[index], col.linkTitleKey);
497
+ };
498
+ } else if (col.link && typeof col.link === 'string') {
499
+ col.render = function (text, record, index) {
500
+ return _this.link(col.key, index, items[index], col.link);
501
+ };
502
+ } else if (col.isWarning) {
503
+ col.render = function (text, record, index) {
504
+ return _this.waring(col.key, index, items[index], col.warningKey);
505
+ };
506
+ } else if (col.tooltip) {
507
+ col.render = function (text, record, index) {
508
+ return _this.tooltip(col.key, index, items[index], col);
509
+ };
510
+ }
511
+
512
+ return col;
513
+ });
514
+ });
515
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
516
+ if ((0, _isArray["default"])(value)) {
517
+ return (0, _map["default"])(value).call(value, function (v) {
518
+ return (0, _Control.getTitle)(v, options);
519
+ }).toString();
520
+ } else {
521
+ return (0, _Control.getTitle)(value, options);
522
+ }
523
+ });
524
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "link", function (key, index, item, text) {
525
+ var _context7;
526
+
527
+ var onClick = (0, _bind["default"])(_context7 = _this.onLink).call(_context7, null, key, index, item);
528
+ return /*#__PURE__*/_react["default"].createElement("a", {
529
+ onClick: onClick,
530
+ onDoubleClick: _this.onLinkDouble
531
+ }, text);
532
+ });
533
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tooltip", function (key, index, item, _ref12) {
534
+ var tipLen = _ref12.tooltip,
535
+ options = _ref12.options;
536
+
537
+ var text = _this.getText(item[key], options);
538
+
539
+ var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
540
+ return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
541
+ title: text
542
+ }, /*#__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);
543
+ });
544
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getImgSrc", function (value, options) {
545
+ var index = (0, _findIndex["default"])(options).call(options, function (obj) {
546
+ return obj.value == value;
547
+ });
548
+ return index === -1 ? null : options[index].img;
549
+ });
550
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSourceText", function (item, key, options, dataSource) {
551
+ var value = {};
552
+
553
+ if (typeof dataSource === 'string') {
554
+ value = item[dataSource] || {};
555
+ } else if ((0, _isArray["default"])(dataSource)) {
556
+ (0, _forEach["default"])(dataSource).call(dataSource, function (source, index) {
557
+ /*如果字段重复则用dataSource取到结果,key不作为取字段的标准*/
558
+ if (index === 0) {
559
+ value = item[source] || {};
560
+ } else {
561
+ value = value[source] || {};
562
+ }
563
+ });
564
+ }
565
+ /*如果上面已经取到结果则不进入*/
566
+
567
+
568
+ if (typeof value !== 'string') {
569
+ value = value[key];
570
+ }
571
+
572
+ return _this.getText(value, options);
573
+ });
574
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
575
+ return (0, _map["default"])(items).call(items, function (item, index) {
576
+ return (0, _reduce["default"])(cols).call(cols, function (result, _ref13) {
577
+ var key = _ref13.key,
578
+ options = _ref13.options,
579
+ link = _ref13.link,
580
+ icon = _ref13.icon,
581
+ dataSource = _ref13.dataSource;
582
+
583
+ if (link) {
584
+ if (typeof link === 'boolean') {
585
+ result[key] = _this.link(key, index, item, _this.getText(item[key], options));
586
+ }
587
+ } else if (icon) {
588
+ var _context8;
589
+
590
+ //单独的icon列,icon=true数据值根据options获得显示的图片url
591
+ var src = _this.getImgSrc(item[key], options);
592
+
593
+ var onClick = (0, _bind["default"])(_context8 = _this.onLink).call(_context8, null, key, index, item);
594
+ result[key] = src ? /*#__PURE__*/_react["default"].createElement("img", {
595
+ src: src,
596
+ onClick: onClick
597
+ }) : '';
598
+ } else if (dataSource) {
599
+ result[key] = _this.getSourceText(item, key, options, dataSource);
600
+ } else {
601
+ result[key] = _this.getText(item[key], options);
602
+ }
603
+
604
+ return result;
605
+ }, {
606
+ key: index,
607
+ checked: !!item.checked
608
+ });
609
+ });
610
+ });
611
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function (items) {
612
+ var _this$props6 = _this.props,
613
+ _this$props6$checkbox = _this$props6.checkbox,
614
+ checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
615
+ _this$props6$radio = _this$props6.radio,
616
+ radio = _this$props6$radio === void 0 ? false : _this$props6$radio,
617
+ isolation = _this$props6.isolation,
618
+ _this$props6$checkedR = _this$props6.checkedRows,
619
+ checkedRows = _this$props6$checkedR === void 0 ? [] : _this$props6$checkedR,
620
+ _this$props6$isEmphas = _this$props6.isEmphasized,
621
+ isEmphasized = _this$props6$isEmphas === void 0 ? false : _this$props6$isEmphas,
622
+ _this$props6$isWeaken = _this$props6.isWeaken,
623
+ isWeaken = _this$props6$isWeaken === void 0 ? true : _this$props6$isWeaken;
624
+
625
+ var rowClassName1 = function rowClassName1(record) {
626
+ if (items[record.key].__total) return s.totalRow;
627
+ if (items[record.key].__warningRow) return s.warningRow;
628
+ return (0, _includes["default"])(checkedRows).call(checkedRows, record.key) ? s.select : '';
629
+ };
630
+
631
+ var rowClassName2 = function rowClassName2(record) {
632
+ if (items[record.key].__total) return s.totalRow;
633
+ if (items[record.key].__warningRow) return s.warningRow;
634
+
635
+ if (isEmphasized && items[record.key].__isEmphasized) {
636
+ return items[record.key].checked ? s.emphasizedSelectRow : s.emphasizedUnselectRow;
637
+ }
638
+
639
+ if (isWeaken && items[record.key].__isWeaken) {
640
+ return items[record.key].checked ? s.weakenedSelectRow : s.weakenedUnselectRow;
641
+ }
642
+
643
+ return items[record.key].checked ? s.select : '';
644
+ };
645
+
646
+ if (checkbox) {
647
+ if (radio) {
648
+ return {
649
+ rowClassName: rowClassName1,
650
+ onRowClick: _this.onRadioRowClick,
651
+ rowSelection: {
652
+ type: 'radio',
653
+ selectedRowKeys: checkedRows,
654
+ onChange: _this.onRadioChange
655
+ }
656
+ };
657
+ } else if (isolation) {
658
+ return {
659
+ rowClassName: rowClassName1,
660
+ onRowClick: _this.onRowClick,
661
+ rowSelection: {
662
+ selectedRowKeys: checkedRows,
663
+ onChange: _this.onCheckChange,
664
+ getCheckboxProps: function getCheckboxProps(record) {
665
+ var checked = (0, _includes["default"])(checkedRows).call(checkedRows, record.key);
666
+ return {
667
+ checked: checked,
668
+ disabled: items[record.key].__isWeaken,
669
+ style: items[record.key].__total ? {
670
+ display: 'none'
671
+ } : {}
672
+ };
673
+ }
674
+ }
675
+ };
676
+ } else {
677
+ return {
678
+ rowClassName: rowClassName2,
679
+ onRowClick: _this.onRowClick,
680
+ rowSelection: {
681
+ selectedRowKeys: _this.getSelectedRowKeys(items),
682
+ onChange: _this.onChange,
683
+ getCheckboxProps: function getCheckboxProps(record) {
684
+ var checked = isWeaken && items[record.key].__isWeaken ? false : !!record.checked;
685
+ return {
686
+ checked: checked,
687
+ disabled: items[record.key].__isWeaken,
688
+ style: items[record.key].__total ? {
689
+ display: 'none'
690
+ } : {}
691
+ };
692
+ }
693
+ }
694
+ };
695
+ }
696
+ } else {
697
+ return {
698
+ rowClassName: rowClassName2
699
+ };
700
+ }
701
+ });
702
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
703
+ return function (record) {
704
+ return {
705
+ onClick: function onClick() {
706
+ return onRowClick && onRowClick(record);
707
+ },
708
+ onDoubleClick: function onDoubleClick() {
709
+ return _this.onDoubleClick(record);
710
+ }
711
+ };
712
+ };
713
+ });
714
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
715
+ return function (record, index) {
716
+ return {
717
+ index: index,
718
+ onMoveRow: _this.onMoveRow
719
+ };
720
+ };
721
+ });
722
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getItems", function () {
723
+ var _this$props7 = _this.props,
724
+ items = _this$props7.items,
725
+ cols = _this$props7.cols,
726
+ _this$props7$dragSort = _this$props7.dragSort,
727
+ dragSort = _this$props7$dragSort === void 0 ? false : _this$props7$dragSort,
728
+ _this$props7$pageTota = _this$props7.pageTotal,
729
+ pageTotal = _this$props7$pageTota === void 0 ? false : _this$props7$pageTota,
730
+ searchTotal = _this$props7.searchTotal;
731
+ var resItems = items;
732
+
733
+ if (!dragSort && items.length > 1) {
734
+ if (pageTotal || searchTotal) {
735
+ var totalItem = (0, _reduce["default"])(cols).call(cols, function (result, _ref14) {
736
+ var key = _ref14.key,
737
+ _ref14$total = _ref14.total,
738
+ total = _ref14$total === void 0 ? false : _ref14$total;
739
+
740
+ if (total) {
741
+ result[key] = (0, _parseFloat2["default"])(Number((0, _reduce["default"])(items).call(items, function (result, item) {
742
+ return (0, _parseFloat2["default"])(String(item[key] || 0)) + result;
743
+ }, 0)).toFixed(4));
744
+ }
745
+
746
+ return result;
747
+ }, {
748
+ __total: true,
749
+ __totalIndexTitle: '本页汇总'
750
+ });
751
+ resItems = (0, _concat["default"])(resItems).call(resItems, [totalItem]);
752
+ }
753
+
754
+ if (searchTotal) {
755
+ resItems = (0, _concat["default"])(resItems).call(resItems, [_objectSpread(_objectSpread({}, searchTotal), {}, {
756
+ __total: true,
757
+ __totalIndexTitle: '查询汇总'
758
+ })]);
759
+ }
760
+ }
761
+
762
+ return resItems;
763
+ });
764
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTotalFooter", function () {
765
+ var _this$props8 = _this.props,
766
+ cols = _this$props8.cols,
767
+ items = _this$props8.items,
768
+ isolation = _this$props8.isolation,
769
+ checkedRows = _this$props8.checkedRows;
770
+ var totalCols = (0, _filter["default"])(cols).call(cols, function (item) {
771
+ return item.total;
772
+ });
773
+
774
+ if (totalCols.length > 0) {
775
+ var checkedItems = isolation ? (0, _filter["default"])(items).call(items, function (item, index) {
776
+ return (0, _includes["default"])(checkedRows).call(checkedRows, index);
777
+ }) : (0, _filter["default"])(items).call(items, function (item) {
778
+ return item.checked;
779
+ });
780
+ var countItems = checkedItems.length ? checkedItems : items;
781
+ var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref15) {
782
+ var title = _ref15.title,
783
+ key = _ref15.key,
784
+ _ref15$props = _ref15.props,
785
+ props = _ref15$props === void 0 ? {} : _ref15$props;
786
+ var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
787
+ return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
788
+ }, 0);
789
+ return {
790
+ title: title,
791
+ value: value
792
+ };
793
+ });
794
+ return /*#__PURE__*/_react["default"].createElement("div", {
795
+ style: {
796
+ height: '36px',
797
+ lineHeight: '36px'
798
+ }
799
+ }, /*#__PURE__*/_react["default"].createElement("span", {
800
+ style: {
801
+ marginRight: "15px"
802
+ }
803
+ }, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref16, index) {
804
+ var title = _ref16.title,
805
+ value = _ref16.value;
806
+ return /*#__PURE__*/_react["default"].createElement("span", {
807
+ key: index,
808
+ style: {
809
+ marginRight: "10px"
810
+ }
811
+ }, /*#__PURE__*/_react["default"].createElement("span", null, title, ": "), /*#__PURE__*/_react["default"].createElement("span", {
812
+ style: {
813
+ color: '#01a4ff'
814
+ }
815
+ }, value));
816
+ }));
817
+ } else {
818
+ return null;
819
+ }
820
+ });
821
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
822
+ var _this$props9 = _this.props,
823
+ cols = _this$props9.cols,
824
+ _this$props9$isPaging = _this$props9.isPaging,
825
+ isPaging = _this$props9$isPaging === void 0 ? false : _this$props9$isPaging,
826
+ _this$props9$isEmphas = _this$props9.isEmphasized,
827
+ isEmphasized = _this$props9$isEmphas === void 0 ? false : _this$props9$isEmphas,
828
+ _this$props9$isWeaken = _this$props9.isWeaken,
829
+ isWeaken = _this$props9$isWeaken === void 0 ? false : _this$props9$isWeaken,
830
+ dragSort = _this$props9.dragSort,
831
+ _this$props9$footer = _this$props9.footer,
832
+ footer = _this$props9$footer === void 0 ? null : _this$props9$footer;
833
+
834
+ var items = _this.getItems();
835
+
836
+ var _this$getPropsByCheck = _this.getPropsByCheckbox(items),
837
+ onRowClick = _this$getPropsByCheck.onRowClick,
838
+ extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
839
+
840
+ var renderProps = _objectSpread({
841
+ className: !isEmphasized || !isWeaken ? (0, _variables["default"])('SuperTable') : (0, _variables["default"])('SuperTable').noTransition,
842
+ columns: _this.getColumns(cols, items),
843
+ dataSource: _this.getDataSource(items, cols),
844
+ size: 'small',
845
+ pagination: isPaging,
846
+ scroll: {
847
+ x: true
848
+ },
849
+ onChange: _this.onTableChange,
850
+ onRow: dragSort ? _this.getRowPropsForDrag() : _this.getRowProps(onRowClick),
851
+ components: dragSort ? {
852
+ body: {
853
+ row: _DragSortRow["default"]
854
+ }
855
+ } : {},
856
+ footer: footer ? footer : _this.toTotalFooter
857
+ }, extraProps);
858
+
859
+ return renderProps;
860
+ });
861
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
862
+ var _this$props10 = _this.props,
863
+ maxHeight = _this$props10.maxHeight,
864
+ pageTotal = _this$props10.pageTotal,
865
+ searchTotal = _this$props10.searchTotal;
866
+
867
+ if (maxHeight && _this.getItems().length) {
868
+ var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
869
+
870
+ var container = root.getElementsByClassName('ant-table-body')[0];
871
+ var header = root.getElementsByClassName('ant-table-thead')[0];
872
+ var tbody = root.getElementsByClassName('ant-table-tbody')[0];
873
+ var pageTotalOffset = searchTotal ? 2 : 1;
874
+ var pageTotalElement = pageTotal && tbody && tbody.children ? tbody.children[tbody.children.length - pageTotalOffset] : null;
875
+ var searchTotalElement = searchTotal && tbody && tbody.children ? tbody.children[tbody.children.length - 1] : null;
876
+ (0, _fixed["default"])(container, header, maxHeight, {
877
+ pageTotalElement: pageTotalElement,
878
+ searchTotalElement: searchTotalElement
879
+ });
880
+ }
881
+ });
882
+ return _this;
883
+ }
884
+
885
+ (0, _createClass2["default"])(SuperTable, [{
886
+ key: "shouldComponentUpdate",
887
+ value: function shouldComponentUpdate(props, state) {
888
+ var _this2 = this;
889
+
890
+ var keys = ['cols', 'items', 'maxHeight', 'checkedRows', 'sortInfo', 'filterInfo'];
891
+ return (0, _some["default"])(keys).call(keys, function (key) {
892
+ return props[key] !== _this2.props[key];
893
+ }) || state.filterVisibleKey !== this.state.filterVisibleKey;
894
+ }
895
+ }, {
896
+ key: "componentDidMount",
897
+ value: function componentDidMount() {
898
+ this.setScroll();
899
+ }
900
+ }, {
901
+ key: "componentDidUpdate",
902
+ value: function componentDidUpdate() {
903
+ this.setScroll();
904
+ }
905
+ }, {
906
+ key: "render",
907
+ value: function render() {
908
+ return /*#__PURE__*/_react["default"].createElement(_table["default"], (0, _extends2["default"])({}, this.getProps(), {
909
+ key: this.props.items.length
910
+ }));
911
+ }
912
+ }]);
913
+ return SuperTable;
914
+ }(_react["default"].Component);
915
+
916
+ (0, _defineProperty2["default"])(SuperTable, "propTypes", {
917
+ cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
918
+ items: _propTypes["default"].arrayOf(_propTypes["default"].shape(ItemType)).isRequired,
919
+ isPaging: _propTypes["default"].bool,
920
+ checkbox: _propTypes["default"].bool,
921
+ radio: _propTypes["default"].bool,
922
+ isolation: _propTypes["default"].bool,
923
+ checkedRows: _propTypes["default"].array,
924
+ index: _propTypes["default"].bool,
925
+ indexTitle: _propTypes["default"].string,
926
+ sortInfo: _propTypes["default"].object,
927
+ filterInfo: _propTypes["default"].object,
928
+ maxHeight: _propTypes["default"].string,
929
+ callback: _propTypes["default"].shape(CallbackType),
930
+ isEmphasized: _propTypes["default"].bool,
931
+ isWeaken: _propTypes["default"].bool,
932
+ dragSort: _propTypes["default"].bool,
933
+ pageTotal: _propTypes["default"].bool,
934
+ searchTotal: _propTypes["default"].object
935
+ });
936
+ var _default = SuperTable;
937
+ exports["default"] = _default;