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
|
@@ -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
|
|
@@ -117,8 +116,6 @@ var CallbackType = {
|
|
|
117
116
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
118
117
|
*/
|
|
119
118
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
120
|
-
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
121
|
-
var _super = _createSuper(SuperTable);
|
|
122
119
|
function SuperTable() {
|
|
123
120
|
var _context;
|
|
124
121
|
var _this;
|
|
@@ -126,18 +123,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
126
123
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
127
124
|
args[_key] = arguments[_key];
|
|
128
125
|
}
|
|
129
|
-
_this =
|
|
130
|
-
(0, _defineProperty2["default"])(
|
|
126
|
+
_this = _callSuper(this, SuperTable, (0, _concat["default"])(_context = []).call(_context, args));
|
|
127
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
131
128
|
filterVisibleKey: ''
|
|
132
129
|
});
|
|
133
|
-
(0, _defineProperty2["default"])(
|
|
130
|
+
(0, _defineProperty2["default"])(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
134
131
|
var _ref = _this.props.callback || {},
|
|
135
132
|
onTableChange = _ref.onTableChange;
|
|
136
133
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
137
134
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
138
135
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
139
136
|
});
|
|
140
|
-
(0, _defineProperty2["default"])(
|
|
137
|
+
(0, _defineProperty2["default"])(_this, "onChange", function () {
|
|
141
138
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
142
139
|
var _ref2 = _this.props.callback || {},
|
|
143
140
|
onCheck = _ref2.onCheck;
|
|
@@ -184,22 +181,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
184
181
|
}
|
|
185
182
|
}
|
|
186
183
|
});
|
|
187
|
-
(0, _defineProperty2["default"])(
|
|
184
|
+
(0, _defineProperty2["default"])(_this, "onCheckChange", function (selectedKeys) {
|
|
188
185
|
var _ref3 = _this.props.callback || {},
|
|
189
186
|
onCheck = _ref3.onCheck;
|
|
190
187
|
onCheck && onCheck(selectedKeys);
|
|
191
188
|
});
|
|
192
|
-
(0, _defineProperty2["default"])(
|
|
189
|
+
(0, _defineProperty2["default"])(_this, "onRadioChange", function (selectedKeys) {
|
|
193
190
|
var _ref4 = _this.props.callback || {},
|
|
194
191
|
onRadio = _ref4.onRadio;
|
|
195
192
|
onRadio && onRadio(selectedKeys);
|
|
196
193
|
});
|
|
197
|
-
(0, _defineProperty2["default"])(
|
|
194
|
+
(0, _defineProperty2["default"])(_this, "onRadioRowClick", function (record) {
|
|
198
195
|
var _ref5 = _this.props.callback || {},
|
|
199
196
|
onRadio = _ref5.onRadio;
|
|
200
197
|
onRadio && onRadio([record.key]);
|
|
201
198
|
});
|
|
202
|
-
(0, _defineProperty2["default"])(
|
|
199
|
+
(0, _defineProperty2["default"])(_this, "onRowClick", function (record) {
|
|
203
200
|
var _this$props2 = _this.props,
|
|
204
201
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
205
202
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -229,33 +226,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
229
226
|
}
|
|
230
227
|
}, 250);
|
|
231
228
|
});
|
|
232
|
-
(0, _defineProperty2["default"])(
|
|
229
|
+
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (record) {
|
|
233
230
|
clearTimeout(_this.timer);
|
|
234
231
|
var _ref7 = _this.props.callback || {},
|
|
235
232
|
onDoubleClick = _ref7.onDoubleClick;
|
|
236
233
|
onDoubleClick && onDoubleClick(record.key);
|
|
237
234
|
});
|
|
238
|
-
(0, _defineProperty2["default"])(
|
|
235
|
+
(0, _defineProperty2["default"])(_this, "onLink", function (key, index, item, e) {
|
|
239
236
|
var _ref8 = _this.props.callback || {},
|
|
240
237
|
onLink = _ref8.onLink;
|
|
241
238
|
onLink && onLink(key, index, item);
|
|
242
239
|
e.stopPropagation();
|
|
243
240
|
});
|
|
244
|
-
(0, _defineProperty2["default"])(
|
|
241
|
+
(0, _defineProperty2["default"])(_this, "onLinkDouble", function (e) {
|
|
245
242
|
e.stopPropagation();
|
|
246
243
|
});
|
|
247
|
-
(0, _defineProperty2["default"])(
|
|
244
|
+
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
248
245
|
var _ref9 = _this.props.callback || {},
|
|
249
246
|
onMoveRow = _ref9.onMoveRow;
|
|
250
247
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
251
248
|
});
|
|
252
|
-
(0, _defineProperty2["default"])(
|
|
249
|
+
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
253
250
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
254
251
|
item.checked && result.push(index);
|
|
255
252
|
return result;
|
|
256
253
|
}, []);
|
|
257
254
|
});
|
|
258
|
-
(0, _defineProperty2["default"])(
|
|
255
|
+
(0, _defineProperty2["default"])(_this, "getIndexInfo", function () {
|
|
259
256
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
260
257
|
var _this$props4 = _this.props,
|
|
261
258
|
_this$props4$index = _this$props4.index,
|
|
@@ -270,7 +267,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
270
267
|
}
|
|
271
268
|
}] : [];
|
|
272
269
|
});
|
|
273
|
-
(0, _defineProperty2["default"])(
|
|
270
|
+
(0, _defineProperty2["default"])(_this, "setSortInfo", function (col, sortInfo) {
|
|
274
271
|
if (col.sorter === 'string') {
|
|
275
272
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
276
273
|
col.sorter = function (row1, row2) {
|
|
@@ -293,13 +290,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
293
290
|
delete col.sorter;
|
|
294
291
|
}
|
|
295
292
|
});
|
|
296
|
-
(0, _defineProperty2["default"])(
|
|
293
|
+
(0, _defineProperty2["default"])(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
297
294
|
if ((0, _filter["default"])(col)) {
|
|
298
295
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
299
296
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
300
297
|
var onSearch = function onSearch(value) {
|
|
301
|
-
var
|
|
302
|
-
onTableChange =
|
|
298
|
+
var _ref0 = _this.props.callback || {},
|
|
299
|
+
onTableChange = _ref0.onTableChange;
|
|
303
300
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
304
301
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
305
302
|
var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
|
|
@@ -347,7 +344,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
347
344
|
}
|
|
348
345
|
delete col.filter;
|
|
349
346
|
});
|
|
350
|
-
(0, _defineProperty2["default"])(
|
|
347
|
+
(0, _defineProperty2["default"])(_this, "linkList", function (key, index, item) {
|
|
351
348
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
352
349
|
var list = item[key] || [];
|
|
353
350
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
@@ -361,7 +358,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
361
358
|
}, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
362
359
|
}));
|
|
363
360
|
});
|
|
364
|
-
(0, _defineProperty2["default"])(
|
|
361
|
+
(0, _defineProperty2["default"])(_this, "waring", function (key, index, item, warningKey) {
|
|
365
362
|
var text = item[key] ? item[key] : '';
|
|
366
363
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
367
364
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
|
|
@@ -370,7 +367,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
370
367
|
}
|
|
371
368
|
}, text.title ? text.title : text));
|
|
372
369
|
});
|
|
373
|
-
(0, _defineProperty2["default"])(
|
|
370
|
+
(0, _defineProperty2["default"])(_this, "defaultList", function (key, index, item, text, link) {
|
|
374
371
|
var _context4;
|
|
375
372
|
var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
376
373
|
if (link && typeof link === 'string') {
|
|
@@ -381,8 +378,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
381
378
|
}
|
|
382
379
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
|
|
383
380
|
});
|
|
384
|
-
(0, _defineProperty2["default"])(
|
|
385
|
-
var tags =
|
|
381
|
+
(0, _defineProperty2["default"])(_this, "tags", function (key, index, item, _ref1) {
|
|
382
|
+
var tags = _ref1.tags;
|
|
386
383
|
var list = item[key] || [];
|
|
387
384
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
388
385
|
var _context5;
|
|
@@ -417,7 +414,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
417
414
|
}, /*#__PURE__*/_react["default"].createElement(_tag["default"], tagProps, item2[tags])) : /*#__PURE__*/_react["default"].createElement(_tag["default"], tagProps, item2[tags]);
|
|
418
415
|
}));
|
|
419
416
|
});
|
|
420
|
-
(0, _defineProperty2["default"])(
|
|
417
|
+
(0, _defineProperty2["default"])(_this, "getColumns", function (cols, items) {
|
|
421
418
|
var _context6, _context7;
|
|
422
419
|
var _this$props5 = _this.props,
|
|
423
420
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -425,8 +422,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
425
422
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
426
423
|
return (0, _map["default"])(_context6 = (0, _concat["default"])(_context7 = _this.getIndexInfo(items)).call(_context7, (0, _filter["default"])(cols).call(cols, function (col) {
|
|
427
424
|
return !col.hide;
|
|
428
|
-
}))).call(_context6, function (
|
|
429
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
425
|
+
}))).call(_context6, function (_ref10) {
|
|
426
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref10), _ref10));
|
|
430
427
|
col.dataIndex = col.key;
|
|
431
428
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? (0, _variables["default"])('SuperTable')[col.align] : '';
|
|
432
429
|
col.noWrap && (col.className = (0, _variables["default"])('SuperTable').noWrap);
|
|
@@ -460,7 +457,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
460
457
|
return col;
|
|
461
458
|
});
|
|
462
459
|
});
|
|
463
|
-
(0, _defineProperty2["default"])(
|
|
460
|
+
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
464
461
|
if ((0, _isArray["default"])(value)) {
|
|
465
462
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
466
463
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -469,7 +466,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
469
466
|
return (0, _Control.getTitle)(value, options);
|
|
470
467
|
}
|
|
471
468
|
});
|
|
472
|
-
(0, _defineProperty2["default"])(
|
|
469
|
+
(0, _defineProperty2["default"])(_this, "link", function (key, index, item, text) {
|
|
473
470
|
var _context8;
|
|
474
471
|
var onClick = (0, _bind["default"])(_context8 = _this.onLink).call(_context8, null, key, index, item);
|
|
475
472
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -477,16 +474,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
477
474
|
onDoubleClick: _this.onLinkDouble
|
|
478
475
|
}, text);
|
|
479
476
|
});
|
|
480
|
-
(0, _defineProperty2["default"])(
|
|
481
|
-
var tipLen =
|
|
482
|
-
options =
|
|
477
|
+
(0, _defineProperty2["default"])(_this, "tooltip", function (key, index, item, _ref11) {
|
|
478
|
+
var tipLen = _ref11.tooltip,
|
|
479
|
+
options = _ref11.options;
|
|
483
480
|
var text = _this.getText(item[key], options);
|
|
484
481
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
485
482
|
return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
486
483
|
title: text
|
|
487
484
|
}, /*#__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);
|
|
488
485
|
});
|
|
489
|
-
(0, _defineProperty2["default"])(
|
|
486
|
+
(0, _defineProperty2["default"])(_this, "getImgSrc", function (value, options) {
|
|
490
487
|
var index = (0, _findIndex["default"])(options).call(options, function (obj) {
|
|
491
488
|
return obj.value == value;
|
|
492
489
|
});
|
|
@@ -499,7 +496,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
499
496
|
* @param options{array}:字段options
|
|
500
497
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
501
498
|
*/
|
|
502
|
-
(0, _defineProperty2["default"])(
|
|
499
|
+
(0, _defineProperty2["default"])(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
503
500
|
var value = {};
|
|
504
501
|
if (typeof dataSource === 'string') {
|
|
505
502
|
value = item[dataSource] || {};
|
|
@@ -519,14 +516,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
519
516
|
}
|
|
520
517
|
return _this.getText(value, options);
|
|
521
518
|
});
|
|
522
|
-
(0, _defineProperty2["default"])(
|
|
519
|
+
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
523
520
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
524
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
525
|
-
var key =
|
|
526
|
-
options =
|
|
527
|
-
link =
|
|
528
|
-
icon =
|
|
529
|
-
dataSource =
|
|
521
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
|
|
522
|
+
var key = _ref12.key,
|
|
523
|
+
options = _ref12.options,
|
|
524
|
+
link = _ref12.link,
|
|
525
|
+
icon = _ref12.icon,
|
|
526
|
+
dataSource = _ref12.dataSource;
|
|
530
527
|
if (link) {
|
|
531
528
|
if (typeof link === 'boolean') {
|
|
532
529
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -552,7 +549,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
552
549
|
});
|
|
553
550
|
});
|
|
554
551
|
});
|
|
555
|
-
(0, _defineProperty2["default"])(
|
|
552
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function (items) {
|
|
556
553
|
var _this$props6 = _this.props,
|
|
557
554
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
558
555
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -637,7 +634,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
637
634
|
};
|
|
638
635
|
}
|
|
639
636
|
});
|
|
640
|
-
(0, _defineProperty2["default"])(
|
|
637
|
+
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick, items) {
|
|
641
638
|
return function (record) {
|
|
642
639
|
var item = items[record.key];
|
|
643
640
|
var rowProps = {
|
|
@@ -654,7 +651,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
654
651
|
return rowProps;
|
|
655
652
|
};
|
|
656
653
|
});
|
|
657
|
-
(0, _defineProperty2["default"])(
|
|
654
|
+
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
658
655
|
return function (record, index) {
|
|
659
656
|
return {
|
|
660
657
|
index: index,
|
|
@@ -662,7 +659,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
662
659
|
};
|
|
663
660
|
};
|
|
664
661
|
});
|
|
665
|
-
(0, _defineProperty2["default"])(
|
|
662
|
+
(0, _defineProperty2["default"])(_this, "getItems", function () {
|
|
666
663
|
var _this$props7 = _this.props,
|
|
667
664
|
items = _this$props7.items,
|
|
668
665
|
cols = _this$props7.cols,
|
|
@@ -674,10 +671,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
674
671
|
var resItems = items;
|
|
675
672
|
if (!dragSort && items.length > 1) {
|
|
676
673
|
if (pageTotal || searchTotal) {
|
|
677
|
-
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result,
|
|
678
|
-
var key =
|
|
679
|
-
|
|
680
|
-
total =
|
|
674
|
+
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result, _ref13) {
|
|
675
|
+
var key = _ref13.key,
|
|
676
|
+
_ref13$total = _ref13.total,
|
|
677
|
+
total = _ref13$total === void 0 ? false : _ref13$total;
|
|
681
678
|
if (total) {
|
|
682
679
|
result[key] = (0, _parseFloat2["default"])(Number((0, _reduce["default"])(items).call(items, function (result, item) {
|
|
683
680
|
return (0, _parseFloat2["default"])(String(item[key] || 0)) + result;
|
|
@@ -699,7 +696,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
699
696
|
}
|
|
700
697
|
return resItems;
|
|
701
698
|
});
|
|
702
|
-
(0, _defineProperty2["default"])(
|
|
699
|
+
(0, _defineProperty2["default"])(_this, "toTotalFooter", function () {
|
|
703
700
|
var _this$props8 = _this.props,
|
|
704
701
|
cols = _this$props8.cols,
|
|
705
702
|
items = _this$props8.items,
|
|
@@ -715,11 +712,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
715
712
|
return item.checked;
|
|
716
713
|
});
|
|
717
714
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
718
|
-
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (
|
|
719
|
-
var title =
|
|
720
|
-
key =
|
|
721
|
-
|
|
722
|
-
props =
|
|
715
|
+
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref14) {
|
|
716
|
+
var title = _ref14.title,
|
|
717
|
+
key = _ref14.key,
|
|
718
|
+
_ref14$props = _ref14.props,
|
|
719
|
+
props = _ref14$props === void 0 ? {} : _ref14$props;
|
|
723
720
|
var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
|
|
724
721
|
return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
725
722
|
}, 0);
|
|
@@ -737,9 +734,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
737
734
|
style: {
|
|
738
735
|
marginRight: "15px"
|
|
739
736
|
}
|
|
740
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (
|
|
741
|
-
var title =
|
|
742
|
-
value =
|
|
737
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref15, index) {
|
|
738
|
+
var title = _ref15.title,
|
|
739
|
+
value = _ref15.value;
|
|
743
740
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
744
741
|
key: index,
|
|
745
742
|
style: {
|
|
@@ -755,7 +752,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
755
752
|
return null;
|
|
756
753
|
}
|
|
757
754
|
});
|
|
758
|
-
(0, _defineProperty2["default"])(
|
|
755
|
+
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
759
756
|
var _this$props9 = _this.props,
|
|
760
757
|
cols = _this$props9.cols,
|
|
761
758
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -791,13 +788,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
791
788
|
}, extraProps);
|
|
792
789
|
return renderProps;
|
|
793
790
|
});
|
|
794
|
-
(0, _defineProperty2["default"])(
|
|
795
|
-
var _this$
|
|
796
|
-
maxHeight = _this$
|
|
797
|
-
pageTotal = _this$
|
|
798
|
-
searchTotal = _this$
|
|
791
|
+
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
792
|
+
var _this$props0 = _this.props,
|
|
793
|
+
maxHeight = _this$props0.maxHeight,
|
|
794
|
+
pageTotal = _this$props0.pageTotal,
|
|
795
|
+
searchTotal = _this$props0.searchTotal;
|
|
799
796
|
if (maxHeight && _this.getItems().length) {
|
|
800
|
-
var root = _reactDom["default"].findDOMNode(
|
|
797
|
+
var root = _reactDom["default"].findDOMNode(_this);
|
|
801
798
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
802
799
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
803
800
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -812,7 +809,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
812
809
|
});
|
|
813
810
|
return _this;
|
|
814
811
|
}
|
|
815
|
-
(0,
|
|
812
|
+
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
813
|
+
return (0, _createClass2["default"])(SuperTable, [{
|
|
816
814
|
key: "shouldComponentUpdate",
|
|
817
815
|
value: function shouldComponentUpdate(props, state) {
|
|
818
816
|
var _this2 = this;
|
|
@@ -839,7 +837,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
839
837
|
}));
|
|
840
838
|
}
|
|
841
839
|
}]);
|
|
842
|
-
return SuperTable;
|
|
843
840
|
}(_react["default"].Component);
|
|
844
841
|
(0, _defineProperty2["default"])(SuperTable, "propTypes", {
|
|
845
842
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|