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