cloud-b2b 1.1.70 → 1.1.71
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 +11 -14
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +20 -23
- 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/Search2/Search.js +83 -86
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- 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 +101 -103
- 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 +70 -73
- package/es/SuperTable2/SuperTable2.js +89 -92
- package/es/SuperTable2/SuperTableCell.js +27 -30
- 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 +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +20 -23
- 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/Search2/Search.js +84 -88
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- 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 +102 -105
- 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 +70 -73
- package/lib/SuperTable2/SuperTable2.js +90 -94
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- 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
|
@@ -15,14 +15,13 @@ import _Icon from "antd/es/icon";
|
|
|
15
15
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
16
16
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
17
17
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
18
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
19
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
20
18
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
21
19
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
20
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
22
21
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
23
22
|
var _excluded = ["onRowClick"];
|
|
24
23
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context0, _context1; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context0 = ownKeys(Object(t), !0)).call(_context0, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context1 = ownKeys(Object(t))).call(_context1, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
25
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
27
26
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
28
27
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -38,8 +37,8 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
38
37
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
39
38
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
40
39
|
import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
|
|
41
|
-
function
|
|
42
|
-
function _isNativeReflectConstruct() {
|
|
40
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
41
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
43
42
|
import React from 'react';
|
|
44
43
|
import PropTypes from 'prop-types';
|
|
45
44
|
import ReactDOM from 'react-dom';
|
|
@@ -109,8 +108,6 @@ var CallbackType = {
|
|
|
109
108
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
110
109
|
*/
|
|
111
110
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
112
|
-
_inherits(SuperTable, _React$Component);
|
|
113
|
-
var _super = _createSuper(SuperTable);
|
|
114
111
|
function SuperTable() {
|
|
115
112
|
var _context;
|
|
116
113
|
var _this;
|
|
@@ -118,18 +115,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
118
115
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
119
116
|
args[_key] = arguments[_key];
|
|
120
117
|
}
|
|
121
|
-
_this =
|
|
122
|
-
_defineProperty(
|
|
118
|
+
_this = _callSuper(this, SuperTable, _concatInstanceProperty(_context = []).call(_context, args));
|
|
119
|
+
_defineProperty(_this, "state", {
|
|
123
120
|
filterVisibleKey: ''
|
|
124
121
|
});
|
|
125
|
-
_defineProperty(
|
|
122
|
+
_defineProperty(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
126
123
|
var _ref = _this.props.callback || {},
|
|
127
124
|
onTableChange = _ref.onTableChange;
|
|
128
125
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
129
126
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
130
127
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
131
128
|
});
|
|
132
|
-
_defineProperty(
|
|
129
|
+
_defineProperty(_this, "onChange", function () {
|
|
133
130
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
134
131
|
var _ref2 = _this.props.callback || {},
|
|
135
132
|
onCheck = _ref2.onCheck;
|
|
@@ -176,22 +173,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
176
173
|
}
|
|
177
174
|
}
|
|
178
175
|
});
|
|
179
|
-
_defineProperty(
|
|
176
|
+
_defineProperty(_this, "onCheckChange", function (selectedKeys) {
|
|
180
177
|
var _ref3 = _this.props.callback || {},
|
|
181
178
|
onCheck = _ref3.onCheck;
|
|
182
179
|
onCheck && onCheck(selectedKeys);
|
|
183
180
|
});
|
|
184
|
-
_defineProperty(
|
|
181
|
+
_defineProperty(_this, "onRadioChange", function (selectedKeys) {
|
|
185
182
|
var _ref4 = _this.props.callback || {},
|
|
186
183
|
onRadio = _ref4.onRadio;
|
|
187
184
|
onRadio && onRadio(selectedKeys);
|
|
188
185
|
});
|
|
189
|
-
_defineProperty(
|
|
186
|
+
_defineProperty(_this, "onRadioRowClick", function (record) {
|
|
190
187
|
var _ref5 = _this.props.callback || {},
|
|
191
188
|
onRadio = _ref5.onRadio;
|
|
192
189
|
onRadio && onRadio([record.key]);
|
|
193
190
|
});
|
|
194
|
-
_defineProperty(
|
|
191
|
+
_defineProperty(_this, "onRowClick", function (record) {
|
|
195
192
|
var _this$props2 = _this.props,
|
|
196
193
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
197
194
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -221,33 +218,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
221
218
|
}
|
|
222
219
|
}, 250);
|
|
223
220
|
});
|
|
224
|
-
_defineProperty(
|
|
221
|
+
_defineProperty(_this, "onDoubleClick", function (record) {
|
|
225
222
|
clearTimeout(_this.timer);
|
|
226
223
|
var _ref7 = _this.props.callback || {},
|
|
227
224
|
onDoubleClick = _ref7.onDoubleClick;
|
|
228
225
|
onDoubleClick && onDoubleClick(record.key);
|
|
229
226
|
});
|
|
230
|
-
_defineProperty(
|
|
227
|
+
_defineProperty(_this, "onLink", function (key, index, item, e) {
|
|
231
228
|
var _ref8 = _this.props.callback || {},
|
|
232
229
|
onLink = _ref8.onLink;
|
|
233
230
|
onLink && onLink(key, index, item);
|
|
234
231
|
e.stopPropagation();
|
|
235
232
|
});
|
|
236
|
-
_defineProperty(
|
|
233
|
+
_defineProperty(_this, "onLinkDouble", function (e) {
|
|
237
234
|
e.stopPropagation();
|
|
238
235
|
});
|
|
239
|
-
_defineProperty(
|
|
236
|
+
_defineProperty(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
240
237
|
var _ref9 = _this.props.callback || {},
|
|
241
238
|
onMoveRow = _ref9.onMoveRow;
|
|
242
239
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
243
240
|
});
|
|
244
|
-
_defineProperty(
|
|
241
|
+
_defineProperty(_this, "getSelectedRowKeys", function (items) {
|
|
245
242
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
246
243
|
item.checked && result.push(index);
|
|
247
244
|
return result;
|
|
248
245
|
}, []);
|
|
249
246
|
});
|
|
250
|
-
_defineProperty(
|
|
247
|
+
_defineProperty(_this, "getIndexInfo", function () {
|
|
251
248
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
252
249
|
var _this$props4 = _this.props,
|
|
253
250
|
_this$props4$index = _this$props4.index,
|
|
@@ -262,7 +259,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
262
259
|
}
|
|
263
260
|
}] : [];
|
|
264
261
|
});
|
|
265
|
-
_defineProperty(
|
|
262
|
+
_defineProperty(_this, "setSortInfo", function (col, sortInfo) {
|
|
266
263
|
if (col.sorter === 'string') {
|
|
267
264
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
268
265
|
col.sorter = function (row1, row2) {
|
|
@@ -285,13 +282,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
285
282
|
delete col.sorter;
|
|
286
283
|
}
|
|
287
284
|
});
|
|
288
|
-
_defineProperty(
|
|
285
|
+
_defineProperty(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
289
286
|
if (_filterInstanceProperty(col)) {
|
|
290
287
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
291
288
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
292
289
|
var onSearch = function onSearch(value) {
|
|
293
|
-
var
|
|
294
|
-
onTableChange =
|
|
290
|
+
var _ref0 = _this.props.callback || {},
|
|
291
|
+
onTableChange = _ref0.onTableChange;
|
|
295
292
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
296
293
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
297
294
|
var newFilterInfo = _Object$assign({}, filterInfo, _defineProperty({}, col.key, value));
|
|
@@ -339,7 +336,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
339
336
|
}
|
|
340
337
|
delete col.filter;
|
|
341
338
|
});
|
|
342
|
-
_defineProperty(
|
|
339
|
+
_defineProperty(_this, "linkList", function (key, index, item) {
|
|
343
340
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
344
341
|
var list = item[key] || [];
|
|
345
342
|
return /*#__PURE__*/React.createElement("div", null, _mapInstanceProperty(list).call(list, function (item2, index2) {
|
|
@@ -353,7 +350,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
353
350
|
}, _concatInstanceProperty(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
354
351
|
}));
|
|
355
352
|
});
|
|
356
|
-
_defineProperty(
|
|
353
|
+
_defineProperty(_this, "waring", function (key, index, item, warningKey) {
|
|
357
354
|
var text = item[key] ? item[key] : '';
|
|
358
355
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
359
356
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
|
|
@@ -362,7 +359,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
362
359
|
}
|
|
363
360
|
}, text.title ? text.title : text));
|
|
364
361
|
});
|
|
365
|
-
_defineProperty(
|
|
362
|
+
_defineProperty(_this, "defaultList", function (key, index, item, text, link) {
|
|
366
363
|
var _context4;
|
|
367
364
|
var onClick = _bindInstanceProperty(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
368
365
|
if (link && typeof link === 'string') {
|
|
@@ -373,8 +370,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
373
370
|
}
|
|
374
371
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, text));
|
|
375
372
|
});
|
|
376
|
-
_defineProperty(
|
|
377
|
-
var tags =
|
|
373
|
+
_defineProperty(_this, "tags", function (key, index, item, _ref1) {
|
|
374
|
+
var tags = _ref1.tags;
|
|
378
375
|
var list = item[key] || [];
|
|
379
376
|
return /*#__PURE__*/React.createElement("div", null, _mapInstanceProperty(list).call(list, function (item2, index2) {
|
|
380
377
|
var _context5;
|
|
@@ -409,7 +406,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
409
406
|
}, /*#__PURE__*/React.createElement(_Tag, tagProps, item2[tags])) : /*#__PURE__*/React.createElement(_Tag, tagProps, item2[tags]);
|
|
410
407
|
}));
|
|
411
408
|
});
|
|
412
|
-
_defineProperty(
|
|
409
|
+
_defineProperty(_this, "getColumns", function (cols, items) {
|
|
413
410
|
var _context6, _context7;
|
|
414
411
|
var _this$props5 = _this.props,
|
|
415
412
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -417,8 +414,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
417
414
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
418
415
|
return _mapInstanceProperty(_context6 = _concatInstanceProperty(_context7 = _this.getIndexInfo(items)).call(_context7, _filterInstanceProperty(cols).call(cols, function (col) {
|
|
419
416
|
return !col.hide;
|
|
420
|
-
}))).call(_context6, function (
|
|
421
|
-
var col = _extends({}, (_objectDestructuringEmpty(
|
|
417
|
+
}))).call(_context6, function (_ref10) {
|
|
418
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref10), _ref10));
|
|
422
419
|
col.dataIndex = col.key;
|
|
423
420
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? variables('SuperTable')[col.align] : '';
|
|
424
421
|
col.noWrap && (col.className = variables('SuperTable').noWrap);
|
|
@@ -452,7 +449,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
452
449
|
return col;
|
|
453
450
|
});
|
|
454
451
|
});
|
|
455
|
-
_defineProperty(
|
|
452
|
+
_defineProperty(_this, "getText", function (value, options) {
|
|
456
453
|
if (_Array$isArray(value)) {
|
|
457
454
|
return _mapInstanceProperty(value).call(value, function (v) {
|
|
458
455
|
return getTitle(v, options);
|
|
@@ -461,7 +458,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
461
458
|
return getTitle(value, options);
|
|
462
459
|
}
|
|
463
460
|
});
|
|
464
|
-
_defineProperty(
|
|
461
|
+
_defineProperty(_this, "link", function (key, index, item, text) {
|
|
465
462
|
var _context8;
|
|
466
463
|
var onClick = _bindInstanceProperty(_context8 = _this.onLink).call(_context8, null, key, index, item);
|
|
467
464
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -469,16 +466,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
469
466
|
onDoubleClick: _this.onLinkDouble
|
|
470
467
|
}, text);
|
|
471
468
|
});
|
|
472
|
-
_defineProperty(
|
|
473
|
-
var tipLen =
|
|
474
|
-
options =
|
|
469
|
+
_defineProperty(_this, "tooltip", function (key, index, item, _ref11) {
|
|
470
|
+
var tipLen = _ref11.tooltip,
|
|
471
|
+
options = _ref11.options;
|
|
475
472
|
var text = _this.getText(item[key], options);
|
|
476
473
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
477
474
|
return needTip ? /*#__PURE__*/React.createElement(_Tooltip, {
|
|
478
475
|
title: text
|
|
479
476
|
}, /*#__PURE__*/React.createElement("span", null, _sliceInstanceProperty(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/React.createElement("span", null, _Array$isArray(text) ? text.join(',') : text);
|
|
480
477
|
});
|
|
481
|
-
_defineProperty(
|
|
478
|
+
_defineProperty(_this, "getImgSrc", function (value, options) {
|
|
482
479
|
var index = _findIndexInstanceProperty(options).call(options, function (obj) {
|
|
483
480
|
return obj.value == value;
|
|
484
481
|
});
|
|
@@ -491,7 +488,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
491
488
|
* @param options{array}:字段options
|
|
492
489
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
493
490
|
*/
|
|
494
|
-
_defineProperty(
|
|
491
|
+
_defineProperty(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
495
492
|
var value = {};
|
|
496
493
|
if (typeof dataSource === 'string') {
|
|
497
494
|
value = item[dataSource] || {};
|
|
@@ -511,14 +508,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
511
508
|
}
|
|
512
509
|
return _this.getText(value, options);
|
|
513
510
|
});
|
|
514
|
-
_defineProperty(
|
|
511
|
+
_defineProperty(_this, "getDataSource", function (items, cols) {
|
|
515
512
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
516
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
517
|
-
var key =
|
|
518
|
-
options =
|
|
519
|
-
link =
|
|
520
|
-
icon =
|
|
521
|
-
dataSource =
|
|
513
|
+
return _reduceInstanceProperty(cols).call(cols, function (result, _ref12) {
|
|
514
|
+
var key = _ref12.key,
|
|
515
|
+
options = _ref12.options,
|
|
516
|
+
link = _ref12.link,
|
|
517
|
+
icon = _ref12.icon,
|
|
518
|
+
dataSource = _ref12.dataSource;
|
|
522
519
|
if (link) {
|
|
523
520
|
if (typeof link === 'boolean') {
|
|
524
521
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -544,7 +541,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
544
541
|
});
|
|
545
542
|
});
|
|
546
543
|
});
|
|
547
|
-
_defineProperty(
|
|
544
|
+
_defineProperty(_this, "getPropsByCheckbox", function (items) {
|
|
548
545
|
var _this$props6 = _this.props,
|
|
549
546
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
550
547
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -629,7 +626,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
629
626
|
};
|
|
630
627
|
}
|
|
631
628
|
});
|
|
632
|
-
_defineProperty(
|
|
629
|
+
_defineProperty(_this, "getRowProps", function (onRowClick, items) {
|
|
633
630
|
return function (record) {
|
|
634
631
|
var item = items[record.key];
|
|
635
632
|
var rowProps = {
|
|
@@ -646,7 +643,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
646
643
|
return rowProps;
|
|
647
644
|
};
|
|
648
645
|
});
|
|
649
|
-
_defineProperty(
|
|
646
|
+
_defineProperty(_this, "getRowPropsForDrag", function () {
|
|
650
647
|
return function (record, index) {
|
|
651
648
|
return {
|
|
652
649
|
index: index,
|
|
@@ -654,7 +651,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
654
651
|
};
|
|
655
652
|
};
|
|
656
653
|
});
|
|
657
|
-
_defineProperty(
|
|
654
|
+
_defineProperty(_this, "getItems", function () {
|
|
658
655
|
var _this$props7 = _this.props,
|
|
659
656
|
items = _this$props7.items,
|
|
660
657
|
cols = _this$props7.cols,
|
|
@@ -666,10 +663,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
666
663
|
var resItems = items;
|
|
667
664
|
if (!dragSort && items.length > 1) {
|
|
668
665
|
if (pageTotal || searchTotal) {
|
|
669
|
-
var totalItem = _reduceInstanceProperty(cols).call(cols, function (result,
|
|
670
|
-
var key =
|
|
671
|
-
|
|
672
|
-
total =
|
|
666
|
+
var totalItem = _reduceInstanceProperty(cols).call(cols, function (result, _ref13) {
|
|
667
|
+
var key = _ref13.key,
|
|
668
|
+
_ref13$total = _ref13.total,
|
|
669
|
+
total = _ref13$total === void 0 ? false : _ref13$total;
|
|
673
670
|
if (total) {
|
|
674
671
|
result[key] = _parseFloat(Number(_reduceInstanceProperty(items).call(items, function (result, item) {
|
|
675
672
|
return _parseFloat(String(item[key] || 0)) + result;
|
|
@@ -691,7 +688,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
691
688
|
}
|
|
692
689
|
return resItems;
|
|
693
690
|
});
|
|
694
|
-
_defineProperty(
|
|
691
|
+
_defineProperty(_this, "toTotalFooter", function () {
|
|
695
692
|
var _this$props8 = _this.props,
|
|
696
693
|
cols = _this$props8.cols,
|
|
697
694
|
items = _this$props8.items,
|
|
@@ -707,11 +704,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
707
704
|
return item.checked;
|
|
708
705
|
});
|
|
709
706
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
710
|
-
var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (
|
|
711
|
-
var title =
|
|
712
|
-
key =
|
|
713
|
-
|
|
714
|
-
props =
|
|
707
|
+
var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (_ref14) {
|
|
708
|
+
var title = _ref14.title,
|
|
709
|
+
key = _ref14.key,
|
|
710
|
+
_ref14$props = _ref14.props,
|
|
711
|
+
props = _ref14$props === void 0 ? {} : _ref14$props;
|
|
715
712
|
var value = _reduceInstanceProperty(countItems).call(countItems, function (result, item) {
|
|
716
713
|
return _parseFloat((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
717
714
|
}, 0);
|
|
@@ -729,9 +726,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
729
726
|
style: {
|
|
730
727
|
marginRight: "15px"
|
|
731
728
|
}
|
|
732
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (
|
|
733
|
-
var title =
|
|
734
|
-
value =
|
|
729
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (_ref15, index) {
|
|
730
|
+
var title = _ref15.title,
|
|
731
|
+
value = _ref15.value;
|
|
735
732
|
return /*#__PURE__*/React.createElement("span", {
|
|
736
733
|
key: index,
|
|
737
734
|
style: {
|
|
@@ -747,7 +744,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
747
744
|
return null;
|
|
748
745
|
}
|
|
749
746
|
});
|
|
750
|
-
_defineProperty(
|
|
747
|
+
_defineProperty(_this, "getProps", function () {
|
|
751
748
|
var _this$props9 = _this.props,
|
|
752
749
|
cols = _this$props9.cols,
|
|
753
750
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -783,13 +780,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
783
780
|
}, extraProps);
|
|
784
781
|
return renderProps;
|
|
785
782
|
});
|
|
786
|
-
_defineProperty(
|
|
787
|
-
var _this$
|
|
788
|
-
maxHeight = _this$
|
|
789
|
-
pageTotal = _this$
|
|
790
|
-
searchTotal = _this$
|
|
783
|
+
_defineProperty(_this, "setScroll", function () {
|
|
784
|
+
var _this$props0 = _this.props,
|
|
785
|
+
maxHeight = _this$props0.maxHeight,
|
|
786
|
+
pageTotal = _this$props0.pageTotal,
|
|
787
|
+
searchTotal = _this$props0.searchTotal;
|
|
791
788
|
if (maxHeight && _this.getItems().length) {
|
|
792
|
-
var root = ReactDOM.findDOMNode(
|
|
789
|
+
var root = ReactDOM.findDOMNode(_this);
|
|
793
790
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
794
791
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
795
792
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -804,7 +801,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
804
801
|
});
|
|
805
802
|
return _this;
|
|
806
803
|
}
|
|
807
|
-
|
|
804
|
+
_inherits(SuperTable, _React$Component);
|
|
805
|
+
return _createClass(SuperTable, [{
|
|
808
806
|
key: "shouldComponentUpdate",
|
|
809
807
|
value: function shouldComponentUpdate(props, state) {
|
|
810
808
|
var _this2 = this;
|
|
@@ -831,7 +829,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
831
829
|
}));
|
|
832
830
|
}
|
|
833
831
|
}]);
|
|
834
|
-
return SuperTable;
|
|
835
832
|
}(React.Component);
|
|
836
833
|
_defineProperty(SuperTable, "propTypes", {
|
|
837
834
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|