cloud-b2b 1.1.26 → 1.1.28
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 +16 -45
- package/es/Card/Card.js +3 -4
- package/es/CodeInput/CodeInput.js +30 -59
- package/es/Control/Control.js +47 -94
- package/es/Control/event.js +0 -14
- package/es/Enhance/Dialogs.js +0 -15
- package/es/Enhance/Loading.js +16 -36
- package/es/Enhance/index.js +0 -2
- package/es/Header/Header.js +3 -35
- package/es/Header/Vertical.js +1 -24
- package/es/ImageView/ImageView.js +5 -22
- package/es/Indent/Indent.js +3 -7
- package/es/InpurCascader/InputCascader.js +10 -36
- package/es/InputEditor/InputEditor.js +55 -55
- package/es/InputSearch/InputSearch.js +26 -71
- package/es/InputSelect/InputSelect.js +17 -48
- package/es/InputWriting/InputWriting.js +6 -28
- package/es/Layout/Layout.js +28 -59
- package/es/LayoutLink/LayoutLink.js +11 -20
- package/es/Link/Link.js +4 -27
- package/es/Loading/Loading.js +1 -3
- package/es/Loading2/Loading2.js +0 -2
- package/es/ModalWithDrag/ModalWithDrag.js +3 -8
- package/es/ModalWithDrag/drag.js +12 -29
- package/es/NumberInput/NumberInput.js +24 -63
- package/es/Search/Search.js +53 -149
- package/es/Sidebar/Sidebar.js +13 -34
- package/es/Sidebar2/Sidebar.js +3 -30
- package/es/SuperForm/SuperForm.js +27 -150
- package/es/SuperForm2/SuperForm.js +31 -165
- package/es/SuperIcon/SuperIcon.js +3 -6
- package/es/SuperPagination/SuperPagination.js +15 -32
- package/es/SuperTab/SuperTab.js +4 -27
- package/es/SuperTab2/SuperTab2.js +11 -33
- package/es/SuperTable/DragSortRow.js +6 -34
- package/es/SuperTable/FilterDropDown.js +10 -34
- package/es/SuperTable/SuperTable.js +91 -216
- package/es/SuperTable/fixed.js +1 -9
- package/es/SuperTable2/SuperTable2.js +104 -206
- package/es/SuperTable2/SuperTableCell.js +16 -55
- package/es/SuperTable3/FilterDropDown.js +10 -34
- package/es/SuperTable3/SuperTable.js +57 -175
- package/es/SuperTable3/fixed.js +1 -9
- package/es/SuperToolbar/SuperToolbar.js +21 -49
- package/es/SuperUpload/SuperUpload.js +73 -110
- package/es/Title/Title.js +12 -15
- package/es/Viewer/ImageViews.js +7 -60
- package/es/Viewer/Viewer.js +7 -34
- package/es/WingBlank/WingBlank.js +2 -6
- package/es/helper.js +36 -23
- package/es/history.js +3 -2
- package/lib/Area/Area.js +16 -64
- package/lib/Card/Card.js +3 -13
- package/lib/CodeInput/CodeInput.js +30 -77
- package/lib/Control/Control.js +47 -135
- package/lib/Control/event.js +0 -16
- package/lib/Enhance/Dialogs.js +0 -26
- package/lib/Enhance/Loading.js +16 -52
- package/lib/Enhance/index.js +0 -9
- package/lib/Header/Header.js +3 -48
- package/lib/Header/Vertical.js +1 -36
- package/lib/ImageView/ImageView.js +5 -30
- package/lib/Indent/Indent.js +3 -13
- package/lib/InpurCascader/InputCascader.js +11 -50
- package/lib/InputEditor/InputEditor.js +55 -64
- package/lib/InputSearch/InputSearch.js +26 -78
- package/lib/InputSelect/InputSelect.js +17 -62
- package/lib/InputWriting/InputWriting.js +6 -35
- package/lib/Layout/Layout.js +28 -76
- package/lib/LayoutLink/LayoutLink.js +11 -38
- package/lib/Link/Link.js +4 -40
- package/lib/Loading/Loading.js +1 -9
- package/lib/Loading2/Loading2.js +0 -8
- package/lib/ModalWithDrag/ModalWithDrag.js +3 -18
- package/lib/ModalWithDrag/drag.js +12 -34
- package/lib/NumberInput/NumberInput.js +24 -76
- package/lib/Search/Search.js +53 -157
- package/lib/Sidebar/Sidebar.js +13 -46
- package/lib/Sidebar2/Sidebar.js +3 -42
- package/lib/SuperForm/SuperForm.js +27 -149
- package/lib/SuperForm2/SuperForm.js +31 -160
- package/lib/SuperIcon/SuperIcon.js +3 -14
- package/lib/SuperPagination/SuperPagination.js +15 -42
- package/lib/SuperTab/SuperTab.js +4 -34
- package/lib/SuperTab2/SuperTab2.js +11 -48
- package/lib/SuperTable/DragSortRow.js +6 -42
- package/lib/SuperTable/FilterDropDown.js +10 -42
- package/lib/SuperTable/SuperTable.js +90 -210
- package/lib/SuperTable/fixed.js +1 -13
- package/lib/SuperTable2/SuperTable2.js +104 -222
- package/lib/SuperTable2/SuperTableCell.js +13 -62
- package/lib/SuperTable3/FilterDropDown.js +10 -42
- package/lib/SuperTable3/SuperTable.js +56 -169
- package/lib/SuperTable3/fixed.js +1 -13
- package/lib/SuperToolbar/SuperToolbar.js +20 -64
- package/lib/SuperUpload/SuperUpload.js +73 -140
- package/lib/Title/Title.js +12 -24
- package/lib/Viewer/ImageViews.js +7 -63
- package/lib/Viewer/Viewer.js +7 -43
- package/lib/WingBlank/WingBlank.js +2 -14
- package/lib/helper.js +36 -37
- package/lib/history.js +0 -5
- package/lib/index.js +0 -76
- package/lib/variables.js +0 -4
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
8
8
|
import _Table from "antd/es/table";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
10
10
|
import _Tooltip from "antd/es/tooltip";
|
|
11
|
+
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/objectDestructuringEmpty";
|
|
11
12
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
12
13
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
13
14
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
@@ -17,11 +18,8 @@ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleC
|
|
|
17
18
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
18
19
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
19
20
|
var _excluded = ["onRowClick"];
|
|
20
|
-
|
|
21
21
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
|
|
23
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context9, _context10; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context9 = ownKeys(Object(source), !0)).call(_context9, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context10 = ownKeys(Object(source))).call(_context10, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
|
|
25
23
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
26
24
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
27
25
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -37,11 +35,8 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
37
35
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
38
36
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
39
37
|
import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
|
|
40
|
-
|
|
41
38
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
42
|
-
|
|
43
39
|
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; } }
|
|
44
|
-
|
|
45
40
|
import React from 'react';
|
|
46
41
|
import PropTypes from 'prop-types';
|
|
47
42
|
import ReactDOM from 'react-dom';
|
|
@@ -50,6 +45,7 @@ import FilterDropDown from './FilterDropDown';
|
|
|
50
45
|
import fixed from './fixed';
|
|
51
46
|
import DragSortRow from './DragSortRow';
|
|
52
47
|
import variables from '../variables';
|
|
48
|
+
|
|
53
49
|
/**
|
|
54
50
|
* sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
|
|
55
51
|
* filter: [可选],是否支持过滤,默认为false
|
|
@@ -58,7 +54,6 @@ import variables from '../variables';
|
|
|
58
54
|
* isDateFilterByStartAndEnd: [可选],为true时做过滤操作会显示时间段搜索,默认为false
|
|
59
55
|
*
|
|
60
56
|
*/
|
|
61
|
-
|
|
62
57
|
var ColType = {
|
|
63
58
|
key: PropTypes.string.isRequired,
|
|
64
59
|
title: PropTypes.string,
|
|
@@ -75,6 +70,7 @@ var ColType = {
|
|
|
75
70
|
var ItemType = {
|
|
76
71
|
checked: PropTypes.bool
|
|
77
72
|
};
|
|
73
|
+
|
|
78
74
|
/**
|
|
79
75
|
* onCheck:点击复选框时触发,原型func(isAll, checked, rowIndex);isolation为true时,原型为onCheck(checkedRows)
|
|
80
76
|
* onRadio: 点击单选按钮时触发,原型为func(checkedRows)
|
|
@@ -83,7 +79,6 @@ var ItemType = {
|
|
|
83
79
|
* onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
|
|
84
80
|
* onMoveRow:行拖曳排序时触发,原型为func(dragIndex, targetIndex)
|
|
85
81
|
*/
|
|
86
|
-
|
|
87
82
|
var CallbackType = {
|
|
88
83
|
onCheck: PropTypes.func,
|
|
89
84
|
onRadio: PropTypes.func,
|
|
@@ -92,6 +87,7 @@ var CallbackType = {
|
|
|
92
87
|
onTableChange: PropTypes.func,
|
|
93
88
|
onMoveRow: PropTypes.func
|
|
94
89
|
};
|
|
90
|
+
|
|
95
91
|
/**
|
|
96
92
|
* checkbox: [可选],是否有复选框,默认为true
|
|
97
93
|
* isPaging: [可选],是否分页,默认为false
|
|
@@ -109,52 +105,39 @@ var CallbackType = {
|
|
|
109
105
|
* pageTotal: [可选], 为true表示开启表格末行自动汇总表格列数据,默认为false || searchTotal,当开启时,需要汇总的列需设置属性total为true,当dragSort为true时,该选项失效
|
|
110
106
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
111
107
|
*/
|
|
112
|
-
|
|
113
108
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
114
109
|
_inherits(SuperTable, _React$Component);
|
|
115
|
-
|
|
116
110
|
var _super = _createSuper(SuperTable);
|
|
117
|
-
|
|
118
111
|
function SuperTable() {
|
|
119
112
|
var _context;
|
|
120
|
-
|
|
121
113
|
var _this;
|
|
122
|
-
|
|
123
114
|
_classCallCheck(this, SuperTable);
|
|
124
|
-
|
|
125
115
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
126
116
|
args[_key] = arguments[_key];
|
|
127
117
|
}
|
|
128
|
-
|
|
129
118
|
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
130
|
-
|
|
131
119
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
132
120
|
filterVisibleKey: ''
|
|
133
121
|
});
|
|
134
|
-
|
|
135
122
|
_defineProperty(_assertThisInitialized(_this), "onTableChange", function (pagination, filters, sorter) {
|
|
136
123
|
var _ref = _this.props.callback || {},
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
onTableChange = _ref.onTableChange;
|
|
139
125
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
140
|
-
|
|
126
|
+
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
141
127
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
142
128
|
});
|
|
143
|
-
|
|
144
129
|
_defineProperty(_assertThisInitialized(_this), "onChange", function () {
|
|
145
130
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
146
|
-
|
|
147
131
|
var _ref2 = _this.props.callback || {},
|
|
148
|
-
|
|
149
|
-
|
|
132
|
+
onCheck = _ref2.onCheck;
|
|
150
133
|
if (onCheck) {
|
|
151
134
|
var _this$props = _this.props,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
135
|
+
_this$props$items = _this$props.items,
|
|
136
|
+
items = _this$props$items === void 0 ? [] : _this$props$items,
|
|
137
|
+
_this$props$isWeaken = _this$props.isWeaken,
|
|
138
|
+
isWeaken = _this$props$isWeaken === void 0 ? false : _this$props$isWeaken,
|
|
139
|
+
pageTotal = _this$props.pageTotal,
|
|
140
|
+
searchTotal = _this$props.searchTotal;
|
|
158
141
|
var offset = 0;
|
|
159
142
|
pageTotal && offset--;
|
|
160
143
|
searchTotal && offset--;
|
|
@@ -165,23 +148,19 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
165
148
|
var newItems = isWeaken ? _filterInstanceProperty(items).call(items, function (o) {
|
|
166
149
|
return !o.__isWeaken;
|
|
167
150
|
}) : items;
|
|
168
|
-
|
|
169
151
|
if (selectedKeys.length === 0) {
|
|
170
152
|
onCheck(true, false, -1);
|
|
171
153
|
} else if (selectedKeys.length === newItems.length) {
|
|
172
154
|
var checked = _everyInstanceProperty(newItems).call(newItems, function (o) {
|
|
173
155
|
return o.checked;
|
|
174
156
|
});
|
|
175
|
-
|
|
176
157
|
onCheck(true, !checked, -1);
|
|
177
158
|
} else {
|
|
178
159
|
var defaultSelectedKeys = _this.getSelectedRowKeys(newItems);
|
|
179
|
-
|
|
180
160
|
if (selectedKeys.length > defaultSelectedKeys.length) {
|
|
181
161
|
if (_this.props.isPaging && selectedKeys.length - defaultSelectedKeys.length > 1) {
|
|
182
162
|
return onCheck(true, true, -1);
|
|
183
163
|
}
|
|
184
|
-
|
|
185
164
|
onCheck(false, true, selectedKeys[selectedKeys.length - 1]);
|
|
186
165
|
} else {
|
|
187
166
|
var index = _findIndexInstanceProperty(defaultSelectedKeys).call(defaultSelectedKeys, function (key) {
|
|
@@ -189,51 +168,41 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
189
168
|
return select === key;
|
|
190
169
|
});
|
|
191
170
|
});
|
|
192
|
-
|
|
193
171
|
onCheck(false, false, defaultSelectedKeys[index]);
|
|
194
172
|
}
|
|
195
173
|
}
|
|
196
174
|
}
|
|
197
175
|
});
|
|
198
|
-
|
|
199
176
|
_defineProperty(_assertThisInitialized(_this), "onCheckChange", function (selectedKeys) {
|
|
200
177
|
var _ref3 = _this.props.callback || {},
|
|
201
|
-
|
|
202
|
-
|
|
178
|
+
onCheck = _ref3.onCheck;
|
|
203
179
|
onCheck && onCheck(selectedKeys);
|
|
204
180
|
});
|
|
205
|
-
|
|
206
181
|
_defineProperty(_assertThisInitialized(_this), "onRadioChange", function (selectedKeys) {
|
|
207
182
|
var _ref4 = _this.props.callback || {},
|
|
208
|
-
|
|
209
|
-
|
|
183
|
+
onRadio = _ref4.onRadio;
|
|
210
184
|
onRadio && onRadio(selectedKeys);
|
|
211
185
|
});
|
|
212
|
-
|
|
213
186
|
_defineProperty(_assertThisInitialized(_this), "onRadioRowClick", function (record) {
|
|
214
187
|
var _ref5 = _this.props.callback || {},
|
|
215
|
-
|
|
216
|
-
|
|
188
|
+
onRadio = _ref5.onRadio;
|
|
217
189
|
onRadio && onRadio([record.key]);
|
|
218
190
|
});
|
|
219
|
-
|
|
220
191
|
_defineProperty(_assertThisInitialized(_this), "onRowClick", function (record) {
|
|
221
192
|
var _this$props2 = _this.props,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
193
|
+
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
194
|
+
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
195
|
+
items = _this$props2.items;
|
|
225
196
|
if (items.length <= record.key) return;
|
|
226
197
|
clearTimeout(_this.timer);
|
|
227
198
|
_this.timer = _setTimeout(function () {
|
|
228
199
|
var _ref6 = _this.props.callback || {},
|
|
229
|
-
|
|
230
|
-
|
|
200
|
+
onCheck = _ref6.onCheck;
|
|
231
201
|
if (onCheck) {
|
|
232
202
|
var _this$props3 = _this.props,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
203
|
+
isolation = _this$props3.isolation,
|
|
204
|
+
_this$props3$checkedR = _this$props3.checkedRows,
|
|
205
|
+
checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR;
|
|
237
206
|
if (isolation) {
|
|
238
207
|
if (_includesInstanceProperty(checkedRows).call(checkedRows, record.key)) {
|
|
239
208
|
onCheck(_filterInstanceProperty(checkedRows).call(checkedRows, function (key) {
|
|
@@ -249,49 +218,39 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
249
218
|
}
|
|
250
219
|
}, 250);
|
|
251
220
|
});
|
|
252
|
-
|
|
253
221
|
_defineProperty(_assertThisInitialized(_this), "onDoubleClick", function (record) {
|
|
254
222
|
clearTimeout(_this.timer);
|
|
255
|
-
|
|
256
223
|
var _ref7 = _this.props.callback || {},
|
|
257
|
-
|
|
258
|
-
|
|
224
|
+
onDoubleClick = _ref7.onDoubleClick;
|
|
259
225
|
onDoubleClick && onDoubleClick(record.key);
|
|
260
226
|
});
|
|
261
|
-
|
|
262
227
|
_defineProperty(_assertThisInitialized(_this), "onLink", function (key, index, item, e) {
|
|
263
228
|
var _ref8 = _this.props.callback || {},
|
|
264
|
-
|
|
265
|
-
|
|
229
|
+
onLink = _ref8.onLink;
|
|
266
230
|
onLink && onLink(key, index, item);
|
|
267
231
|
e.stopPropagation();
|
|
268
232
|
});
|
|
269
|
-
|
|
270
233
|
_defineProperty(_assertThisInitialized(_this), "onLinkDouble", function (e) {
|
|
271
234
|
e.stopPropagation();
|
|
272
235
|
});
|
|
273
|
-
|
|
274
236
|
_defineProperty(_assertThisInitialized(_this), "onMoveRow", function (dragIndex, targetIndex) {
|
|
275
237
|
var _ref9 = _this.props.callback || {},
|
|
276
|
-
|
|
277
|
-
|
|
238
|
+
onMoveRow = _ref9.onMoveRow;
|
|
278
239
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
279
240
|
});
|
|
280
|
-
|
|
281
241
|
_defineProperty(_assertThisInitialized(_this), "getSelectedRowKeys", function (items) {
|
|
282
242
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
283
243
|
item.checked && result.push(index);
|
|
284
244
|
return result;
|
|
285
245
|
}, []);
|
|
286
246
|
});
|
|
287
|
-
|
|
288
247
|
_defineProperty(_assertThisInitialized(_this), "getIndexInfo", function () {
|
|
289
248
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
290
249
|
var _this$props4 = _this.props,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
250
|
+
_this$props4$index = _this$props4.index,
|
|
251
|
+
index = _this$props4$index === void 0 ? true : _this$props4$index,
|
|
252
|
+
_this$props4$indexTit = _this$props4.indexTitle,
|
|
253
|
+
indexTitle = _this$props4$indexTit === void 0 ? '序号' : _this$props4$indexTit;
|
|
295
254
|
return index ? [{
|
|
296
255
|
key: 'index',
|
|
297
256
|
title: indexTitle,
|
|
@@ -300,15 +259,12 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
300
259
|
}
|
|
301
260
|
}] : [];
|
|
302
261
|
});
|
|
303
|
-
|
|
304
262
|
_defineProperty(_assertThisInitialized(_this), "setSortInfo", function (col, sortInfo) {
|
|
305
263
|
if (col.sorter === 'string') {
|
|
306
264
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
307
|
-
|
|
308
265
|
col.sorter = function (row1, row2) {
|
|
309
266
|
var a = !col.link ? row1[col.key] : row1[col.key].props.children;
|
|
310
267
|
var b = !col.link ? row2[col.key] : row2[col.key].props.children;
|
|
311
|
-
|
|
312
268
|
if (a > b) {
|
|
313
269
|
return 1;
|
|
314
270
|
} else if (a === b) {
|
|
@@ -319,7 +275,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
319
275
|
};
|
|
320
276
|
} else if (col.sorter === 'number') {
|
|
321
277
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
322
|
-
|
|
323
278
|
col.sorter = function (a, b) {
|
|
324
279
|
return a[col.key] - b[col.key];
|
|
325
280
|
};
|
|
@@ -327,45 +282,35 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
327
282
|
delete col.sorter;
|
|
328
283
|
}
|
|
329
284
|
});
|
|
330
|
-
|
|
331
285
|
_defineProperty(_assertThisInitialized(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
332
286
|
if (_filterInstanceProperty(col)) {
|
|
333
287
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
334
|
-
|
|
335
|
-
|
|
288
|
+
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
336
289
|
var onSearch = function onSearch(value) {
|
|
337
290
|
var _ref10 = _this.props.callback || {},
|
|
338
|
-
|
|
339
|
-
|
|
291
|
+
onTableChange = _ref10.onTableChange;
|
|
340
292
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
341
|
-
|
|
342
|
-
|
|
293
|
+
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
343
294
|
var newFilterInfo = _Object$assign({}, filterInfo, _defineProperty({}, col.key, value));
|
|
344
|
-
|
|
345
295
|
_this.setState({
|
|
346
296
|
filterVisibleKey: ''
|
|
347
297
|
});
|
|
348
|
-
|
|
349
298
|
onTableChange && onTableChange(sortInfo, newFilterInfo);
|
|
350
299
|
};
|
|
351
|
-
|
|
352
300
|
var value = filterInfo[col.key];
|
|
353
301
|
col.filteredValue = value ? [value] : null;
|
|
354
302
|
col.filterDropdownVisible = visibleKey === col.key;
|
|
355
|
-
|
|
356
303
|
var onClose = function onClose() {
|
|
357
304
|
_this.setState({
|
|
358
305
|
filterVisibleKey: ''
|
|
359
306
|
});
|
|
360
307
|
};
|
|
361
|
-
|
|
362
308
|
col.filterDropdown = /*#__PURE__*/React.createElement(FilterDropDown, {
|
|
363
309
|
value: value,
|
|
364
310
|
onSearch: onSearch,
|
|
365
311
|
onClose: onClose,
|
|
366
312
|
isDateFilterByStartAndEnd: isDateFilterByStartAndEnd
|
|
367
313
|
});
|
|
368
|
-
|
|
369
314
|
col.onFilterDropdownVisibleChange = function (visible) {
|
|
370
315
|
if (isDateFilterByStartAndEnd) {
|
|
371
316
|
visible && _this.setState({
|
|
@@ -377,13 +322,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
377
322
|
});
|
|
378
323
|
}
|
|
379
324
|
};
|
|
380
|
-
|
|
381
325
|
col.onFilter = function (value, record) {
|
|
382
326
|
var items = _this.getItems();
|
|
383
|
-
|
|
384
327
|
if (items[record.key].__total) return true;
|
|
385
328
|
var content = !col.link ? record[col.key] : record[col.key].props.children;
|
|
386
|
-
|
|
387
329
|
if (!col.isDateFilterByStartAndEnd) {
|
|
388
330
|
var con = _Array$isArray(content) ? content : String(content);
|
|
389
331
|
return _includesInstanceProperty(con).call(con, value);
|
|
@@ -392,20 +334,15 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
392
334
|
}
|
|
393
335
|
};
|
|
394
336
|
}
|
|
395
|
-
|
|
396
337
|
delete col.filter;
|
|
397
338
|
});
|
|
398
|
-
|
|
399
339
|
_defineProperty(_assertThisInitialized(_this), "linkList", function (key, index, item) {
|
|
400
340
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
401
341
|
var list = item[key] || [];
|
|
402
342
|
return /*#__PURE__*/React.createElement("div", null, _mapInstanceProperty(list).call(list, function (item2, index2) {
|
|
403
343
|
var _context2, _context3;
|
|
404
|
-
|
|
405
344
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
406
|
-
|
|
407
345
|
var onClick = _bindInstanceProperty(_context2 = _this.onLink).call(_context2, null, key, index, item2);
|
|
408
|
-
|
|
409
346
|
return /*#__PURE__*/React.createElement("a", {
|
|
410
347
|
key: index2,
|
|
411
348
|
onClick: onClick,
|
|
@@ -413,7 +350,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
413
350
|
}, _concatInstanceProperty(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
414
351
|
}));
|
|
415
352
|
});
|
|
416
|
-
|
|
417
353
|
_defineProperty(_assertThisInitialized(_this), "waring", function (key, index, item, warningKey) {
|
|
418
354
|
var text = item[key] ? item[key] : '';
|
|
419
355
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
@@ -423,42 +359,32 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
423
359
|
}
|
|
424
360
|
}, text.title ? text.title : text));
|
|
425
361
|
});
|
|
426
|
-
|
|
427
362
|
_defineProperty(_assertThisInitialized(_this), "defaultList", function (key, index, item, text, link) {
|
|
428
363
|
var _context4;
|
|
429
|
-
|
|
430
364
|
var onClick = _bindInstanceProperty(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
431
|
-
|
|
432
365
|
if (link && typeof link === 'string') {
|
|
433
366
|
return /*#__PURE__*/React.createElement("a", {
|
|
434
367
|
onClick: onClick,
|
|
435
368
|
onDoubleClick: _this.onLinkDouble
|
|
436
369
|
}, text);
|
|
437
370
|
}
|
|
438
|
-
|
|
439
371
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, text));
|
|
440
372
|
});
|
|
441
|
-
|
|
442
373
|
_defineProperty(_assertThisInitialized(_this), "getColumns", function (cols, items) {
|
|
443
374
|
var _context5, _context6;
|
|
444
|
-
|
|
445
375
|
var _this$props5 = _this.props,
|
|
446
|
-
|
|
447
|
-
|
|
376
|
+
sortInfo = _this$props5.sortInfo,
|
|
377
|
+
filterInfo = _this$props5.filterInfo;
|
|
448
378
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
449
379
|
return _mapInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _this.getIndexInfo(items)).call(_context6, _filterInstanceProperty(cols).call(cols, function (col) {
|
|
450
380
|
return !col.hide;
|
|
451
381
|
}))).call(_context5, function (_ref11) {
|
|
452
|
-
var col = _extends({}, _ref11);
|
|
453
|
-
|
|
382
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref11), _ref11));
|
|
454
383
|
col.dataIndex = col.key;
|
|
455
384
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? variables('SuperTable')[col.align] : '';
|
|
456
385
|
col.noWrap && (col.className = variables('SuperTable').noWrap);
|
|
457
|
-
|
|
458
386
|
_this.setSortInfo(col, sortInfo || {});
|
|
459
|
-
|
|
460
387
|
_this.setFilterInfo(col, filterInfo || {}, filterVisibleKey);
|
|
461
|
-
|
|
462
388
|
if (col.defaultValue) {
|
|
463
389
|
col.render = function (text, record, index) {
|
|
464
390
|
return _this.defaultList(col.key, index, items[index], col.defaultValue, col.link);
|
|
@@ -480,11 +406,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
480
406
|
return _this.tooltip(col.key, index, items[index], col);
|
|
481
407
|
};
|
|
482
408
|
}
|
|
483
|
-
|
|
484
409
|
return col;
|
|
485
410
|
});
|
|
486
411
|
});
|
|
487
|
-
|
|
488
412
|
_defineProperty(_assertThisInitialized(_this), "getText", function (value, options) {
|
|
489
413
|
if (_Array$isArray(value)) {
|
|
490
414
|
return _mapInstanceProperty(value).call(value, function (v) {
|
|
@@ -494,41 +418,38 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
494
418
|
return getTitle(value, options);
|
|
495
419
|
}
|
|
496
420
|
});
|
|
497
|
-
|
|
498
421
|
_defineProperty(_assertThisInitialized(_this), "link", function (key, index, item, text) {
|
|
499
422
|
var _context7;
|
|
500
|
-
|
|
501
423
|
var onClick = _bindInstanceProperty(_context7 = _this.onLink).call(_context7, null, key, index, item);
|
|
502
|
-
|
|
503
424
|
return /*#__PURE__*/React.createElement("a", {
|
|
504
425
|
onClick: onClick,
|
|
505
426
|
onDoubleClick: _this.onLinkDouble
|
|
506
427
|
}, text);
|
|
507
428
|
});
|
|
508
|
-
|
|
509
429
|
_defineProperty(_assertThisInitialized(_this), "tooltip", function (key, index, item, _ref12) {
|
|
510
430
|
var tipLen = _ref12.tooltip,
|
|
511
|
-
|
|
512
|
-
|
|
431
|
+
options = _ref12.options;
|
|
513
432
|
var text = _this.getText(item[key], options);
|
|
514
|
-
|
|
515
433
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
516
434
|
return needTip ? /*#__PURE__*/React.createElement(_Tooltip, {
|
|
517
435
|
title: text
|
|
518
436
|
}, /*#__PURE__*/React.createElement("span", null, _sliceInstanceProperty(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/React.createElement("span", null, _Array$isArray(text) ? text.join(',') : text);
|
|
519
437
|
});
|
|
520
|
-
|
|
521
438
|
_defineProperty(_assertThisInitialized(_this), "getImgSrc", function (value, options) {
|
|
522
439
|
var index = _findIndexInstanceProperty(options).call(options, function (obj) {
|
|
523
440
|
return obj.value == value;
|
|
524
441
|
});
|
|
525
|
-
|
|
526
442
|
return index === -1 ? null : options[index].img;
|
|
527
443
|
});
|
|
528
|
-
|
|
444
|
+
/**
|
|
445
|
+
*
|
|
446
|
+
* @param item{array}:列数据
|
|
447
|
+
* @param key{string}:字段key
|
|
448
|
+
* @param options{array}:字段options
|
|
449
|
+
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
450
|
+
*/
|
|
529
451
|
_defineProperty(_assertThisInitialized(_this), "getSourceText", function (item, key, options, dataSource) {
|
|
530
452
|
var value = {};
|
|
531
|
-
|
|
532
453
|
if (typeof dataSource === 'string') {
|
|
533
454
|
value = item[dataSource] || {};
|
|
534
455
|
} else if (_Array$isArray(dataSource)) {
|
|
@@ -542,36 +463,28 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
542
463
|
});
|
|
543
464
|
}
|
|
544
465
|
/*如果上面已经取到结果则不进入*/
|
|
545
|
-
|
|
546
|
-
|
|
547
466
|
if (typeof value !== 'string') {
|
|
548
467
|
value = value[key];
|
|
549
468
|
}
|
|
550
|
-
|
|
551
469
|
return _this.getText(value, options);
|
|
552
470
|
});
|
|
553
|
-
|
|
554
471
|
_defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
|
|
555
472
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
556
473
|
return _reduceInstanceProperty(cols).call(cols, function (result, _ref13) {
|
|
557
474
|
var key = _ref13.key,
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
475
|
+
options = _ref13.options,
|
|
476
|
+
link = _ref13.link,
|
|
477
|
+
icon = _ref13.icon,
|
|
478
|
+
dataSource = _ref13.dataSource;
|
|
563
479
|
if (link) {
|
|
564
480
|
if (typeof link === 'boolean') {
|
|
565
481
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
566
482
|
}
|
|
567
483
|
} else if (icon) {
|
|
568
484
|
var _context8;
|
|
569
|
-
|
|
570
485
|
//单独的icon列,icon=true数据值根据options获得显示的图片url
|
|
571
486
|
var src = _this.getImgSrc(item[key], options);
|
|
572
|
-
|
|
573
487
|
var onClick = _bindInstanceProperty(_context8 = _this.onLink).call(_context8, null, key, index, item);
|
|
574
|
-
|
|
575
488
|
result[key] = src ? /*#__PURE__*/React.createElement("img", {
|
|
576
489
|
src: src,
|
|
577
490
|
onClick: onClick
|
|
@@ -581,7 +494,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
581
494
|
} else {
|
|
582
495
|
result[key] = _this.getText(item[key], options);
|
|
583
496
|
}
|
|
584
|
-
|
|
585
497
|
return result;
|
|
586
498
|
}, {
|
|
587
499
|
key: index,
|
|
@@ -589,42 +501,35 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
589
501
|
});
|
|
590
502
|
});
|
|
591
503
|
});
|
|
592
|
-
|
|
593
504
|
_defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox", function (items) {
|
|
594
505
|
var _this$props6 = _this.props,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
506
|
+
_this$props6$checkbox = _this$props6.checkbox,
|
|
507
|
+
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
508
|
+
_this$props6$radio = _this$props6.radio,
|
|
509
|
+
radio = _this$props6$radio === void 0 ? false : _this$props6$radio,
|
|
510
|
+
isolation = _this$props6.isolation,
|
|
511
|
+
_this$props6$checkedR = _this$props6.checkedRows,
|
|
512
|
+
checkedRows = _this$props6$checkedR === void 0 ? [] : _this$props6$checkedR,
|
|
513
|
+
_this$props6$isEmphas = _this$props6.isEmphasized,
|
|
514
|
+
isEmphasized = _this$props6$isEmphas === void 0 ? false : _this$props6$isEmphas,
|
|
515
|
+
_this$props6$isWeaken = _this$props6.isWeaken,
|
|
516
|
+
isWeaken = _this$props6$isWeaken === void 0 ? true : _this$props6$isWeaken;
|
|
607
517
|
var rowClassName1 = function rowClassName1(record) {
|
|
608
518
|
if (items[record.key].__total) return variables('SuperTable').totalRow;
|
|
609
519
|
if (items[record.key].__warningRow) return variables('SuperTable').warningRow;
|
|
610
520
|
return _includesInstanceProperty(checkedRows).call(checkedRows, record.key) ? variables('SuperTable').select : '';
|
|
611
521
|
};
|
|
612
|
-
|
|
613
522
|
var rowClassName2 = function rowClassName2(record) {
|
|
614
523
|
if (items[record.key].__total) return variables('SuperTable').totalRow;
|
|
615
524
|
if (items[record.key].__warningRow) return variables('SuperTable').warningRow;
|
|
616
|
-
|
|
617
525
|
if (isEmphasized && items[record.key].__isEmphasized) {
|
|
618
526
|
return items[record.key].checked ? variables('SuperTable').emphasizedSelectRow : variables('SuperTable').emphasizedUnselectRow;
|
|
619
527
|
}
|
|
620
|
-
|
|
621
528
|
if (isWeaken && items[record.key].__isWeaken) {
|
|
622
529
|
return items[record.key].checked ? variables('SuperTable').weakenedSelectRow : variables('SuperTable').weakenedUnselectRow;
|
|
623
530
|
}
|
|
624
|
-
|
|
625
531
|
return items[record.key].checked ? variables('SuperTable').select : '';
|
|
626
532
|
};
|
|
627
|
-
|
|
628
533
|
if (checkbox) {
|
|
629
534
|
if (radio) {
|
|
630
535
|
return {
|
|
@@ -645,7 +550,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
645
550
|
onChange: _this.onCheckChange,
|
|
646
551
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
647
552
|
var checked = _includesInstanceProperty(checkedRows).call(checkedRows, record.key);
|
|
648
|
-
|
|
649
553
|
return {
|
|
650
554
|
checked: checked,
|
|
651
555
|
disabled: items[record.key].__isWeaken,
|
|
@@ -682,7 +586,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
682
586
|
};
|
|
683
587
|
}
|
|
684
588
|
});
|
|
685
|
-
|
|
686
589
|
_defineProperty(_assertThisInitialized(_this), "getRowProps", function (onRowClick) {
|
|
687
590
|
return function (record) {
|
|
688
591
|
return {
|
|
@@ -695,7 +598,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
695
598
|
};
|
|
696
599
|
};
|
|
697
600
|
});
|
|
698
|
-
|
|
699
601
|
_defineProperty(_assertThisInitialized(_this), "getRowPropsForDrag", function () {
|
|
700
602
|
return function (record, index) {
|
|
701
603
|
return {
|
|
@@ -704,40 +606,34 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
704
606
|
};
|
|
705
607
|
};
|
|
706
608
|
});
|
|
707
|
-
|
|
708
609
|
_defineProperty(_assertThisInitialized(_this), "getItems", function () {
|
|
709
610
|
var _this$props7 = _this.props,
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
611
|
+
items = _this$props7.items,
|
|
612
|
+
cols = _this$props7.cols,
|
|
613
|
+
_this$props7$dragSort = _this$props7.dragSort,
|
|
614
|
+
dragSort = _this$props7$dragSort === void 0 ? false : _this$props7$dragSort,
|
|
615
|
+
_this$props7$pageTota = _this$props7.pageTotal,
|
|
616
|
+
pageTotal = _this$props7$pageTota === void 0 ? false : _this$props7$pageTota,
|
|
617
|
+
searchTotal = _this$props7.searchTotal;
|
|
717
618
|
var resItems = items;
|
|
718
|
-
|
|
719
619
|
if (!dragSort && items.length > 1) {
|
|
720
620
|
if (pageTotal || searchTotal) {
|
|
721
621
|
var totalItem = _reduceInstanceProperty(cols).call(cols, function (result, _ref14) {
|
|
722
622
|
var key = _ref14.key,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
623
|
+
_ref14$total = _ref14.total,
|
|
624
|
+
total = _ref14$total === void 0 ? false : _ref14$total;
|
|
726
625
|
if (total) {
|
|
727
626
|
result[key] = _parseFloat(Number(_reduceInstanceProperty(items).call(items, function (result, item) {
|
|
728
627
|
return _parseFloat(String(item[key] || 0)) + result;
|
|
729
628
|
}, 0)).toFixed(4));
|
|
730
629
|
}
|
|
731
|
-
|
|
732
630
|
return result;
|
|
733
631
|
}, {
|
|
734
632
|
__total: true,
|
|
735
633
|
__totalIndexTitle: '本页汇总'
|
|
736
634
|
});
|
|
737
|
-
|
|
738
635
|
resItems = _concatInstanceProperty(resItems).call(resItems, [totalItem]);
|
|
739
636
|
}
|
|
740
|
-
|
|
741
637
|
if (searchTotal) {
|
|
742
638
|
resItems = _concatInstanceProperty(resItems).call(resItems, [_objectSpread(_objectSpread({}, searchTotal), {}, {
|
|
743
639
|
__total: true,
|
|
@@ -745,21 +641,17 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
745
641
|
})]);
|
|
746
642
|
}
|
|
747
643
|
}
|
|
748
|
-
|
|
749
644
|
return resItems;
|
|
750
645
|
});
|
|
751
|
-
|
|
752
646
|
_defineProperty(_assertThisInitialized(_this), "toTotalFooter", function () {
|
|
753
647
|
var _this$props8 = _this.props,
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
648
|
+
cols = _this$props8.cols,
|
|
649
|
+
items = _this$props8.items,
|
|
650
|
+
isolation = _this$props8.isolation,
|
|
651
|
+
checkedRows = _this$props8.checkedRows;
|
|
759
652
|
var totalCols = _filterInstanceProperty(cols).call(cols, function (item) {
|
|
760
653
|
return item.total;
|
|
761
654
|
});
|
|
762
|
-
|
|
763
655
|
if (totalCols.length > 0) {
|
|
764
656
|
var checkedItems = isolation ? _filterInstanceProperty(items).call(items, function (item, index) {
|
|
765
657
|
return _includesInstanceProperty(checkedRows).call(checkedRows, index);
|
|
@@ -767,23 +659,19 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
767
659
|
return item.checked;
|
|
768
660
|
});
|
|
769
661
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
770
|
-
|
|
771
662
|
var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (_ref15) {
|
|
772
663
|
var title = _ref15.title,
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
664
|
+
key = _ref15.key,
|
|
665
|
+
_ref15$props = _ref15.props,
|
|
666
|
+
props = _ref15$props === void 0 ? {} : _ref15$props;
|
|
777
667
|
var value = _reduceInstanceProperty(countItems).call(countItems, function (result, item) {
|
|
778
668
|
return _parseFloat((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
779
669
|
}, 0);
|
|
780
|
-
|
|
781
670
|
return {
|
|
782
671
|
title: title,
|
|
783
672
|
value: value
|
|
784
673
|
};
|
|
785
674
|
});
|
|
786
|
-
|
|
787
675
|
return /*#__PURE__*/React.createElement("div", {
|
|
788
676
|
style: {
|
|
789
677
|
height: '36px',
|
|
@@ -795,7 +683,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
795
683
|
}
|
|
796
684
|
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (_ref16, index) {
|
|
797
685
|
var title = _ref16.title,
|
|
798
|
-
|
|
686
|
+
value = _ref16.value;
|
|
799
687
|
return /*#__PURE__*/React.createElement("span", {
|
|
800
688
|
key: index,
|
|
801
689
|
style: {
|
|
@@ -811,26 +699,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
811
699
|
return null;
|
|
812
700
|
}
|
|
813
701
|
});
|
|
814
|
-
|
|
815
702
|
_defineProperty(_assertThisInitialized(_this), "getProps", function () {
|
|
816
703
|
var _this$props9 = _this.props,
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
704
|
+
cols = _this$props9.cols,
|
|
705
|
+
_this$props9$isPaging = _this$props9.isPaging,
|
|
706
|
+
isPaging = _this$props9$isPaging === void 0 ? false : _this$props9$isPaging,
|
|
707
|
+
_this$props9$isEmphas = _this$props9.isEmphasized,
|
|
708
|
+
isEmphasized = _this$props9$isEmphas === void 0 ? false : _this$props9$isEmphas,
|
|
709
|
+
_this$props9$isWeaken = _this$props9.isWeaken,
|
|
710
|
+
isWeaken = _this$props9$isWeaken === void 0 ? false : _this$props9$isWeaken,
|
|
711
|
+
dragSort = _this$props9.dragSort,
|
|
712
|
+
_this$props9$footer = _this$props9.footer,
|
|
713
|
+
footer = _this$props9$footer === void 0 ? null : _this$props9$footer;
|
|
828
714
|
var items = _this.getItems();
|
|
829
|
-
|
|
830
715
|
var _this$getPropsByCheck = _this.getPropsByCheckbox(items),
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
716
|
+
onRowClick = _this$getPropsByCheck.onRowClick,
|
|
717
|
+
extraProps = _objectWithoutProperties(_this$getPropsByCheck, _excluded);
|
|
834
718
|
var renderProps = _objectSpread({
|
|
835
719
|
className: !isEmphasized || !isWeaken ? variables('SuperTable') : variables('SuperTable').noTransition,
|
|
836
720
|
columns: _this.getColumns(cols, items),
|
|
@@ -849,16 +733,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
849
733
|
} : {},
|
|
850
734
|
footer: footer ? footer : _this.toTotalFooter
|
|
851
735
|
}, extraProps);
|
|
852
|
-
|
|
853
736
|
return renderProps;
|
|
854
737
|
});
|
|
855
|
-
|
|
856
738
|
_defineProperty(_assertThisInitialized(_this), "setScroll", function () {
|
|
857
739
|
var _this$props10 = _this.props,
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
740
|
+
maxHeight = _this$props10.maxHeight,
|
|
741
|
+
pageTotal = _this$props10.pageTotal,
|
|
742
|
+
searchTotal = _this$props10.searchTotal;
|
|
862
743
|
if (maxHeight && _this.getItems().length) {
|
|
863
744
|
var root = ReactDOM.findDOMNode(_assertThisInitialized(_this));
|
|
864
745
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
@@ -873,15 +754,12 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
873
754
|
});
|
|
874
755
|
}
|
|
875
756
|
});
|
|
876
|
-
|
|
877
757
|
return _this;
|
|
878
758
|
}
|
|
879
|
-
|
|
880
759
|
_createClass(SuperTable, [{
|
|
881
760
|
key: "shouldComponentUpdate",
|
|
882
761
|
value: function shouldComponentUpdate(props, state) {
|
|
883
762
|
var _this2 = this;
|
|
884
|
-
|
|
885
763
|
var keys = ['cols', 'items', 'maxHeight', 'checkedRows', 'sortInfo', 'filterInfo'];
|
|
886
764
|
return _someInstanceProperty(keys).call(keys, function (key) {
|
|
887
765
|
return props[key] !== _this2.props[key];
|
|
@@ -905,10 +783,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
905
783
|
}));
|
|
906
784
|
}
|
|
907
785
|
}]);
|
|
908
|
-
|
|
909
786
|
return SuperTable;
|
|
910
787
|
}(React.Component);
|
|
911
|
-
|
|
912
788
|
_defineProperty(SuperTable, "propTypes", {
|
|
913
789
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|
|
914
790
|
items: PropTypes.arrayOf(PropTypes.shape(ItemType)).isRequired,
|
|
@@ -929,5 +805,4 @@ _defineProperty(SuperTable, "propTypes", {
|
|
|
929
805
|
pageTotal: PropTypes.bool,
|
|
930
806
|
searchTotal: PropTypes.object
|
|
931
807
|
});
|
|
932
|
-
|
|
933
808
|
export default SuperTable;
|