cloud-b2b 1.1.79 → 1.1.80
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 +10 -13
- 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 +107 -112
- 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/SuperTable2.less +3 -1
- 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 +12 -15
- package/es/SuperUpload/SuperUpload.js +38 -38
- 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 +10 -13
- 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 +108 -114
- 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/SuperTable2.less +3 -1
- 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 +12 -15
- package/lib/SuperUpload/SuperUpload.js +39 -40
- 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
|
@@ -39,10 +39,9 @@ var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
|
39
39
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
40
40
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
41
41
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
42
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
43
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
44
42
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
45
43
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
44
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
46
45
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
47
46
|
var _react = _interopRequireDefault(require("react"));
|
|
48
47
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -54,9 +53,9 @@ var _DragSortRow = _interopRequireDefault(require("./DragSortRow"));
|
|
|
54
53
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
55
54
|
var _excluded = ["onRowClick"];
|
|
56
55
|
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; }
|
|
57
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
58
|
-
function
|
|
59
|
-
function _isNativeReflectConstruct() {
|
|
56
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context0, _context1; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context0 = ownKeys(Object(t), !0)).call(_context0, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context1 = ownKeys(Object(t))).call(_context1, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
57
|
+
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)); }
|
|
58
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
60
59
|
/**
|
|
61
60
|
* sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
|
|
62
61
|
* filter: [可选],是否支持过滤,默认为false
|
|
@@ -119,8 +118,6 @@ var CallbackType = {
|
|
|
119
118
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
120
119
|
*/
|
|
121
120
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
122
|
-
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
123
|
-
var _super = _createSuper(SuperTable);
|
|
124
121
|
function SuperTable() {
|
|
125
122
|
var _context;
|
|
126
123
|
var _this;
|
|
@@ -128,18 +125,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
128
125
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
129
126
|
args[_key] = arguments[_key];
|
|
130
127
|
}
|
|
131
|
-
_this =
|
|
132
|
-
(0, _defineProperty2["default"])(
|
|
128
|
+
_this = _callSuper(this, SuperTable, (0, _concat["default"])(_context = []).call(_context, args));
|
|
129
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
133
130
|
filterVisibleKey: ''
|
|
134
131
|
});
|
|
135
|
-
(0, _defineProperty2["default"])(
|
|
132
|
+
(0, _defineProperty2["default"])(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
136
133
|
var _ref = _this.props.callback || {},
|
|
137
134
|
onTableChange = _ref.onTableChange;
|
|
138
135
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
139
136
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
140
137
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
141
138
|
});
|
|
142
|
-
(0, _defineProperty2["default"])(
|
|
139
|
+
(0, _defineProperty2["default"])(_this, "onChange", function () {
|
|
143
140
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
144
141
|
var _ref2 = _this.props.callback || {},
|
|
145
142
|
onCheck = _ref2.onCheck;
|
|
@@ -186,22 +183,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
186
183
|
}
|
|
187
184
|
}
|
|
188
185
|
});
|
|
189
|
-
(0, _defineProperty2["default"])(
|
|
186
|
+
(0, _defineProperty2["default"])(_this, "onCheckChange", function (selectedKeys) {
|
|
190
187
|
var _ref3 = _this.props.callback || {},
|
|
191
188
|
onCheck = _ref3.onCheck;
|
|
192
189
|
onCheck && onCheck(selectedKeys);
|
|
193
190
|
});
|
|
194
|
-
(0, _defineProperty2["default"])(
|
|
191
|
+
(0, _defineProperty2["default"])(_this, "onRadioChange", function (selectedKeys) {
|
|
195
192
|
var _ref4 = _this.props.callback || {},
|
|
196
193
|
onRadio = _ref4.onRadio;
|
|
197
194
|
onRadio && onRadio(selectedKeys);
|
|
198
195
|
});
|
|
199
|
-
(0, _defineProperty2["default"])(
|
|
196
|
+
(0, _defineProperty2["default"])(_this, "onRadioRowClick", function (record) {
|
|
200
197
|
var _ref5 = _this.props.callback || {},
|
|
201
198
|
onRadio = _ref5.onRadio;
|
|
202
199
|
onRadio && onRadio([record.key]);
|
|
203
200
|
});
|
|
204
|
-
(0, _defineProperty2["default"])(
|
|
201
|
+
(0, _defineProperty2["default"])(_this, "onRowClick", function (record) {
|
|
205
202
|
var _this$props2 = _this.props,
|
|
206
203
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
207
204
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -231,33 +228,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
231
228
|
}
|
|
232
229
|
}, 250);
|
|
233
230
|
});
|
|
234
|
-
(0, _defineProperty2["default"])(
|
|
231
|
+
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (record) {
|
|
235
232
|
clearTimeout(_this.timer);
|
|
236
233
|
var _ref7 = _this.props.callback || {},
|
|
237
234
|
onDoubleClick = _ref7.onDoubleClick;
|
|
238
235
|
onDoubleClick && onDoubleClick(record.key);
|
|
239
236
|
});
|
|
240
|
-
(0, _defineProperty2["default"])(
|
|
237
|
+
(0, _defineProperty2["default"])(_this, "onLink", function (key, index, item, e) {
|
|
241
238
|
var _ref8 = _this.props.callback || {},
|
|
242
239
|
onLink = _ref8.onLink;
|
|
243
240
|
onLink && onLink(key, index, item);
|
|
244
241
|
e.stopPropagation();
|
|
245
242
|
});
|
|
246
|
-
(0, _defineProperty2["default"])(
|
|
243
|
+
(0, _defineProperty2["default"])(_this, "onLinkDouble", function (e) {
|
|
247
244
|
e.stopPropagation();
|
|
248
245
|
});
|
|
249
|
-
(0, _defineProperty2["default"])(
|
|
246
|
+
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
250
247
|
var _ref9 = _this.props.callback || {},
|
|
251
248
|
onMoveRow = _ref9.onMoveRow;
|
|
252
249
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
253
250
|
});
|
|
254
|
-
(0, _defineProperty2["default"])(
|
|
251
|
+
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
255
252
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
256
253
|
item.checked && result.push(index);
|
|
257
254
|
return result;
|
|
258
255
|
}, []);
|
|
259
256
|
});
|
|
260
|
-
(0, _defineProperty2["default"])(
|
|
257
|
+
(0, _defineProperty2["default"])(_this, "getIndexInfo", function () {
|
|
261
258
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
262
259
|
var _this$props4 = _this.props,
|
|
263
260
|
_this$props4$index = _this$props4.index,
|
|
@@ -272,7 +269,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
272
269
|
}
|
|
273
270
|
}] : [];
|
|
274
271
|
});
|
|
275
|
-
(0, _defineProperty2["default"])(
|
|
272
|
+
(0, _defineProperty2["default"])(_this, "setSortInfo", function (col, sortInfo) {
|
|
276
273
|
if (col.sorter === 'string') {
|
|
277
274
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
278
275
|
col.sorter = function (row1, row2) {
|
|
@@ -295,13 +292,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
295
292
|
delete col.sorter;
|
|
296
293
|
}
|
|
297
294
|
});
|
|
298
|
-
(0, _defineProperty2["default"])(
|
|
295
|
+
(0, _defineProperty2["default"])(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
299
296
|
if ((0, _filter["default"])(col)) {
|
|
300
297
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
301
298
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
302
299
|
var onSearch = function onSearch(value) {
|
|
303
|
-
var
|
|
304
|
-
onTableChange =
|
|
300
|
+
var _ref0 = _this.props.callback || {},
|
|
301
|
+
onTableChange = _ref0.onTableChange;
|
|
305
302
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
306
303
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
307
304
|
var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
|
|
@@ -349,7 +346,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
349
346
|
}
|
|
350
347
|
delete col.filter;
|
|
351
348
|
});
|
|
352
|
-
(0, _defineProperty2["default"])(
|
|
349
|
+
(0, _defineProperty2["default"])(_this, "linkList", function (key, index, item) {
|
|
353
350
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
354
351
|
var list = item[key] || [];
|
|
355
352
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
@@ -363,7 +360,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
363
360
|
}, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
364
361
|
}));
|
|
365
362
|
});
|
|
366
|
-
(0, _defineProperty2["default"])(
|
|
363
|
+
(0, _defineProperty2["default"])(_this, "waring", function (key, index, item, warningKey) {
|
|
367
364
|
var text = item[key] ? item[key] : '';
|
|
368
365
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
369
366
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
|
|
@@ -372,7 +369,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
372
369
|
}
|
|
373
370
|
}, text.title ? text.title : text));
|
|
374
371
|
});
|
|
375
|
-
(0, _defineProperty2["default"])(
|
|
372
|
+
(0, _defineProperty2["default"])(_this, "defaultList", function (key, index, item, text, link) {
|
|
376
373
|
var _context4;
|
|
377
374
|
var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
378
375
|
if (link && typeof link === 'string') {
|
|
@@ -383,8 +380,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
383
380
|
}
|
|
384
381
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
|
|
385
382
|
});
|
|
386
|
-
(0, _defineProperty2["default"])(
|
|
387
|
-
var tags =
|
|
383
|
+
(0, _defineProperty2["default"])(_this, "tags", function (key, index, item, _ref1) {
|
|
384
|
+
var tags = _ref1.tags;
|
|
388
385
|
var list = item[key] || [];
|
|
389
386
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
390
387
|
var _context5;
|
|
@@ -419,7 +416,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
419
416
|
}, /*#__PURE__*/_react["default"].createElement(_tag["default"], tagProps, item2[tags])) : /*#__PURE__*/_react["default"].createElement(_tag["default"], tagProps, item2[tags]);
|
|
420
417
|
}));
|
|
421
418
|
});
|
|
422
|
-
(0, _defineProperty2["default"])(
|
|
419
|
+
(0, _defineProperty2["default"])(_this, "getColumns", function (cols, items) {
|
|
423
420
|
var _context6, _context7;
|
|
424
421
|
var _this$props5 = _this.props,
|
|
425
422
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -427,8 +424,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
427
424
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
428
425
|
return (0, _map["default"])(_context6 = (0, _concat["default"])(_context7 = _this.getIndexInfo(items)).call(_context7, (0, _filter["default"])(cols).call(cols, function (col) {
|
|
429
426
|
return !col.hide;
|
|
430
|
-
}))).call(_context6, function (
|
|
431
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
427
|
+
}))).call(_context6, function (_ref10) {
|
|
428
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref10), _ref10));
|
|
432
429
|
col.dataIndex = col.key;
|
|
433
430
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? (0, _variables["default"])('SuperTable')[col.align] : '';
|
|
434
431
|
col.noWrap && (col.className = (0, _variables["default"])('SuperTable').noWrap);
|
|
@@ -466,7 +463,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
466
463
|
return col;
|
|
467
464
|
});
|
|
468
465
|
});
|
|
469
|
-
(0, _defineProperty2["default"])(
|
|
466
|
+
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
470
467
|
if ((0, _isArray["default"])(value)) {
|
|
471
468
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
472
469
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -475,7 +472,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
475
472
|
return (0, _Control.getTitle)(value, options);
|
|
476
473
|
}
|
|
477
474
|
});
|
|
478
|
-
(0, _defineProperty2["default"])(
|
|
475
|
+
(0, _defineProperty2["default"])(_this, "link", function (key, index, item, text) {
|
|
479
476
|
var _context8;
|
|
480
477
|
var onClick = (0, _bind["default"])(_context8 = _this.onLink).call(_context8, null, key, index, item);
|
|
481
478
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -483,16 +480,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
483
480
|
onDoubleClick: _this.onLinkDouble
|
|
484
481
|
}, text);
|
|
485
482
|
});
|
|
486
|
-
(0, _defineProperty2["default"])(
|
|
487
|
-
var tipLen =
|
|
488
|
-
options =
|
|
483
|
+
(0, _defineProperty2["default"])(_this, "tooltip", function (key, index, item, _ref11) {
|
|
484
|
+
var tipLen = _ref11.tooltip,
|
|
485
|
+
options = _ref11.options;
|
|
489
486
|
var text = _this.getText(item[key], options);
|
|
490
487
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
491
488
|
return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
492
489
|
title: text
|
|
493
490
|
}, /*#__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);
|
|
494
491
|
});
|
|
495
|
-
(0, _defineProperty2["default"])(
|
|
492
|
+
(0, _defineProperty2["default"])(_this, "getImgSrc", function (value, options) {
|
|
496
493
|
var index = (0, _findIndex["default"])(options).call(options, function (obj) {
|
|
497
494
|
return obj.value == value;
|
|
498
495
|
});
|
|
@@ -505,7 +502,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
505
502
|
* @param options{array}:字段options
|
|
506
503
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
507
504
|
*/
|
|
508
|
-
(0, _defineProperty2["default"])(
|
|
505
|
+
(0, _defineProperty2["default"])(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
509
506
|
var value = {};
|
|
510
507
|
if (typeof dataSource === 'string') {
|
|
511
508
|
value = item[dataSource] || {};
|
|
@@ -525,14 +522,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
525
522
|
}
|
|
526
523
|
return _this.getText(value, options);
|
|
527
524
|
});
|
|
528
|
-
(0, _defineProperty2["default"])(
|
|
525
|
+
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
529
526
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
530
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
531
|
-
var key =
|
|
532
|
-
options =
|
|
533
|
-
link =
|
|
534
|
-
icon =
|
|
535
|
-
dataSource =
|
|
527
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
|
|
528
|
+
var key = _ref12.key,
|
|
529
|
+
options = _ref12.options,
|
|
530
|
+
link = _ref12.link,
|
|
531
|
+
icon = _ref12.icon,
|
|
532
|
+
dataSource = _ref12.dataSource;
|
|
536
533
|
if (link) {
|
|
537
534
|
if (typeof link === 'boolean') {
|
|
538
535
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -558,7 +555,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
558
555
|
});
|
|
559
556
|
});
|
|
560
557
|
});
|
|
561
|
-
(0, _defineProperty2["default"])(
|
|
558
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function (items) {
|
|
562
559
|
var _this$props6 = _this.props,
|
|
563
560
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
564
561
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -643,7 +640,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
643
640
|
};
|
|
644
641
|
}
|
|
645
642
|
});
|
|
646
|
-
(0, _defineProperty2["default"])(
|
|
643
|
+
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick, items) {
|
|
647
644
|
return function (record) {
|
|
648
645
|
var item = items[record.key];
|
|
649
646
|
var rowProps = {
|
|
@@ -660,7 +657,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
660
657
|
return rowProps;
|
|
661
658
|
};
|
|
662
659
|
});
|
|
663
|
-
(0, _defineProperty2["default"])(
|
|
660
|
+
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
664
661
|
return function (record, index) {
|
|
665
662
|
return {
|
|
666
663
|
index: index,
|
|
@@ -668,7 +665,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
668
665
|
};
|
|
669
666
|
};
|
|
670
667
|
});
|
|
671
|
-
(0, _defineProperty2["default"])(
|
|
668
|
+
(0, _defineProperty2["default"])(_this, "getItems", function () {
|
|
672
669
|
var _this$props7 = _this.props,
|
|
673
670
|
items = _this$props7.items,
|
|
674
671
|
cols = _this$props7.cols,
|
|
@@ -680,10 +677,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
680
677
|
var resItems = items;
|
|
681
678
|
if (!dragSort && items.length > 1) {
|
|
682
679
|
if (pageTotal || searchTotal) {
|
|
683
|
-
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result,
|
|
684
|
-
var key =
|
|
685
|
-
|
|
686
|
-
total =
|
|
680
|
+
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result, _ref13) {
|
|
681
|
+
var key = _ref13.key,
|
|
682
|
+
_ref13$total = _ref13.total,
|
|
683
|
+
total = _ref13$total === void 0 ? false : _ref13$total;
|
|
687
684
|
if (total) {
|
|
688
685
|
result[key] = (0, _parseFloat2["default"])(Number((0, _reduce["default"])(items).call(items, function (result, item) {
|
|
689
686
|
return (0, _parseFloat2["default"])(String(item[key] || 0)) + result;
|
|
@@ -705,7 +702,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
705
702
|
}
|
|
706
703
|
return resItems;
|
|
707
704
|
});
|
|
708
|
-
(0, _defineProperty2["default"])(
|
|
705
|
+
(0, _defineProperty2["default"])(_this, "toTotalFooter", function () {
|
|
709
706
|
var _this$props8 = _this.props,
|
|
710
707
|
cols = _this$props8.cols,
|
|
711
708
|
items = _this$props8.items,
|
|
@@ -721,11 +718,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
721
718
|
return item.checked;
|
|
722
719
|
});
|
|
723
720
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
724
|
-
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (
|
|
725
|
-
var title =
|
|
726
|
-
key =
|
|
727
|
-
|
|
728
|
-
props =
|
|
721
|
+
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref14) {
|
|
722
|
+
var title = _ref14.title,
|
|
723
|
+
key = _ref14.key,
|
|
724
|
+
_ref14$props = _ref14.props,
|
|
725
|
+
props = _ref14$props === void 0 ? {} : _ref14$props;
|
|
729
726
|
var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
|
|
730
727
|
return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
731
728
|
}, 0);
|
|
@@ -743,9 +740,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
743
740
|
style: {
|
|
744
741
|
marginRight: "15px"
|
|
745
742
|
}
|
|
746
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (
|
|
747
|
-
var title =
|
|
748
|
-
value =
|
|
743
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref15, index) {
|
|
744
|
+
var title = _ref15.title,
|
|
745
|
+
value = _ref15.value;
|
|
749
746
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
750
747
|
key: index,
|
|
751
748
|
style: {
|
|
@@ -761,7 +758,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
761
758
|
return null;
|
|
762
759
|
}
|
|
763
760
|
});
|
|
764
|
-
(0, _defineProperty2["default"])(
|
|
761
|
+
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
765
762
|
var _this$props9 = _this.props,
|
|
766
763
|
cols = _this$props9.cols,
|
|
767
764
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -797,13 +794,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
797
794
|
}, extraProps);
|
|
798
795
|
return renderProps;
|
|
799
796
|
});
|
|
800
|
-
(0, _defineProperty2["default"])(
|
|
801
|
-
var _this$
|
|
802
|
-
maxHeight = _this$
|
|
803
|
-
pageTotal = _this$
|
|
804
|
-
searchTotal = _this$
|
|
797
|
+
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
798
|
+
var _this$props0 = _this.props,
|
|
799
|
+
maxHeight = _this$props0.maxHeight,
|
|
800
|
+
pageTotal = _this$props0.pageTotal,
|
|
801
|
+
searchTotal = _this$props0.searchTotal;
|
|
805
802
|
if (maxHeight && _this.getItems().length) {
|
|
806
|
-
var root = _reactDom["default"].findDOMNode(
|
|
803
|
+
var root = _reactDom["default"].findDOMNode(_this);
|
|
807
804
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
808
805
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
809
806
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -818,7 +815,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
818
815
|
});
|
|
819
816
|
return _this;
|
|
820
817
|
}
|
|
821
|
-
(0,
|
|
818
|
+
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
819
|
+
return (0, _createClass2["default"])(SuperTable, [{
|
|
822
820
|
key: "shouldComponentUpdate",
|
|
823
821
|
value: function shouldComponentUpdate(props, state) {
|
|
824
822
|
var _this2 = this;
|
|
@@ -845,7 +843,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
845
843
|
}));
|
|
846
844
|
}
|
|
847
845
|
}]);
|
|
848
|
-
return SuperTable;
|
|
849
846
|
}(_react["default"].Component);
|
|
850
847
|
(0, _defineProperty2["default"])(SuperTable, "propTypes", {
|
|
851
848
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|