cloud-b2b 1.1.56 → 1.1.57
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.
- package/es/Area/Area.js +8 -11
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Enhance/Dialogs.js +11 -14
- package/es/Enhance/Loading.js +15 -18
- package/es/Header/Header.js +17 -20
- package/es/Header/Vertical.js +11 -14
- package/es/ImageView/ImageView.js +10 -13
- package/es/InpurCascader/InputCascader.js +26 -20
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +19 -22
- package/es/InputSelect/InputSelect.js +14 -17
- package/es/InputTreeSelect/InputTreeSelect.js +10 -13
- package/es/InputWriting/InputWriting.js +12 -15
- package/es/Layout/Layout.js +14 -17
- package/es/Link/Link.js +7 -10
- package/es/NumberInput/NumberInput.js +13 -16
- package/es/Search/Search.js +52 -55
- package/es/Sidebar/Sidebar.js +11 -14
- package/es/Sidebar2/Sidebar.js +13 -16
- package/es/SuperForm/SuperForm.js +74 -79
- package/es/SuperForm2/SuperForm.js +95 -100
- package/es/SuperPagination/SuperPagination.js +8 -11
- package/es/SuperTab/SuperTab.js +12 -15
- package/es/SuperTab2/SuperTab2.js +13 -16
- package/es/SuperTable/DragSortRow.js +12 -15
- package/es/SuperTable/FilterDropDown.js +11 -14
- package/es/SuperTable/SuperTable.js +68 -71
- package/es/SuperTable2/SuperTable2.js +85 -88
- package/es/SuperTable2/SuperTableCell.js +39 -29
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +11 -14
- package/es/SuperUpload/SuperUpload.js +74 -74
- package/es/Viewer/ImageViews.js +16 -19
- package/es/Viewer/Viewer.js +11 -14
- package/es/helper.js +18 -17
- package/lib/Area/Area.js +8 -11
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Enhance/Dialogs.js +11 -14
- package/lib/Enhance/Loading.js +15 -18
- package/lib/Header/Header.js +17 -20
- package/lib/Header/Vertical.js +11 -14
- package/lib/ImageView/ImageView.js +10 -13
- package/lib/InpurCascader/InputCascader.js +26 -20
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +19 -22
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +96 -102
- package/lib/SuperPagination/SuperPagination.js +8 -11
- package/lib/SuperTab/SuperTab.js +12 -15
- package/lib/SuperTab2/SuperTab2.js +13 -16
- package/lib/SuperTable/DragSortRow.js +12 -15
- package/lib/SuperTable/FilterDropDown.js +11 -14
- package/lib/SuperTable/SuperTable.js +68 -71
- package/lib/SuperTable2/SuperTable2.js +86 -90
- package/lib/SuperTable2/SuperTableCell.js +39 -29
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +11 -14
- package/lib/SuperUpload/SuperUpload.js +75 -76
- package/lib/Viewer/ImageViews.js +16 -19
- package/lib/Viewer/Viewer.js +11 -14
- package/lib/helper.js +18 -17
- package/package.json +1 -1
|
@@ -36,10 +36,9 @@ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-
|
|
|
36
36
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
37
37
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
38
38
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
39
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
40
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
41
39
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
42
40
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
41
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
43
42
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
44
43
|
var _react = _interopRequireDefault(require("react"));
|
|
45
44
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -51,9 +50,9 @@ var _DragSortRow = _interopRequireDefault(require("./DragSortRow"));
|
|
|
51
50
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
52
51
|
var _excluded = ["onRowClick"];
|
|
53
52
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
54
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9,
|
|
55
|
-
function
|
|
56
|
-
function _isNativeReflectConstruct() {
|
|
53
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context0; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context9 = ownKeys(Object(t), !0)).call(_context9, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context0 = ownKeys(Object(t))).call(_context0, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
54
|
+
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)); }
|
|
55
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
57
56
|
/**
|
|
58
57
|
* sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
|
|
59
58
|
* filter: [可选],是否支持过滤,默认为false
|
|
@@ -114,8 +113,6 @@ var CallbackType = {
|
|
|
114
113
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
115
114
|
*/
|
|
116
115
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
117
|
-
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
118
|
-
var _super = _createSuper(SuperTable);
|
|
119
116
|
function SuperTable() {
|
|
120
117
|
var _context;
|
|
121
118
|
var _this;
|
|
@@ -123,18 +120,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
123
120
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
124
121
|
args[_key] = arguments[_key];
|
|
125
122
|
}
|
|
126
|
-
_this =
|
|
127
|
-
(0, _defineProperty2["default"])(
|
|
123
|
+
_this = _callSuper(this, SuperTable, (0, _concat["default"])(_context = []).call(_context, args));
|
|
124
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
128
125
|
filterVisibleKey: ''
|
|
129
126
|
});
|
|
130
|
-
(0, _defineProperty2["default"])(
|
|
127
|
+
(0, _defineProperty2["default"])(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
131
128
|
var _ref = _this.props.callback || {},
|
|
132
129
|
onTableChange = _ref.onTableChange;
|
|
133
130
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
134
131
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
135
132
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
136
133
|
});
|
|
137
|
-
(0, _defineProperty2["default"])(
|
|
134
|
+
(0, _defineProperty2["default"])(_this, "onChange", function () {
|
|
138
135
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
139
136
|
var _ref2 = _this.props.callback || {},
|
|
140
137
|
onCheck = _ref2.onCheck;
|
|
@@ -181,22 +178,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
181
178
|
}
|
|
182
179
|
}
|
|
183
180
|
});
|
|
184
|
-
(0, _defineProperty2["default"])(
|
|
181
|
+
(0, _defineProperty2["default"])(_this, "onCheckChange", function (selectedKeys) {
|
|
185
182
|
var _ref3 = _this.props.callback || {},
|
|
186
183
|
onCheck = _ref3.onCheck;
|
|
187
184
|
onCheck && onCheck(selectedKeys);
|
|
188
185
|
});
|
|
189
|
-
(0, _defineProperty2["default"])(
|
|
186
|
+
(0, _defineProperty2["default"])(_this, "onRadioChange", function (selectedKeys) {
|
|
190
187
|
var _ref4 = _this.props.callback || {},
|
|
191
188
|
onRadio = _ref4.onRadio;
|
|
192
189
|
onRadio && onRadio(selectedKeys);
|
|
193
190
|
});
|
|
194
|
-
(0, _defineProperty2["default"])(
|
|
191
|
+
(0, _defineProperty2["default"])(_this, "onRadioRowClick", function (record) {
|
|
195
192
|
var _ref5 = _this.props.callback || {},
|
|
196
193
|
onRadio = _ref5.onRadio;
|
|
197
194
|
onRadio && onRadio([record.key]);
|
|
198
195
|
});
|
|
199
|
-
(0, _defineProperty2["default"])(
|
|
196
|
+
(0, _defineProperty2["default"])(_this, "onRowClick", function (record) {
|
|
200
197
|
var _this$props2 = _this.props,
|
|
201
198
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
202
199
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -226,33 +223,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
226
223
|
}
|
|
227
224
|
}, 250);
|
|
228
225
|
});
|
|
229
|
-
(0, _defineProperty2["default"])(
|
|
226
|
+
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (record) {
|
|
230
227
|
clearTimeout(_this.timer);
|
|
231
228
|
var _ref7 = _this.props.callback || {},
|
|
232
229
|
onDoubleClick = _ref7.onDoubleClick;
|
|
233
230
|
onDoubleClick && onDoubleClick(record.key);
|
|
234
231
|
});
|
|
235
|
-
(0, _defineProperty2["default"])(
|
|
232
|
+
(0, _defineProperty2["default"])(_this, "onLink", function (key, index, item, e) {
|
|
236
233
|
var _ref8 = _this.props.callback || {},
|
|
237
234
|
onLink = _ref8.onLink;
|
|
238
235
|
onLink && onLink(key, index, item);
|
|
239
236
|
e.stopPropagation();
|
|
240
237
|
});
|
|
241
|
-
(0, _defineProperty2["default"])(
|
|
238
|
+
(0, _defineProperty2["default"])(_this, "onLinkDouble", function (e) {
|
|
242
239
|
e.stopPropagation();
|
|
243
240
|
});
|
|
244
|
-
(0, _defineProperty2["default"])(
|
|
241
|
+
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
245
242
|
var _ref9 = _this.props.callback || {},
|
|
246
243
|
onMoveRow = _ref9.onMoveRow;
|
|
247
244
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
248
245
|
});
|
|
249
|
-
(0, _defineProperty2["default"])(
|
|
246
|
+
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
250
247
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
251
248
|
item.checked && result.push(index);
|
|
252
249
|
return result;
|
|
253
250
|
}, []);
|
|
254
251
|
});
|
|
255
|
-
(0, _defineProperty2["default"])(
|
|
252
|
+
(0, _defineProperty2["default"])(_this, "getIndexInfo", function () {
|
|
256
253
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
257
254
|
var _this$props4 = _this.props,
|
|
258
255
|
_this$props4$index = _this$props4.index,
|
|
@@ -267,7 +264,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
267
264
|
}
|
|
268
265
|
}] : [];
|
|
269
266
|
});
|
|
270
|
-
(0, _defineProperty2["default"])(
|
|
267
|
+
(0, _defineProperty2["default"])(_this, "setSortInfo", function (col, sortInfo) {
|
|
271
268
|
if (col.sorter === 'string') {
|
|
272
269
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
273
270
|
col.sorter = function (row1, row2) {
|
|
@@ -290,13 +287,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
290
287
|
delete col.sorter;
|
|
291
288
|
}
|
|
292
289
|
});
|
|
293
|
-
(0, _defineProperty2["default"])(
|
|
290
|
+
(0, _defineProperty2["default"])(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
294
291
|
if ((0, _filter["default"])(col)) {
|
|
295
292
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
296
293
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
297
294
|
var onSearch = function onSearch(value) {
|
|
298
|
-
var
|
|
299
|
-
onTableChange =
|
|
295
|
+
var _ref0 = _this.props.callback || {},
|
|
296
|
+
onTableChange = _ref0.onTableChange;
|
|
300
297
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
301
298
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
302
299
|
var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
|
|
@@ -344,7 +341,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
344
341
|
}
|
|
345
342
|
delete col.filter;
|
|
346
343
|
});
|
|
347
|
-
(0, _defineProperty2["default"])(
|
|
344
|
+
(0, _defineProperty2["default"])(_this, "linkList", function (key, index, item) {
|
|
348
345
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
349
346
|
var list = item[key] || [];
|
|
350
347
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
@@ -358,7 +355,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
358
355
|
}, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
359
356
|
}));
|
|
360
357
|
});
|
|
361
|
-
(0, _defineProperty2["default"])(
|
|
358
|
+
(0, _defineProperty2["default"])(_this, "waring", function (key, index, item, warningKey) {
|
|
362
359
|
var text = item[key] ? item[key] : '';
|
|
363
360
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
364
361
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
|
|
@@ -367,7 +364,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
367
364
|
}
|
|
368
365
|
}, text.title ? text.title : text));
|
|
369
366
|
});
|
|
370
|
-
(0, _defineProperty2["default"])(
|
|
367
|
+
(0, _defineProperty2["default"])(_this, "defaultList", function (key, index, item, text, link) {
|
|
371
368
|
var _context4;
|
|
372
369
|
var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
373
370
|
if (link && typeof link === 'string') {
|
|
@@ -378,7 +375,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
378
375
|
}
|
|
379
376
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
|
|
380
377
|
});
|
|
381
|
-
(0, _defineProperty2["default"])(
|
|
378
|
+
(0, _defineProperty2["default"])(_this, "getColumns", function (cols, items) {
|
|
382
379
|
var _context5, _context6;
|
|
383
380
|
var _this$props5 = _this.props,
|
|
384
381
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -386,8 +383,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
386
383
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
387
384
|
return (0, _map["default"])(_context5 = (0, _concat["default"])(_context6 = _this.getIndexInfo(items)).call(_context6, (0, _filter["default"])(cols).call(cols, function (col) {
|
|
388
385
|
return !col.hide;
|
|
389
|
-
}))).call(_context5, function (
|
|
390
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
386
|
+
}))).call(_context5, function (_ref1) {
|
|
387
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref1), _ref1));
|
|
391
388
|
col.dataIndex = col.key;
|
|
392
389
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? (0, _variables["default"])('SuperTable')[col.align] : '';
|
|
393
390
|
col.noWrap && (col.className = (0, _variables["default"])('SuperTable').noWrap);
|
|
@@ -417,7 +414,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
417
414
|
return col;
|
|
418
415
|
});
|
|
419
416
|
});
|
|
420
|
-
(0, _defineProperty2["default"])(
|
|
417
|
+
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
421
418
|
if ((0, _isArray["default"])(value)) {
|
|
422
419
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
423
420
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -426,7 +423,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
426
423
|
return (0, _Control.getTitle)(value, options);
|
|
427
424
|
}
|
|
428
425
|
});
|
|
429
|
-
(0, _defineProperty2["default"])(
|
|
426
|
+
(0, _defineProperty2["default"])(_this, "link", function (key, index, item, text) {
|
|
430
427
|
var _context7;
|
|
431
428
|
var onClick = (0, _bind["default"])(_context7 = _this.onLink).call(_context7, null, key, index, item);
|
|
432
429
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -434,16 +431,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
434
431
|
onDoubleClick: _this.onLinkDouble
|
|
435
432
|
}, text);
|
|
436
433
|
});
|
|
437
|
-
(0, _defineProperty2["default"])(
|
|
438
|
-
var tipLen =
|
|
439
|
-
options =
|
|
434
|
+
(0, _defineProperty2["default"])(_this, "tooltip", function (key, index, item, _ref10) {
|
|
435
|
+
var tipLen = _ref10.tooltip,
|
|
436
|
+
options = _ref10.options;
|
|
440
437
|
var text = _this.getText(item[key], options);
|
|
441
438
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
442
439
|
return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
443
440
|
title: text
|
|
444
441
|
}, /*#__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);
|
|
445
442
|
});
|
|
446
|
-
(0, _defineProperty2["default"])(
|
|
443
|
+
(0, _defineProperty2["default"])(_this, "getImgSrc", function (value, options) {
|
|
447
444
|
var index = (0, _findIndex["default"])(options).call(options, function (obj) {
|
|
448
445
|
return obj.value == value;
|
|
449
446
|
});
|
|
@@ -456,7 +453,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
456
453
|
* @param options{array}:字段options
|
|
457
454
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
458
455
|
*/
|
|
459
|
-
(0, _defineProperty2["default"])(
|
|
456
|
+
(0, _defineProperty2["default"])(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
460
457
|
var value = {};
|
|
461
458
|
if (typeof dataSource === 'string') {
|
|
462
459
|
value = item[dataSource] || {};
|
|
@@ -476,14 +473,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
476
473
|
}
|
|
477
474
|
return _this.getText(value, options);
|
|
478
475
|
});
|
|
479
|
-
(0, _defineProperty2["default"])(
|
|
476
|
+
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
480
477
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
481
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
482
|
-
var key =
|
|
483
|
-
options =
|
|
484
|
-
link =
|
|
485
|
-
icon =
|
|
486
|
-
dataSource =
|
|
478
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref11) {
|
|
479
|
+
var key = _ref11.key,
|
|
480
|
+
options = _ref11.options,
|
|
481
|
+
link = _ref11.link,
|
|
482
|
+
icon = _ref11.icon,
|
|
483
|
+
dataSource = _ref11.dataSource;
|
|
487
484
|
if (link) {
|
|
488
485
|
if (typeof link === 'boolean') {
|
|
489
486
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -509,7 +506,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
509
506
|
});
|
|
510
507
|
});
|
|
511
508
|
});
|
|
512
|
-
(0, _defineProperty2["default"])(
|
|
509
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function (items) {
|
|
513
510
|
var _this$props6 = _this.props,
|
|
514
511
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
515
512
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -594,7 +591,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
594
591
|
};
|
|
595
592
|
}
|
|
596
593
|
});
|
|
597
|
-
(0, _defineProperty2["default"])(
|
|
594
|
+
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
598
595
|
return function (record) {
|
|
599
596
|
return {
|
|
600
597
|
onClick: function onClick() {
|
|
@@ -606,7 +603,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
606
603
|
};
|
|
607
604
|
};
|
|
608
605
|
});
|
|
609
|
-
(0, _defineProperty2["default"])(
|
|
606
|
+
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
610
607
|
return function (record, index) {
|
|
611
608
|
return {
|
|
612
609
|
index: index,
|
|
@@ -614,7 +611,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
614
611
|
};
|
|
615
612
|
};
|
|
616
613
|
});
|
|
617
|
-
(0, _defineProperty2["default"])(
|
|
614
|
+
(0, _defineProperty2["default"])(_this, "getItems", function () {
|
|
618
615
|
var _this$props7 = _this.props,
|
|
619
616
|
items = _this$props7.items,
|
|
620
617
|
cols = _this$props7.cols,
|
|
@@ -626,10 +623,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
626
623
|
var resItems = items;
|
|
627
624
|
if (!dragSort && items.length > 1) {
|
|
628
625
|
if (pageTotal || searchTotal) {
|
|
629
|
-
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result,
|
|
630
|
-
var key =
|
|
631
|
-
|
|
632
|
-
total =
|
|
626
|
+
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
|
|
627
|
+
var key = _ref12.key,
|
|
628
|
+
_ref12$total = _ref12.total,
|
|
629
|
+
total = _ref12$total === void 0 ? false : _ref12$total;
|
|
633
630
|
if (total) {
|
|
634
631
|
result[key] = (0, _parseFloat2["default"])(Number((0, _reduce["default"])(items).call(items, function (result, item) {
|
|
635
632
|
return (0, _parseFloat2["default"])(String(item[key] || 0)) + result;
|
|
@@ -651,7 +648,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
651
648
|
}
|
|
652
649
|
return resItems;
|
|
653
650
|
});
|
|
654
|
-
(0, _defineProperty2["default"])(
|
|
651
|
+
(0, _defineProperty2["default"])(_this, "toTotalFooter", function () {
|
|
655
652
|
var _this$props8 = _this.props,
|
|
656
653
|
cols = _this$props8.cols,
|
|
657
654
|
items = _this$props8.items,
|
|
@@ -667,11 +664,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
667
664
|
return item.checked;
|
|
668
665
|
});
|
|
669
666
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
670
|
-
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (
|
|
671
|
-
var title =
|
|
672
|
-
key =
|
|
673
|
-
|
|
674
|
-
props =
|
|
667
|
+
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref13) {
|
|
668
|
+
var title = _ref13.title,
|
|
669
|
+
key = _ref13.key,
|
|
670
|
+
_ref13$props = _ref13.props,
|
|
671
|
+
props = _ref13$props === void 0 ? {} : _ref13$props;
|
|
675
672
|
var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
|
|
676
673
|
return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
677
674
|
}, 0);
|
|
@@ -689,9 +686,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
689
686
|
style: {
|
|
690
687
|
marginRight: "15px"
|
|
691
688
|
}
|
|
692
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (
|
|
693
|
-
var title =
|
|
694
|
-
value =
|
|
689
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref14, index) {
|
|
690
|
+
var title = _ref14.title,
|
|
691
|
+
value = _ref14.value;
|
|
695
692
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
696
693
|
key: index,
|
|
697
694
|
style: {
|
|
@@ -707,7 +704,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
707
704
|
return null;
|
|
708
705
|
}
|
|
709
706
|
});
|
|
710
|
-
(0, _defineProperty2["default"])(
|
|
707
|
+
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
711
708
|
var _this$props9 = _this.props,
|
|
712
709
|
cols = _this$props9.cols,
|
|
713
710
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -743,13 +740,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
743
740
|
}, extraProps);
|
|
744
741
|
return renderProps;
|
|
745
742
|
});
|
|
746
|
-
(0, _defineProperty2["default"])(
|
|
747
|
-
var _this$
|
|
748
|
-
maxHeight = _this$
|
|
749
|
-
pageTotal = _this$
|
|
750
|
-
searchTotal = _this$
|
|
743
|
+
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
744
|
+
var _this$props0 = _this.props,
|
|
745
|
+
maxHeight = _this$props0.maxHeight,
|
|
746
|
+
pageTotal = _this$props0.pageTotal,
|
|
747
|
+
searchTotal = _this$props0.searchTotal;
|
|
751
748
|
if (maxHeight && _this.getItems().length) {
|
|
752
|
-
var root = _reactDom["default"].findDOMNode(
|
|
749
|
+
var root = _reactDom["default"].findDOMNode(_this);
|
|
753
750
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
754
751
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
755
752
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -764,7 +761,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
764
761
|
});
|
|
765
762
|
return _this;
|
|
766
763
|
}
|
|
767
|
-
(0,
|
|
764
|
+
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
765
|
+
return (0, _createClass2["default"])(SuperTable, [{
|
|
768
766
|
key: "shouldComponentUpdate",
|
|
769
767
|
value: function shouldComponentUpdate(props, state) {
|
|
770
768
|
var _this2 = this;
|
|
@@ -791,7 +789,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
791
789
|
}));
|
|
792
790
|
}
|
|
793
791
|
}]);
|
|
794
|
-
return SuperTable;
|
|
795
792
|
}(_react["default"].Component);
|
|
796
793
|
(0, _defineProperty2["default"])(SuperTable, "propTypes", {
|
|
797
794
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|