@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.5
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/AutoBox/index.js +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +17 -16
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +89 -117
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +7 -9
- package/Checkbox/index.js +28 -35
- package/CheckboxGroup/index.js +43 -58
- package/Collapse/index.js +52 -49
- package/CollapseBox/index.js +65 -70
- package/CollapseLayout/index.js +106 -101
- package/ColorPicker/index.js +3 -3
- package/ComboSelect/index.js +242 -330
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +22 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +80 -95
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +219 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +66 -74
- package/FormItem/index.js +14 -15
- package/FunctionModal/index.js +7 -14
- package/GlobalContext/index.js +17 -20
- package/Help/index.js +9 -12
- package/HelperText/index.js +11 -11
- package/InputLang/index.js +104 -124
- package/InputNumber/index.js +62 -81
- package/Label/index.js +19 -21
- package/Loading/index.js +11 -10
- package/Menu/index.js +302 -371
- package/Message/index.js +104 -113
- package/Modal/index.js +122 -148
- package/MultiBox/index.d.ts +5 -0
- package/MultiBox/index.js +111 -115
- package/Notification/index.js +105 -103
- package/OperateBtn/index.d.ts +3 -0
- package/OperateBtn/index.js +77 -107
- package/PageHeader/index.js +327 -406
- package/Pagination/index.js +107 -137
- package/ParauiProvider/index.js +20 -22
- package/PasswordRules/index.js +36 -40
- package/PopConfirm/index.js +60 -77
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +22 -23
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +34 -43
- package/Select/index.js +281 -345
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +905 -796
- package/SelectorPicker/index.js +111 -133
- package/SingleBox/index.d.ts +5 -0
- package/SingleBox/index.js +92 -88
- package/Slider/index.js +46 -57
- package/Status/index.js +14 -13
- package/Stepper/index.js +25 -26
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +767 -963
- package/Tabs/index.js +102 -102
- package/Tag/index.js +115 -162
- package/TextEditor/index.js +81 -103
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +27 -28
- package/Timeline/index.js +67 -58
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +53 -52
- package/Tooltip/index.js +79 -82
- package/Transfer/index.js +159 -201
- package/Tree/index.js +7 -12
- package/Upload/index.js +523 -758
- package/Upload/interface.d.ts +2 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-5a7e2438.js → index-0ced30f7.js} +1127 -1079
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-9331b116.js → index-ef1235fb.js} +125 -134
- package/_verture/{index-b1f80962.js → index-f186b5e8.js} +314 -398
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
- package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
- package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
- package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
- package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
- package/_verture/{utils-418da0a4.js → utils-46e99c9a.js} +34 -25
- package/index.js +21 -22
- package/locale/index.js +6 -6
- package/package.json +1 -1
- package/umd/AutoBox.js +9 -8
- package/umd/AutoTips.js +9 -8
- package/umd/Badge.js +1 -1
- package/umd/Breadcrumbs.js +9 -8
- package/umd/Button.js +9 -8
- package/umd/ButtonGroup.js +9 -8
- package/umd/Carousel.js +5 -5
- package/umd/Cascader.js +9 -8
- package/umd/Checkbox.js +9 -8
- package/umd/CheckboxGroup.js +9 -8
- package/umd/Collapse.js +8 -7
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +9 -8
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +9 -8
- package/umd/DatePicker.js +9 -8
- package/umd/Descriptions.js +9 -8
- package/umd/Desktop.js +9 -8
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +9 -8
- package/umd/Dropdown.js +6 -5
- package/umd/DynamicMultiBox.js +11 -10
- package/umd/Empty.js +1 -1
- package/umd/Form.js +9 -8
- package/umd/FormItem.js +9 -8
- package/umd/FunctionModal.js +9 -8
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +9 -8
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +9 -8
- package/umd/InputNumber.js +9 -8
- package/umd/Label.js +9 -8
- package/umd/Loading.js +4 -4
- package/umd/Menu.js +4 -4
- package/umd/Message.js +4 -4
- package/umd/Modal.js +9 -8
- package/umd/MultiBox.js +9 -8
- package/umd/Notification.js +8 -7
- package/umd/OperateBtn.js +9 -8
- package/umd/PageHeader.js +9 -8
- package/umd/Pagination.js +9 -8
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +9 -8
- package/umd/Popover.js +9 -8
- package/umd/Progress.js +5 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +9 -8
- package/umd/RadioGroup.js +9 -8
- package/umd/Search.js +9 -8
- package/umd/Select.js +9 -8
- package/umd/SelectInput.js +9 -8
- package/umd/Selector.js +9 -8
- package/umd/SelectorPicker.js +9 -8
- package/umd/SingleBox.js +9 -8
- package/umd/Slider.js +6 -5
- package/umd/Status.js +4 -4
- package/umd/Stepper.js +9 -8
- package/umd/Switch.js +9 -8
- package/umd/Table.js +9 -8
- package/umd/Tabs.js +9 -8
- package/umd/Tag.js +9 -8
- package/umd/TextEditor.js +22 -21
- package/umd/TextField.js +9 -8
- package/umd/TimePicker.js +9 -8
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +9 -8
- package/umd/ToggleButton.js +9 -8
- package/umd/Tooltip.js +9 -8
- package/umd/Transfer.js +10 -9
- package/umd/Tree.js +9 -8
- package/umd/Upload.js +10 -9
- package/umd/locale.js +1 -1
- package/_verture/index-232d890b.js +0 -327
- package/_verture/index-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/toConsumableArray-8f4c9589.js +0 -19
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/Table/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { _ as _typeof } from '../_verture/typeof-adeedc13.js';
|
|
2
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
|
|
3
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
4
|
-
import { r as regenerator } from '../_verture/index-232d890b.js';
|
|
5
1
|
import { _ as __rest, a as __awaiter } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
6
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
3
|
import { useRef, useState, useEffect, useMemo, useCallback, Fragment as Fragment$1 } from 'react';
|
|
8
4
|
import { Get, Post, DeepClone, GetBrowserClass, Cancel, ArrayToObject } from '@paraview/lib';
|
|
9
5
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
6
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
11
7
|
import { Popover } from '../Popover/index.js';
|
|
12
8
|
import { Checkbox } from '../Checkbox/index.js';
|
|
13
9
|
import { Button } from '../Button/index.js';
|
|
@@ -16,37 +12,38 @@ import Screen from '@para-ui/icons/ScreenF';
|
|
|
16
12
|
import SolidArrowUp from '@para-ui/icons/UpTriangleF';
|
|
17
13
|
import SolidArrowDown from '@para-ui/icons/DownTriangleF';
|
|
18
14
|
import Panel from '@para-ui/icons/Panel';
|
|
19
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
15
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
20
16
|
import Empty from '../Empty/index.js';
|
|
21
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-1d116156.js';
|
|
22
17
|
import { Radio } from '../Radio/index.js';
|
|
23
18
|
import OperateBtn from '../OperateBtn/index.js';
|
|
24
19
|
import Down from '@para-ui/icons/Down';
|
|
25
20
|
import Refresh from '@para-ui/icons/Refresh';
|
|
26
21
|
import { Pagination } from '../Pagination/index.js';
|
|
27
22
|
import { Loading } from '../Loading/index.js';
|
|
28
|
-
import { u as useGlobalProps } from '../_verture/useGlobalProps-
|
|
29
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
30
|
-
import '../_verture/typeof-c310ee4a.js';
|
|
23
|
+
import { u as useGlobalProps } from '../_verture/useGlobalProps-1e416658.js';
|
|
31
24
|
import '../Tooltip/index.js';
|
|
32
25
|
import 'rc-tooltip';
|
|
33
26
|
import 'rc-tooltip/lib/placements';
|
|
34
27
|
import 'clsx';
|
|
35
28
|
import '@para-ui/icons/Forbid';
|
|
36
|
-
import '../_verture/usePopupContainer-
|
|
29
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
37
30
|
import '../Label/index.js';
|
|
38
31
|
import '../Help/index.js';
|
|
39
32
|
import '@para-ui/icons/Help';
|
|
40
33
|
import '@para-ui/icons/LoadingF';
|
|
41
|
-
import '../_verture/index-
|
|
34
|
+
import '../_verture/index-da9097d3.js';
|
|
42
35
|
import 'rc-dropdown';
|
|
43
36
|
import 'dayjs';
|
|
44
37
|
import '@para-ui/core/GlobalContext';
|
|
45
38
|
import '@para-ui/icons/More';
|
|
39
|
+
import '../PopConfirm/index.js';
|
|
40
|
+
import '@para-ui/icons/CheckCircleF';
|
|
41
|
+
import '@para-ui/icons/WarningCircle';
|
|
42
|
+
import '@para-ui/icons/CloseCircleF';
|
|
43
|
+
import '@para-ui/icons/WarningCircleF';
|
|
46
44
|
import '../TextField/index.js';
|
|
47
45
|
import '@para-ui/icons/PreviewClose';
|
|
48
46
|
import '@para-ui/icons/PreviewOpen';
|
|
49
|
-
import '@para-ui/icons/CloseCircleF';
|
|
50
47
|
import '../HelperText/index.js';
|
|
51
48
|
import '../Select/index.js';
|
|
52
49
|
import '@para-ui/icons/Close';
|
|
@@ -62,23 +59,25 @@ import '@para-ui/icons/DoubleRight';
|
|
|
62
59
|
* 发送请求
|
|
63
60
|
* @param obj {ReqProps} 请求信息
|
|
64
61
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
const requestFunc = obj => {
|
|
63
|
+
const {
|
|
64
|
+
method,
|
|
65
|
+
url,
|
|
66
|
+
ctx,
|
|
67
|
+
data
|
|
68
|
+
} = obj,
|
|
70
69
|
otherProps = __rest(obj, ["method", "url", "ctx", "data"]);
|
|
71
70
|
if (method === 'Get') {
|
|
72
71
|
return Get(Object.assign({
|
|
73
72
|
url: url,
|
|
74
|
-
ctx
|
|
73
|
+
ctx
|
|
75
74
|
}, otherProps));
|
|
76
75
|
}
|
|
77
76
|
if (method === 'Post') {
|
|
78
77
|
return Post(Object.assign({
|
|
79
78
|
url: url,
|
|
80
|
-
ctx
|
|
81
|
-
data
|
|
79
|
+
ctx,
|
|
80
|
+
data
|
|
82
81
|
}, otherProps));
|
|
83
82
|
}
|
|
84
83
|
};
|
|
@@ -87,23 +86,23 @@ var requestFunc = function requestFunc(obj) {
|
|
|
87
86
|
* @param obj {ReqProps} 请求信息
|
|
88
87
|
* @return string get请求地址参数
|
|
89
88
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
for (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (
|
|
89
|
+
const handGetReqParams = obj => {
|
|
90
|
+
let str = obj.url;
|
|
91
|
+
const params = obj.data || {};
|
|
92
|
+
const arrKey = Object.keys(params);
|
|
93
|
+
const paramsArr = [];
|
|
94
|
+
for (let i = 0, l = arrKey.length; i < l; i++) {
|
|
95
|
+
const key = arrKey[i];
|
|
96
|
+
let val = params[key];
|
|
97
|
+
if (typeof val === 'object') {
|
|
99
98
|
val = encodeURIComponent(JSON.stringify(val));
|
|
100
99
|
} else {
|
|
101
100
|
val = encodeURIComponent(val);
|
|
102
101
|
}
|
|
103
102
|
paramsArr.push("".concat(key, "=").concat(val));
|
|
104
103
|
}
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
const paramsStr = paramsArr.join('&');
|
|
105
|
+
const pos = str.indexOf('?');
|
|
107
106
|
if (pos !== -1) {
|
|
108
107
|
str += (pos === str.length - 1 ? '' : '&') + paramsStr;
|
|
109
108
|
} else {
|
|
@@ -114,9 +113,9 @@ var handGetReqParams = function handGetReqParams(obj) {
|
|
|
114
113
|
/**
|
|
115
114
|
* 提取字符串里面的数字
|
|
116
115
|
* */
|
|
117
|
-
|
|
116
|
+
const getStringInNumber = str => {
|
|
118
117
|
if (typeof str === 'number') return str;
|
|
119
|
-
|
|
118
|
+
const strHand = str.replace(/[^0-9$]/gi, '');
|
|
120
119
|
return Number(strHand);
|
|
121
120
|
};
|
|
122
121
|
/**
|
|
@@ -124,23 +123,23 @@ var getStringInNumber = function getStringInNumber(str) {
|
|
|
124
123
|
* @param key {string} 键值
|
|
125
124
|
* @param num {number} 过期天数
|
|
126
125
|
* */
|
|
127
|
-
|
|
126
|
+
const getLocalStorageSelectHead = (key, num) => {
|
|
128
127
|
//debugger
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
for (
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
const headJsonStr = window.localStorage.getItem('_paraui_table_head') || '{}';
|
|
129
|
+
const headJson = JSON.parse(headJsonStr);
|
|
130
|
+
const headJsonArr = Object.keys(headJson);
|
|
131
|
+
for (let i = 0, l = headJsonArr.length; i < l; i++) {
|
|
132
|
+
const keyStr = headJsonArr[i];
|
|
133
|
+
const item = headJson[i];
|
|
135
134
|
if (!item) continue;
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
const newDate = new Date().getTime(); // 当前时间
|
|
136
|
+
const endTime = item.storageTime + item.validity; // 过期时间
|
|
138
137
|
// 过期时间 小于 当前时间, 说明已经过期了, 删除当前表格列数据
|
|
139
138
|
if (endTime < newDate) {
|
|
140
139
|
delete headJson[keyStr];
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
|
-
|
|
142
|
+
const headJsonItem = headJson[key];
|
|
144
143
|
// 重置过期时间
|
|
145
144
|
if (headJsonItem) {
|
|
146
145
|
headJsonItem.storageTime = new Date().getTime();
|
|
@@ -153,9 +152,9 @@ var getLocalStorageSelectHead = function getLocalStorageSelectHead(key, num) {
|
|
|
153
152
|
* @param key {string} 键值
|
|
154
153
|
* @param val {HeadLocalStorageItem} 保存值
|
|
155
154
|
* */
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
const setLocalStorageSelectHead = (key, val) => {
|
|
156
|
+
const headJsonStr = window.localStorage.getItem('_paraui_table_head') || '{}';
|
|
157
|
+
const headJson = JSON.parse(headJsonStr);
|
|
159
158
|
headJson[key] = val;
|
|
160
159
|
window.localStorage.setItem('_paraui_table_head', JSON.stringify(headJson));
|
|
161
160
|
};
|
|
@@ -164,8 +163,8 @@ var setLocalStorageSelectHead = function setLocalStorageSelectHead(key, val) {
|
|
|
164
163
|
* @param el 当前元素
|
|
165
164
|
* @param selector 查找元素class
|
|
166
165
|
*/
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
const closest = (el, selector) => {
|
|
167
|
+
const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
|
169
168
|
while (el) {
|
|
170
169
|
if (matchesSelector.call(el, selector)) {
|
|
171
170
|
break;
|
|
@@ -355,69 +354,49 @@ var zh = {
|
|
|
355
354
|
};
|
|
356
355
|
|
|
357
356
|
var localeJson = {
|
|
358
|
-
zh
|
|
359
|
-
en
|
|
357
|
+
zh,
|
|
358
|
+
en
|
|
360
359
|
};
|
|
361
360
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
headData =
|
|
365
|
-
sortTable
|
|
366
|
-
filter
|
|
367
|
-
expandable
|
|
368
|
-
check
|
|
369
|
-
radio
|
|
370
|
-
onRequestSort
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
checked = _useState4[0],
|
|
402
|
-
setChecked = _useState4[1]; // 选中
|
|
403
|
-
var _useState5 = useState(null),
|
|
404
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
405
|
-
anchorElColums = _useState6[0],
|
|
406
|
-
setAnchorElColums = _useState6[1]; // 显示列定位元素
|
|
407
|
-
var _useState7 = useState({}),
|
|
408
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
409
|
-
headDataJson = _useState8[0],
|
|
410
|
-
setHeadDataJson = _useState8[1]; // 显示列json
|
|
411
|
-
var _useState9 = useState({}),
|
|
412
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
413
|
-
filterHead = _useState10[0],
|
|
414
|
-
setFilterHead = _useState10[1]; // 过滤项当前表头数据
|
|
415
|
-
var _useState11 = useState({}),
|
|
416
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
417
|
-
selectFilterCom = _useState12[0],
|
|
418
|
-
setSelectFilterCom = _useState12[1]; // 过滤项当前选中值
|
|
419
|
-
var intl = useFormatMessage('Table', localeJson);
|
|
420
|
-
useEffect(function () {
|
|
361
|
+
const TableHead$1 = props => {
|
|
362
|
+
const {
|
|
363
|
+
headData = [],
|
|
364
|
+
sortTable,
|
|
365
|
+
filter,
|
|
366
|
+
expandable,
|
|
367
|
+
check,
|
|
368
|
+
radio,
|
|
369
|
+
onRequestSort,
|
|
370
|
+
orderFieldArr = [],
|
|
371
|
+
orderTypeArr = [],
|
|
372
|
+
selectAll,
|
|
373
|
+
selectStatus,
|
|
374
|
+
align,
|
|
375
|
+
showList = [],
|
|
376
|
+
changeShowList,
|
|
377
|
+
selectFilter,
|
|
378
|
+
changeFilter,
|
|
379
|
+
operate,
|
|
380
|
+
showColumns,
|
|
381
|
+
fixedTable,
|
|
382
|
+
fixedColumn,
|
|
383
|
+
posFixed,
|
|
384
|
+
beyondText,
|
|
385
|
+
lineWidth,
|
|
386
|
+
dragColumn,
|
|
387
|
+
changeColumnWidth,
|
|
388
|
+
headDataConfig,
|
|
389
|
+
getPopupContainer,
|
|
390
|
+
tipMaxWidth
|
|
391
|
+
} = props;
|
|
392
|
+
const [indeterminate, setIndeterminate] = useState(false); // 半选中
|
|
393
|
+
const [checked, setChecked] = useState(false); // 选中
|
|
394
|
+
const [anchorElColums, setAnchorElColums] = useState(null); // 显示列定位元素
|
|
395
|
+
const [headDataJson, setHeadDataJson] = useState({}); // 显示列json
|
|
396
|
+
const [filterHead, setFilterHead] = useState({}); // 过滤项当前表头数据
|
|
397
|
+
const [selectFilterCom, setSelectFilterCom] = useState({}); // 过滤项当前选中值
|
|
398
|
+
const intl = useFormatMessage('Table', localeJson);
|
|
399
|
+
useEffect(() => {
|
|
421
400
|
// 全选
|
|
422
401
|
if (selectStatus === 'all') {
|
|
423
402
|
setChecked(true);
|
|
@@ -434,17 +413,17 @@ var TableHead$1 = function TableHead(props) {
|
|
|
434
413
|
setIndeterminate(false);
|
|
435
414
|
}
|
|
436
415
|
}, [selectStatus]);
|
|
437
|
-
useEffect(
|
|
416
|
+
useEffect(() => {
|
|
438
417
|
if (headData) {
|
|
439
|
-
|
|
440
|
-
for (
|
|
441
|
-
|
|
418
|
+
const json = [];
|
|
419
|
+
for (let i = 0, l = headData.length; i < l; i++) {
|
|
420
|
+
const item = headData[i];
|
|
442
421
|
json[item.name] = item;
|
|
443
422
|
}
|
|
444
423
|
setHeadDataJson(json);
|
|
445
424
|
}
|
|
446
425
|
}, [headData]);
|
|
447
|
-
useEffect(
|
|
426
|
+
useEffect(() => {
|
|
448
427
|
if (selectFilter) setSelectFilterCom(DeepClone(selectFilter));
|
|
449
428
|
}, [selectFilter]);
|
|
450
429
|
/**
|
|
@@ -452,30 +431,28 @@ var TableHead$1 = function TableHead(props) {
|
|
|
452
431
|
* @param name 排序列
|
|
453
432
|
* @param event 当前排序元素
|
|
454
433
|
*/
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
if (onRequestSort) onRequestSort(event, name);
|
|
460
|
-
};
|
|
434
|
+
const createSortHandler = (name, item) => event => {
|
|
435
|
+
// 不存在排序,不触发事件
|
|
436
|
+
if (!(sortTable && item.name && item.sort !== false)) return;
|
|
437
|
+
if (onRequestSort) onRequestSort(event, name);
|
|
461
438
|
};
|
|
462
439
|
/**
|
|
463
440
|
* 全选 / 全不选
|
|
464
441
|
* @param event 操作元素
|
|
465
442
|
* @param bol 选中 / 不选中
|
|
466
443
|
*/
|
|
467
|
-
|
|
444
|
+
const onSelectAll = (event, bol) => {
|
|
468
445
|
if (selectAll) selectAll(event, bol);
|
|
469
446
|
};
|
|
470
447
|
/**
|
|
471
448
|
* 点击显示选择列
|
|
472
449
|
* @param event 点击元素
|
|
473
450
|
*/
|
|
474
|
-
|
|
451
|
+
const clickShowColums = event => {
|
|
475
452
|
setAnchorElColums(event.currentTarget);
|
|
476
453
|
};
|
|
477
454
|
// 点击隐藏选择列
|
|
478
|
-
|
|
455
|
+
const clickHideColums = bol => {
|
|
479
456
|
if (bol) return;
|
|
480
457
|
setAnchorElColums(null);
|
|
481
458
|
};
|
|
@@ -483,29 +460,27 @@ var TableHead$1 = function TableHead(props) {
|
|
|
483
460
|
* 点击显示列 列表
|
|
484
461
|
* @param item 详细
|
|
485
462
|
*/
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
arr1.push(headDataJson[_name]);
|
|
499
|
-
}
|
|
500
|
-
changeShowList && changeShowList(arr1, false, item);
|
|
501
|
-
} else {
|
|
502
|
-
headData.push(item);
|
|
503
|
-
changeShowList && changeShowList(headData, false, item);
|
|
463
|
+
const clickColumsList = item => () => {
|
|
464
|
+
if (item.disabledSelection) return;
|
|
465
|
+
const name = item.name;
|
|
466
|
+
const itemHead = headDataJson[name];
|
|
467
|
+
if (itemHead) {
|
|
468
|
+
// 取消勾选
|
|
469
|
+
delete headDataJson[name];
|
|
470
|
+
const arr = Object.keys(headDataJson);
|
|
471
|
+
const arr1 = [];
|
|
472
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
473
|
+
const name = arr[i];
|
|
474
|
+
arr1.push(headDataJson[name]);
|
|
504
475
|
}
|
|
505
|
-
|
|
476
|
+
changeShowList && changeShowList(arr1, false, item);
|
|
477
|
+
} else {
|
|
478
|
+
headData.push(item);
|
|
479
|
+
changeShowList && changeShowList(headData, false, item);
|
|
480
|
+
}
|
|
506
481
|
};
|
|
507
482
|
// 重置显示列
|
|
508
|
-
|
|
483
|
+
const resetShowList = () => {
|
|
509
484
|
changeShowList && changeShowList(headData, true);
|
|
510
485
|
};
|
|
511
486
|
/**
|
|
@@ -513,69 +488,63 @@ var TableHead$1 = function TableHead(props) {
|
|
|
513
488
|
* @param headCell 当前列信息
|
|
514
489
|
* @param event 元素
|
|
515
490
|
*/
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
setSelectFilterCom(Object.assign({}, selectFilter));
|
|
520
|
-
};
|
|
491
|
+
const clickShowFilter = headCell => event => {
|
|
492
|
+
setFilterHead(headCell);
|
|
493
|
+
setSelectFilterCom(Object.assign({}, selectFilter));
|
|
521
494
|
};
|
|
522
495
|
// 点击隐藏过滤
|
|
523
|
-
|
|
496
|
+
const clickHideFilter = bol => {
|
|
524
497
|
if (bol) return;
|
|
525
498
|
setFilterHead({});
|
|
526
499
|
setSelectFilterCom(Object.assign({}, selectFilter));
|
|
527
500
|
};
|
|
528
501
|
// 点击过滤
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
filterValue = [filterValue[num]];
|
|
547
|
-
}
|
|
502
|
+
const clickFilter = item => () => {
|
|
503
|
+
const name = filterHead.name;
|
|
504
|
+
let filterValue = DeepClone(selectFilterCom[name] || []);
|
|
505
|
+
const index = filterValue.indexOf(item.value);
|
|
506
|
+
if (index !== -1) {
|
|
507
|
+
// 勾选 -> 不勾选
|
|
508
|
+
filterValue.splice(index, 1);
|
|
509
|
+
} else {
|
|
510
|
+
// 不勾选 -> 勾选
|
|
511
|
+
filterValue.push(item.value);
|
|
512
|
+
}
|
|
513
|
+
const filterRadio = filterHead.filterRadio;
|
|
514
|
+
if (filterRadio) {
|
|
515
|
+
// 过滤单个
|
|
516
|
+
const num = filterValue.indexOf(item.value);
|
|
517
|
+
if (num !== -1) {
|
|
518
|
+
filterValue = [filterValue[num]];
|
|
548
519
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
};
|
|
520
|
+
}
|
|
521
|
+
selectFilterCom[name] = filterValue;
|
|
522
|
+
setSelectFilterCom(Object.assign({}, selectFilterCom));
|
|
552
523
|
};
|
|
553
524
|
/**
|
|
554
525
|
* 重置 / 确定过滤
|
|
555
526
|
* @param type {'reset' | 'confirm'} 重置 / 确定过滤
|
|
556
527
|
*/
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
};
|
|
528
|
+
const filterFunc = type => () => {
|
|
529
|
+
if (type === 'confirm') {
|
|
530
|
+
// 确定
|
|
531
|
+
changeFilter && changeFilter(Object.assign({}, selectFilterCom));
|
|
532
|
+
setFilterHead({});
|
|
533
|
+
} else {
|
|
534
|
+
// 重置
|
|
535
|
+
const json = DeepClone(selectFilterCom);
|
|
536
|
+
delete json[filterHead.name];
|
|
537
|
+
setSelectFilterCom(json);
|
|
538
|
+
changeFilter && changeFilter(Object.assign({}, json));
|
|
539
|
+
setFilterHead({});
|
|
540
|
+
}
|
|
572
541
|
};
|
|
573
542
|
/**
|
|
574
543
|
* 自定义过滤确定
|
|
575
544
|
* @param val {[name: string]: any[]}
|
|
576
545
|
* */
|
|
577
|
-
|
|
578
|
-
|
|
546
|
+
const filterCustomConfirm = function () {
|
|
547
|
+
let val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
579
548
|
changeFilter && changeFilter(Object.assign({}, val));
|
|
580
549
|
setFilterHead({});
|
|
581
550
|
};
|
|
@@ -583,12 +552,12 @@ var TableHead$1 = function TableHead(props) {
|
|
|
583
552
|
* 处理TableCell
|
|
584
553
|
* @param item 当前列信息
|
|
585
554
|
*/
|
|
586
|
-
|
|
587
|
-
|
|
555
|
+
const handCellClass = item => {
|
|
556
|
+
let str = 'table-header-box';
|
|
588
557
|
// 排序
|
|
589
558
|
if (sortTable && item.name && item.sort !== false) {
|
|
590
559
|
str += ' table-header-box-sort';
|
|
591
|
-
|
|
560
|
+
const index = orderFieldArr.indexOf(item.name);
|
|
592
561
|
if (index !== -1) {
|
|
593
562
|
// 升序
|
|
594
563
|
if (orderTypeArr[index] === 'asc') {
|
|
@@ -607,10 +576,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
607
576
|
return str;
|
|
608
577
|
};
|
|
609
578
|
// 复选框memo
|
|
610
|
-
|
|
579
|
+
const TableCheckMemo = useMemo(() => {
|
|
611
580
|
if (check) {
|
|
612
|
-
|
|
613
|
-
|
|
581
|
+
const handCls = () => {
|
|
582
|
+
let str = 'table-checkbox table-head-btn';
|
|
614
583
|
if (fixedColumn) {
|
|
615
584
|
str += ' table-fixed-dom-left';
|
|
616
585
|
// 左边没有定位,且没有单选,没有嵌套表格
|
|
@@ -638,10 +607,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
638
607
|
}
|
|
639
608
|
}, [check, indeterminate, checked, selectAll, posFixed, radio, expandable, fixedColumn]);
|
|
640
609
|
// 单选框memo
|
|
641
|
-
|
|
610
|
+
const TableRadioMemo = useMemo(() => {
|
|
642
611
|
if (radio) {
|
|
643
|
-
|
|
644
|
-
|
|
612
|
+
const handCls = () => {
|
|
613
|
+
let str = 'table-radio table-head-btn';
|
|
645
614
|
if (fixedColumn) {
|
|
646
615
|
str += ' table-fixed-dom-left';
|
|
647
616
|
// 左边没有定位,没有嵌套表格
|
|
@@ -663,10 +632,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
663
632
|
}
|
|
664
633
|
}, [radio, posFixed, expandable, fixedColumn]);
|
|
665
634
|
// 嵌套表格memo
|
|
666
|
-
|
|
635
|
+
const TableExpandableMemo = useMemo(() => {
|
|
667
636
|
if (expandable) {
|
|
668
|
-
|
|
669
|
-
|
|
637
|
+
const handCls = () => {
|
|
638
|
+
let str = 'table-expandable table-head-btn';
|
|
670
639
|
if (fixedColumn) {
|
|
671
640
|
str += ' table-fixed-dom-left';
|
|
672
641
|
// 左边没有定位,没有嵌套表格
|
|
@@ -688,21 +657,21 @@ var TableHead$1 = function TableHead(props) {
|
|
|
688
657
|
}
|
|
689
658
|
}, [expandable, posFixed, fixedColumn]);
|
|
690
659
|
// 过滤弹窗内容
|
|
691
|
-
|
|
692
|
-
|
|
660
|
+
const filterPopoverContent = () => {
|
|
661
|
+
const name = filterHead.name;
|
|
693
662
|
if (!name) return;
|
|
694
|
-
|
|
663
|
+
const filterValue = selectFilterCom[name] || [];
|
|
695
664
|
if (filterHead.filterRender) {
|
|
696
665
|
// 自定义渲染过滤
|
|
697
666
|
return filterHead.filterRender({
|
|
698
|
-
filterValue
|
|
667
|
+
filterValue,
|
|
699
668
|
selectFilter: selectFilterCom,
|
|
700
|
-
filterHead
|
|
669
|
+
filterHead,
|
|
701
670
|
setFilter: filterCustomConfirm
|
|
702
671
|
});
|
|
703
672
|
}
|
|
704
|
-
|
|
705
|
-
|
|
673
|
+
const arr = filterHead.enums || [];
|
|
674
|
+
let str = 'filter-select';
|
|
706
675
|
if (arr.length === 0) str += ' filter-select-none';
|
|
707
676
|
return jsx("div", Object.assign({
|
|
708
677
|
className: str
|
|
@@ -717,8 +686,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
717
686
|
children: [jsx("div", Object.assign({
|
|
718
687
|
className: "filter-select-box"
|
|
719
688
|
}, {
|
|
720
|
-
children: arr.map(
|
|
721
|
-
|
|
689
|
+
children: arr.map((item, index) => {
|
|
690
|
+
const checked = filterValue.indexOf(item.value) !== -1;
|
|
722
691
|
return jsxs("div", Object.assign({
|
|
723
692
|
onClick: clickFilter(item),
|
|
724
693
|
className: checked ? 'filter-select-item filter-select-item-select' : 'filter-select-item'
|
|
@@ -757,30 +726,28 @@ var TableHead$1 = function TableHead(props) {
|
|
|
757
726
|
}));
|
|
758
727
|
};
|
|
759
728
|
// 表格列拖拽放下
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
changeColumnWidth && changeColumnWidth(headCell, result);
|
|
763
|
-
};
|
|
729
|
+
const onDragDown = headCell => result => {
|
|
730
|
+
changeColumnWidth && changeColumnWidth(headCell, result);
|
|
764
731
|
};
|
|
765
732
|
// 获取宽度
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
733
|
+
const getWidth = item => {
|
|
734
|
+
let w = item.width || '';
|
|
735
|
+
const name = item.name || '';
|
|
736
|
+
const wDrag = headDataConfig[name] && headDataConfig[name].width;
|
|
770
737
|
if (wDrag) w = "".concat(wDrag, "px");
|
|
771
738
|
return w;
|
|
772
739
|
};
|
|
773
740
|
// 内容列memo
|
|
774
|
-
|
|
741
|
+
const TableContentMemo = useMemo(() => {
|
|
775
742
|
// 处理过滤的class
|
|
776
|
-
|
|
777
|
-
|
|
743
|
+
const handFilterClass = item => {
|
|
744
|
+
let str = 'table-header-filter';
|
|
778
745
|
if (filterHead.name === item.name) str += ' table-header-filter-show';
|
|
779
746
|
if (item.name && selectFilterCom[item.name] && selectFilterCom[item.name].length > 0) str += ' table-header-filter-select';
|
|
780
747
|
return str;
|
|
781
748
|
};
|
|
782
|
-
|
|
783
|
-
|
|
749
|
+
const handCls = item => {
|
|
750
|
+
let str = '';
|
|
784
751
|
if (item.className) str += item.className;
|
|
785
752
|
if (fixedColumn && item.fixed) {
|
|
786
753
|
str += " table-fixed-dom-".concat(item.fixed);
|
|
@@ -795,8 +762,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
795
762
|
}
|
|
796
763
|
return str;
|
|
797
764
|
};
|
|
798
|
-
|
|
799
|
-
|
|
765
|
+
const handStyle = item => {
|
|
766
|
+
const json = {
|
|
800
767
|
width: getWidth(item)
|
|
801
768
|
};
|
|
802
769
|
if (fixedColumn && item.fixed && item.width) {
|
|
@@ -810,13 +777,13 @@ var TableHead$1 = function TableHead(props) {
|
|
|
810
777
|
return Object.assign(Object.assign({}, json), item.style);
|
|
811
778
|
};
|
|
812
779
|
// 处理拖拽
|
|
813
|
-
|
|
780
|
+
const handDrag = item => {
|
|
814
781
|
if (item.name === 'table-serial-number') return false; // 序号不拖拽
|
|
815
782
|
if (dragColumn && item.drag !== false) return true;
|
|
816
783
|
return false;
|
|
817
784
|
};
|
|
818
|
-
return headData.map(
|
|
819
|
-
|
|
785
|
+
return headData.map((headCell, index) => {
|
|
786
|
+
let str = "".concat($prefixCls, "-filter-popover ").concat($prefixCls, "-scrollbar-small");
|
|
820
787
|
if (!headCell.filterRender) str += " ".concat($prefixCls, "-filter-popover-default");
|
|
821
788
|
return jsx(ThElement, Object.assign({
|
|
822
789
|
className: handCls(headCell),
|
|
@@ -833,9 +800,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
833
800
|
content: filterPopoverContent(),
|
|
834
801
|
onVisibleChange: clickHideFilter,
|
|
835
802
|
overlayClassName: str,
|
|
836
|
-
getPopupContainer: getPopupContainer ? getPopupContainer :
|
|
837
|
-
return document.body;
|
|
838
|
-
}
|
|
803
|
+
getPopupContainer: getPopupContainer ? getPopupContainer : () => document.body
|
|
839
804
|
}, {
|
|
840
805
|
children: jsxs("div", Object.assign({
|
|
841
806
|
className: handCellClass(headCell)
|
|
@@ -879,10 +844,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
879
844
|
});
|
|
880
845
|
}, [headData, sortTable, filter, orderFieldArr, orderTypeArr, align, filterHead, selectFilterCom, beyondText, selectFilter, fixedColumn, lineWidth, dragColumn, changeColumnWidth, headDataConfig, getPopupContainer, tipMaxWidth]);
|
|
881
846
|
// 操作栏memo
|
|
882
|
-
|
|
847
|
+
const TableOperateMemo = useMemo(() => {
|
|
883
848
|
if (operate) {
|
|
884
|
-
|
|
885
|
-
|
|
849
|
+
const handCls = () => {
|
|
850
|
+
let str = 'table-operate';
|
|
886
851
|
if (operate.operateBtnRender) str += ' table-operate-small';
|
|
887
852
|
if (fixedColumn) {
|
|
888
853
|
str += ' table-fixed-dom-right';
|
|
@@ -893,8 +858,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
893
858
|
}
|
|
894
859
|
return str;
|
|
895
860
|
};
|
|
896
|
-
|
|
897
|
-
|
|
861
|
+
const handStyle = () => {
|
|
862
|
+
const json = {
|
|
898
863
|
width: operate.width
|
|
899
864
|
};
|
|
900
865
|
if (fixedColumn) {
|
|
@@ -930,16 +895,16 @@ var TableHead$1 = function TableHead(props) {
|
|
|
930
895
|
}
|
|
931
896
|
}, [operate, align, posFixed, showColumns, posFixed, beyondText, fixedColumn, tipMaxWidth]);
|
|
932
897
|
// 显示列弹窗内容
|
|
933
|
-
|
|
898
|
+
const showListContent = () => {
|
|
934
899
|
return jsxs("div", Object.assign({
|
|
935
900
|
className: "show-colums-select"
|
|
936
901
|
}, {
|
|
937
902
|
children: [jsx("div", Object.assign({
|
|
938
903
|
className: "show-colums-select-box"
|
|
939
904
|
}, {
|
|
940
|
-
children: showList.map(
|
|
941
|
-
|
|
942
|
-
|
|
905
|
+
children: showList.map((item, index) => {
|
|
906
|
+
const checked = Boolean(headDataJson[item.name]);
|
|
907
|
+
let str = 'show-colums-select-item';
|
|
943
908
|
if (checked) str += ' show-colums-select-item-select';
|
|
944
909
|
if (item.disabledSelection) str += ' show-colums-select-item-disabled';
|
|
945
910
|
return jsxs("div", Object.assign({
|
|
@@ -973,9 +938,9 @@ var TableHead$1 = function TableHead(props) {
|
|
|
973
938
|
}));
|
|
974
939
|
};
|
|
975
940
|
// 显示列memo
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
941
|
+
const TableShowList = useMemo(() => {
|
|
942
|
+
const handCls = () => {
|
|
943
|
+
let str = 'show-colums table-fixed-dom-right';
|
|
979
944
|
// 没有固定列参数 或者 没有操作栏且没有右侧固定列
|
|
980
945
|
if (!fixedColumn || !operate && !(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
981
946
|
str += ' table-fixed-dom-right-first';
|
|
@@ -988,9 +953,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
988
953
|
content: showListContent(),
|
|
989
954
|
onVisibleChange: clickHideColums,
|
|
990
955
|
overlayClassName: "".concat($prefixCls, "-table-show-colums-popover ").concat($prefixCls, "-scrollbar-small"),
|
|
991
|
-
getPopupContainer: getPopupContainer ? getPopupContainer :
|
|
992
|
-
return document.body;
|
|
993
|
-
}
|
|
956
|
+
getPopupContainer: getPopupContainer ? getPopupContainer : () => document.body
|
|
994
957
|
}, {
|
|
995
958
|
children: jsx(ThElement, Object.assign({
|
|
996
959
|
align: "center",
|
|
@@ -1007,8 +970,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
1007
970
|
}));
|
|
1008
971
|
}, [showColumns, posFixed, operate, anchorElColums, showList, headDataJson, getPopupContainer, tipMaxWidth]);
|
|
1009
972
|
// 处理class
|
|
1010
|
-
|
|
1011
|
-
|
|
973
|
+
const handClass = () => {
|
|
974
|
+
let str = 'table-head';
|
|
1012
975
|
if (showColumns === 'inside') str += ' table-head-inside';
|
|
1013
976
|
if (!fixedTable) str += ' table-head-scroll'; // 防止长度过长
|
|
1014
977
|
// 没有 复选框,单选框,展开 按钮
|
|
@@ -1066,92 +1029,71 @@ var TdElement = function TdElement(props) {
|
|
|
1066
1029
|
}));
|
|
1067
1030
|
};
|
|
1068
1031
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
rowData =
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
onClickRow = props.onClickRow,
|
|
1123
|
-
rowClassMapping = props.rowClassMapping,
|
|
1124
|
-
tipMaxWidth = props.tipMaxWidth,
|
|
1125
|
-
lineHeight = props.lineHeight;
|
|
1126
|
-
var _useState = useState(0),
|
|
1127
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1128
|
-
expandableColSpan = _useState2[0],
|
|
1129
|
-
setExpandableColSpan = _useState2[1]; // 嵌套表格合并列数
|
|
1130
|
-
var _useState3 = useState({}),
|
|
1131
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1132
|
-
expandableRow = _useState4[0],
|
|
1133
|
-
setExpandableRow = _useState4[1]; // 当前哪行展开表格嵌套
|
|
1134
|
-
var _useState5 = useState(true),
|
|
1135
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
1136
|
-
showMoreBtn = _useState6[0],
|
|
1137
|
-
setShowMoreBtn = _useState6[1]; // 加载更多
|
|
1138
|
-
var _useState7 = useState({}),
|
|
1139
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
1140
|
-
disabledExpandJson = _useState8[0],
|
|
1141
|
-
setDisabledExpand = _useState8[1]; // 禁用加减部分嵌套
|
|
1142
|
-
var intl = useFormatMessage('Table', localeJson);
|
|
1032
|
+
const TableBody = props => {
|
|
1033
|
+
const {
|
|
1034
|
+
url,
|
|
1035
|
+
emptyProps,
|
|
1036
|
+
rowData = [],
|
|
1037
|
+
rowKey = 'key',
|
|
1038
|
+
check,
|
|
1039
|
+
radio,
|
|
1040
|
+
tableCell,
|
|
1041
|
+
expandable,
|
|
1042
|
+
headData = [],
|
|
1043
|
+
disabledJson = {},
|
|
1044
|
+
disabledArrStatus,
|
|
1045
|
+
checkJson = {},
|
|
1046
|
+
radioValue,
|
|
1047
|
+
selectCheck,
|
|
1048
|
+
selectRadio,
|
|
1049
|
+
align,
|
|
1050
|
+
operate,
|
|
1051
|
+
showColumns,
|
|
1052
|
+
fixedTable,
|
|
1053
|
+
fixedColumn,
|
|
1054
|
+
formatter,
|
|
1055
|
+
orderFieldArr = [],
|
|
1056
|
+
orderTypeArr = [],
|
|
1057
|
+
sortTable,
|
|
1058
|
+
loadState,
|
|
1059
|
+
loadMore,
|
|
1060
|
+
loadMoreRender,
|
|
1061
|
+
onClickMore,
|
|
1062
|
+
total,
|
|
1063
|
+
page,
|
|
1064
|
+
currentRowsPerPage,
|
|
1065
|
+
changePage,
|
|
1066
|
+
loadMoreUrl,
|
|
1067
|
+
expandMultiple = false,
|
|
1068
|
+
expandValue = [],
|
|
1069
|
+
disabledExpand = [],
|
|
1070
|
+
defaultExpandAllRows = false,
|
|
1071
|
+
onExpand,
|
|
1072
|
+
onRefresh,
|
|
1073
|
+
posFixed,
|
|
1074
|
+
beyondText,
|
|
1075
|
+
onClickRow,
|
|
1076
|
+
rowClassMapping,
|
|
1077
|
+
tipMaxWidth,
|
|
1078
|
+
lineHeight
|
|
1079
|
+
} = props;
|
|
1080
|
+
const [expandableColSpan, setExpandableColSpan] = useState(0); // 嵌套表格合并列数
|
|
1081
|
+
const [expandableRow, setExpandableRow] = useState({}); // 当前哪行展开表格嵌套
|
|
1082
|
+
const [showMoreBtn, setShowMoreBtn] = useState(true); // 加载更多
|
|
1083
|
+
const [disabledExpandJson, setDisabledExpand] = useState({}); // 禁用加减部分嵌套
|
|
1084
|
+
const intl = useFormatMessage('Table', localeJson);
|
|
1143
1085
|
// 默认是否展开所有
|
|
1144
|
-
useEffect(
|
|
1086
|
+
useEffect(() => {
|
|
1145
1087
|
if (!defaultExpandAllRows) {
|
|
1146
1088
|
setExpandableRow({});
|
|
1147
1089
|
return;
|
|
1148
1090
|
}
|
|
1149
|
-
|
|
1150
|
-
for (
|
|
1151
|
-
|
|
1152
|
-
|
|
1091
|
+
const json = {};
|
|
1092
|
+
for (let i = 0, l = rowData.length; i < l; i++) {
|
|
1093
|
+
const item = rowData[i] || {};
|
|
1094
|
+
const id = item[rowKey];
|
|
1153
1095
|
json[id] = {
|
|
1154
|
-
id
|
|
1096
|
+
id,
|
|
1155
1097
|
status: 'develop'
|
|
1156
1098
|
};
|
|
1157
1099
|
}
|
|
@@ -1159,41 +1101,41 @@ var TableBody = function TableBody(props) {
|
|
|
1159
1101
|
}, [defaultExpandAllRows, rowData, rowKey]);
|
|
1160
1102
|
// 监听展开表格
|
|
1161
1103
|
// 如果直接写expandMultiple, expandValue会死循环
|
|
1162
|
-
useEffect(
|
|
1104
|
+
useEffect(() => {
|
|
1163
1105
|
if (props.expandValue === undefined) return;
|
|
1164
|
-
|
|
1165
|
-
|
|
1106
|
+
const json = {};
|
|
1107
|
+
let expandValueHand = expandValue;
|
|
1166
1108
|
// 只展开一个,去第一个值
|
|
1167
1109
|
if (!expandMultiple && expandValue.length > 0) {
|
|
1168
1110
|
expandValueHand = [expandValue[0]];
|
|
1169
1111
|
}
|
|
1170
|
-
for (
|
|
1171
|
-
|
|
1112
|
+
for (let i = 0, l = expandValueHand.length; i < l; i++) {
|
|
1113
|
+
const id = expandValueHand[i];
|
|
1172
1114
|
json[id] = {
|
|
1173
|
-
id
|
|
1115
|
+
id,
|
|
1174
1116
|
status: 'develop'
|
|
1175
1117
|
};
|
|
1176
1118
|
}
|
|
1177
1119
|
setExpandableRow(json);
|
|
1178
1120
|
}, [props.expandMultiple, props.expandValue, rowData]);
|
|
1179
1121
|
// 监听禁用嵌套 props.disabledExpand 防止死循环
|
|
1180
|
-
useEffect(
|
|
1181
|
-
|
|
1182
|
-
for (
|
|
1183
|
-
|
|
1122
|
+
useEffect(() => {
|
|
1123
|
+
const json = {};
|
|
1124
|
+
for (let i = 0, l = disabledExpand.length; i < l; i++) {
|
|
1125
|
+
const id = disabledExpand[i];
|
|
1184
1126
|
json[id] = true;
|
|
1185
1127
|
}
|
|
1186
1128
|
setDisabledExpand(json);
|
|
1187
1129
|
}, [props.disabledExpand]);
|
|
1188
|
-
useEffect(
|
|
1130
|
+
useEffect(() => {
|
|
1189
1131
|
if (loadMoreUrl) {
|
|
1190
|
-
|
|
1132
|
+
const bol = Number(total) > Number(page) * Number(currentRowsPerPage);
|
|
1191
1133
|
setShowMoreBtn(bol);
|
|
1192
1134
|
}
|
|
1193
1135
|
}, [loadMoreUrl, total, page, currentRowsPerPage]);
|
|
1194
1136
|
// 处理嵌套表格合并列数
|
|
1195
|
-
useEffect(
|
|
1196
|
-
|
|
1137
|
+
useEffect(() => {
|
|
1138
|
+
let num = headData.length;
|
|
1197
1139
|
if (expandable) num += 1;
|
|
1198
1140
|
if (check) num += 1;
|
|
1199
1141
|
if (radio) num += 1;
|
|
@@ -1202,55 +1144,55 @@ var TableBody = function TableBody(props) {
|
|
|
1202
1144
|
setExpandableColSpan(num);
|
|
1203
1145
|
}, [headData, expandable, check, radio]);
|
|
1204
1146
|
// 展开/收起嵌套表格
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
status: status
|
|
1214
|
-
};
|
|
1215
|
-
if (expandMultiple) {
|
|
1216
|
-
// 展开多个
|
|
1217
|
-
expandableRow[id] = expandItem;
|
|
1218
|
-
setExpandableRow(Object.assign({}, expandableRow));
|
|
1219
|
-
} else {
|
|
1220
|
-
// 展开一个
|
|
1221
|
-
setExpandableRow(_defineProperty({}, id, expandItem));
|
|
1222
|
-
}
|
|
1223
|
-
onExpand && onExpand(row, status);
|
|
1224
|
-
event.stopPropagation();
|
|
1147
|
+
const handClickNestTable = row => event => {
|
|
1148
|
+
const id = row[rowKey];
|
|
1149
|
+
let expandItem = expandableRow[id] || {};
|
|
1150
|
+
let status = 'develop';
|
|
1151
|
+
if (expandItem.status === 'develop') status = 'retract';
|
|
1152
|
+
expandItem = {
|
|
1153
|
+
id,
|
|
1154
|
+
status
|
|
1225
1155
|
};
|
|
1156
|
+
if (expandMultiple) {
|
|
1157
|
+
// 展开多个
|
|
1158
|
+
expandableRow[id] = expandItem;
|
|
1159
|
+
setExpandableRow(Object.assign({}, expandableRow));
|
|
1160
|
+
} else {
|
|
1161
|
+
// 展开一个
|
|
1162
|
+
setExpandableRow({
|
|
1163
|
+
[id]: expandItem
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
onExpand && onExpand(row, status);
|
|
1167
|
+
event.stopPropagation();
|
|
1226
1168
|
};
|
|
1227
1169
|
// 处理class
|
|
1228
|
-
|
|
1229
|
-
|
|
1170
|
+
const handClass = () => {
|
|
1171
|
+
let str = 'table-body';
|
|
1230
1172
|
if (!fixedTable) str += ' table-body-scroll';
|
|
1231
1173
|
// 没有 复选框,单选框,展开 按钮
|
|
1232
1174
|
if (!check && !radio && !expandable) str += ' table-body-no-btn';
|
|
1233
1175
|
return str;
|
|
1234
1176
|
};
|
|
1235
1177
|
// 处理嵌套表格class
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1178
|
+
const handExpandClass = row => {
|
|
1179
|
+
const id = row[rowKey];
|
|
1180
|
+
const expandItem = expandableRow[id] || {};
|
|
1181
|
+
let str = 'retract';
|
|
1240
1182
|
if (expandItem.status === 'develop') {
|
|
1241
1183
|
str = 'expand';
|
|
1242
1184
|
}
|
|
1243
1185
|
return str;
|
|
1244
1186
|
};
|
|
1245
1187
|
// 点击加载更多
|
|
1246
|
-
|
|
1188
|
+
const clickMore = () => {
|
|
1247
1189
|
if (loadMoreUrl) changePage && changePage();
|
|
1248
1190
|
onClickMore && onClickMore();
|
|
1249
1191
|
};
|
|
1250
1192
|
// 暂无数据memo
|
|
1251
|
-
|
|
1193
|
+
const NodataMemo = useMemo(() => {
|
|
1252
1194
|
// 处理刷新按钮
|
|
1253
|
-
|
|
1195
|
+
const handRefreshBtn = () => {
|
|
1254
1196
|
if ((emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.showRefresh) !== undefined) {
|
|
1255
1197
|
return emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.showRefresh;
|
|
1256
1198
|
}
|
|
@@ -1260,8 +1202,8 @@ var TableBody = function TableBody(props) {
|
|
|
1260
1202
|
return false;
|
|
1261
1203
|
};
|
|
1262
1204
|
// 处理className
|
|
1263
|
-
|
|
1264
|
-
|
|
1205
|
+
const handClassNoData = () => {
|
|
1206
|
+
let str = 'table-no-data';
|
|
1265
1207
|
if (emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.size) str += " table-no-data-".concat(emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.size);
|
|
1266
1208
|
return str;
|
|
1267
1209
|
};
|
|
@@ -1274,24 +1216,24 @@ var TableBody = function TableBody(props) {
|
|
|
1274
1216
|
}, {
|
|
1275
1217
|
children: jsx(Empty, Object.assign({}, emptyProps, {
|
|
1276
1218
|
showRefresh: handRefreshBtn(),
|
|
1277
|
-
onRefresh:
|
|
1219
|
+
onRefresh: event => {
|
|
1278
1220
|
if (emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.onRefresh) {
|
|
1279
1221
|
emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.onRefresh(event);
|
|
1280
1222
|
return;
|
|
1281
1223
|
}
|
|
1282
|
-
|
|
1224
|
+
onRefresh && onRefresh();
|
|
1283
1225
|
}
|
|
1284
1226
|
}))
|
|
1285
1227
|
}))
|
|
1286
1228
|
}));
|
|
1287
|
-
}, [expandableColSpan, emptyProps, url,
|
|
1229
|
+
}, [expandableColSpan, emptyProps, url, onRefresh]);
|
|
1288
1230
|
// 复选框useCallback
|
|
1289
|
-
|
|
1231
|
+
const TableCheckCallback = useCallback(row => {
|
|
1290
1232
|
if (check) {
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1233
|
+
const handId = row[rowKey];
|
|
1234
|
+
const disabledHand = Boolean(disabledJson[handId]);
|
|
1235
|
+
let checkHand = checkJson[handId] || false;
|
|
1236
|
+
let showCheck = true;
|
|
1295
1237
|
if (disabledHand && disabledArrStatus) {
|
|
1296
1238
|
// 选中
|
|
1297
1239
|
if (disabledArrStatus[handId] === true) {
|
|
@@ -1306,8 +1248,8 @@ var TableBody = function TableBody(props) {
|
|
|
1306
1248
|
showCheck = false;
|
|
1307
1249
|
}
|
|
1308
1250
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1251
|
+
const handCls = () => {
|
|
1252
|
+
let str = 'table-checkbox table-body-btn';
|
|
1311
1253
|
if (fixedColumn) {
|
|
1312
1254
|
str += ' table-fixed-dom-left';
|
|
1313
1255
|
// 左边没有定位,且没有单选,没有嵌套表格
|
|
@@ -1324,7 +1266,7 @@ var TableBody = function TableBody(props) {
|
|
|
1324
1266
|
children: showCheck && jsx(Checkbox, {
|
|
1325
1267
|
disabled: disabledHand,
|
|
1326
1268
|
checked: checkHand,
|
|
1327
|
-
onChange:
|
|
1269
|
+
onChange: (event, bol) => {
|
|
1328
1270
|
event.stopPropagation();
|
|
1329
1271
|
selectCheck && selectCheck(event, bol, row[rowKey]);
|
|
1330
1272
|
}
|
|
@@ -1333,12 +1275,12 @@ var TableBody = function TableBody(props) {
|
|
|
1333
1275
|
}
|
|
1334
1276
|
}, [check, disabledJson, rowKey, checkJson, selectCheck, disabledArrStatus, posFixed, expandable, radio, fixedColumn]);
|
|
1335
1277
|
// 单选框useCallback
|
|
1336
|
-
|
|
1278
|
+
const TableRadioCallback = useCallback(row => {
|
|
1337
1279
|
if (radio) {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1280
|
+
const handId = row[rowKey];
|
|
1281
|
+
const disabledHand = Boolean(disabledJson[handId]);
|
|
1282
|
+
let checkHand = radioValue === row[rowKey];
|
|
1283
|
+
let showRadio = true;
|
|
1342
1284
|
if (disabledHand && disabledArrStatus) {
|
|
1343
1285
|
// 选中
|
|
1344
1286
|
if (disabledArrStatus[handId] === true) {
|
|
@@ -1353,8 +1295,8 @@ var TableBody = function TableBody(props) {
|
|
|
1353
1295
|
showRadio = false;
|
|
1354
1296
|
}
|
|
1355
1297
|
}
|
|
1356
|
-
|
|
1357
|
-
|
|
1298
|
+
const handCls = () => {
|
|
1299
|
+
let str = 'table-radio table-body-btn';
|
|
1358
1300
|
if (fixedColumn) {
|
|
1359
1301
|
str += ' table-fixed-dom-left';
|
|
1360
1302
|
// 左边没有定位,没有嵌套表格
|
|
@@ -1371,7 +1313,7 @@ var TableBody = function TableBody(props) {
|
|
|
1371
1313
|
children: showRadio && jsx(Radio, {
|
|
1372
1314
|
disabled: disabledHand,
|
|
1373
1315
|
checked: checkHand,
|
|
1374
|
-
onChange:
|
|
1316
|
+
onChange: event => {
|
|
1375
1317
|
event.stopPropagation();
|
|
1376
1318
|
selectRadio && selectRadio(event, row[rowKey]);
|
|
1377
1319
|
}
|
|
@@ -1380,13 +1322,13 @@ var TableBody = function TableBody(props) {
|
|
|
1380
1322
|
}
|
|
1381
1323
|
}, [radio, disabledJson, radioValue, rowKey, selectRadio, disabledArrStatus, expandable, posFixed, fixedColumn]);
|
|
1382
1324
|
// 嵌套加减useCallback
|
|
1383
|
-
|
|
1325
|
+
const TableExpandableMemo = useCallback(row => {
|
|
1384
1326
|
if (!expandable) return null;
|
|
1385
|
-
|
|
1327
|
+
const expandableDemo = expandable(row);
|
|
1386
1328
|
// 禁用一行表格展开 或者 展开表格返回值为false,返回空列
|
|
1387
1329
|
if (disabledExpandJson[row[rowKey]] || expandableDemo === false) return jsx(TdElement, {});
|
|
1388
|
-
|
|
1389
|
-
|
|
1330
|
+
const handCls = () => {
|
|
1331
|
+
let str = 'table-expandable table-body-btn';
|
|
1390
1332
|
if (fixedColumn) {
|
|
1391
1333
|
str += ' table-fixed-dom-left';
|
|
1392
1334
|
// 左边没有定位,没有嵌套表格
|
|
@@ -1407,17 +1349,17 @@ var TableBody = function TableBody(props) {
|
|
|
1407
1349
|
}));
|
|
1408
1350
|
}, [expandable, expandableRow, rowKey, disabledExpandJson, onExpand, fixedColumn]);
|
|
1409
1351
|
// 表格一行内容useCallback
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
orderFieldArr
|
|
1413
|
-
orderTypeArr
|
|
1352
|
+
const TableContentUseCallback = useCallback((row, rowIndex) => {
|
|
1353
|
+
const params = {
|
|
1354
|
+
orderFieldArr,
|
|
1355
|
+
orderTypeArr
|
|
1414
1356
|
};
|
|
1415
|
-
|
|
1416
|
-
|
|
1357
|
+
const handContentClass = item => {
|
|
1358
|
+
let str = 'table-content-columms';
|
|
1417
1359
|
if (item.className) str += " ".concat(item.className);
|
|
1418
1360
|
// 排序
|
|
1419
1361
|
if (sortTable && item.name && item.sort !== false) {
|
|
1420
|
-
|
|
1362
|
+
const index = orderFieldArr.indexOf(item.name);
|
|
1421
1363
|
if (index !== -1) {
|
|
1422
1364
|
// 升序
|
|
1423
1365
|
if (orderTypeArr[index] === 'asc') {
|
|
@@ -1442,8 +1384,8 @@ var TableBody = function TableBody(props) {
|
|
|
1442
1384
|
}
|
|
1443
1385
|
return str;
|
|
1444
1386
|
};
|
|
1445
|
-
|
|
1446
|
-
|
|
1387
|
+
const handStyle = item => {
|
|
1388
|
+
const json = {};
|
|
1447
1389
|
if (fixedColumn && item.fixed && item.width) {
|
|
1448
1390
|
if (item.fixed === 'left') {
|
|
1449
1391
|
json.left = "".concat(item.paraui_left_width, "px");
|
|
@@ -1454,12 +1396,12 @@ var TableBody = function TableBody(props) {
|
|
|
1454
1396
|
}
|
|
1455
1397
|
return json;
|
|
1456
1398
|
};
|
|
1457
|
-
return tableCell ? tableCell(row, params) : headData.map(
|
|
1458
|
-
|
|
1459
|
-
|
|
1399
|
+
return tableCell ? tableCell(row, params) : headData.map((item, index) => {
|
|
1400
|
+
let text = row[item.name];
|
|
1401
|
+
let colSpan = 1;
|
|
1460
1402
|
if (item.render) text = item.render(row, item, row[item.name], index, rowIndex);
|
|
1461
1403
|
if (formatter) text = formatter(row, item, row[item.name], index, rowIndex);
|
|
1462
|
-
|
|
1404
|
+
const itemStyle = handStyle(item);
|
|
1463
1405
|
// 存在显示列,最后一列占两格
|
|
1464
1406
|
if (showColumns === 'inside' && !operate && index === headData.length - 1) {
|
|
1465
1407
|
colSpan = 2;
|
|
@@ -1483,25 +1425,25 @@ var TableBody = function TableBody(props) {
|
|
|
1483
1425
|
});
|
|
1484
1426
|
}, [tableCell, headData, align, formatter, orderFieldArr, orderTypeArr, sortTable, showColumns, operate, beyondText, fixedColumn, tipMaxWidth]);
|
|
1485
1427
|
// 操作栏useCallback
|
|
1486
|
-
|
|
1428
|
+
const TableOperateUseCallback = useCallback((row, rowIndex) => {
|
|
1487
1429
|
if (operate) {
|
|
1488
|
-
|
|
1430
|
+
let colSpan = 1;
|
|
1489
1431
|
if (showColumns === 'inside') colSpan = 2;
|
|
1490
|
-
|
|
1432
|
+
const handOperate = () => {
|
|
1491
1433
|
if (operate.render) return operate.render(row);
|
|
1492
1434
|
if (operate.operateBtnRender) {
|
|
1493
|
-
|
|
1435
|
+
const operateConfig = operate.operateBtnRender(row, rowIndex);
|
|
1494
1436
|
return jsx(OperateBtn, Object.assign({}, operateConfig));
|
|
1495
1437
|
}
|
|
1496
1438
|
};
|
|
1497
|
-
|
|
1498
|
-
|
|
1439
|
+
const handStyle = () => {
|
|
1440
|
+
const json = {
|
|
1499
1441
|
right: '0'
|
|
1500
1442
|
};
|
|
1501
1443
|
return json;
|
|
1502
1444
|
};
|
|
1503
|
-
|
|
1504
|
-
|
|
1445
|
+
const handCls = () => {
|
|
1446
|
+
let str = 'table-operate';
|
|
1505
1447
|
if (fixedColumn) {
|
|
1506
1448
|
str += ' table-fixed-dom-right';
|
|
1507
1449
|
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
@@ -1521,11 +1463,11 @@ var TableBody = function TableBody(props) {
|
|
|
1521
1463
|
}
|
|
1522
1464
|
}, [operate, align, showColumns, posFixed, fixedColumn]);
|
|
1523
1465
|
// 嵌套表格useCallback
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1466
|
+
const TableExpandableContentUseCallback = useCallback(row => {
|
|
1467
|
+
const id = row[rowKey];
|
|
1468
|
+
const expandItem = expandableRow[id] || {};
|
|
1527
1469
|
if (expandable && expandItem.status === 'develop') {
|
|
1528
|
-
|
|
1470
|
+
const expandableDemo = expandable(row);
|
|
1529
1471
|
if (expandableDemo === false) return null; // 展开表格返回值为false,不展示这一行
|
|
1530
1472
|
return jsx(TrElement, Object.assign({
|
|
1531
1473
|
className: "table-body-expand-row"
|
|
@@ -1540,7 +1482,7 @@ var TableBody = function TableBody(props) {
|
|
|
1540
1482
|
}
|
|
1541
1483
|
}, [expandable, expandableRow, expandableColSpan, rowKey]);
|
|
1542
1484
|
// 加载更多
|
|
1543
|
-
|
|
1485
|
+
const MoreMemo = useMemo(() => {
|
|
1544
1486
|
if (!loadMore || !showMoreBtn) return null;
|
|
1545
1487
|
return jsx(TrElement, Object.assign({
|
|
1546
1488
|
className: "more-table-row",
|
|
@@ -1563,10 +1505,10 @@ var TableBody = function TableBody(props) {
|
|
|
1563
1505
|
}))
|
|
1564
1506
|
}));
|
|
1565
1507
|
}, [expandableColSpan, loadMore, loadMoreRender, onClickMore, showMoreBtn, changePage, loadMoreUrl, lineHeight]);
|
|
1566
|
-
|
|
1508
|
+
const TableBodySubjectContentMemo = useMemo(() => {
|
|
1567
1509
|
return jsx(Fragment, {
|
|
1568
|
-
children: rowData.map(
|
|
1569
|
-
|
|
1510
|
+
children: rowData.map((row, index) => {
|
|
1511
|
+
let str = 'table-body-row';
|
|
1570
1512
|
if (rowClassMapping && rowClassMapping[row[rowKey]]) {
|
|
1571
1513
|
str += " ".concat(rowClassMapping[row[rowKey]]);
|
|
1572
1514
|
}
|
|
@@ -1576,7 +1518,7 @@ var TableBody = function TableBody(props) {
|
|
|
1576
1518
|
style: {
|
|
1577
1519
|
height: "".concat(lineHeight, "px")
|
|
1578
1520
|
},
|
|
1579
|
-
onClick:
|
|
1521
|
+
onClick: e => {
|
|
1580
1522
|
onClickRow && onClickRow(row, e);
|
|
1581
1523
|
}
|
|
1582
1524
|
}, {
|
|
@@ -1587,13 +1529,13 @@ var TableBody = function TableBody(props) {
|
|
|
1587
1529
|
});
|
|
1588
1530
|
}, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, disabledExpandJson, onExpand, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight]);
|
|
1589
1531
|
// 内容memo
|
|
1590
|
-
|
|
1532
|
+
const TableBodyContentMemo = useMemo(() => {
|
|
1591
1533
|
return jsxs(Fragment$1, {
|
|
1592
1534
|
children: [TableBodySubjectContentMemo, MoreMemo]
|
|
1593
1535
|
});
|
|
1594
1536
|
}, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, loadMore, loadMoreRender, onClickMore, changePage, loadMoreUrl, disabledExpandJson, onExpand, showMoreBtn, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight]);
|
|
1595
1537
|
// 处理内容
|
|
1596
|
-
|
|
1538
|
+
const handContent = () => {
|
|
1597
1539
|
// 无数据,且不再请求,显示暂无数据
|
|
1598
1540
|
if (rowData.length === 0 && !loadState) return NodataMemo;
|
|
1599
1541
|
return TableBodyContentMemo;
|
|
@@ -1605,35 +1547,29 @@ var TableBody = function TableBody(props) {
|
|
|
1605
1547
|
}));
|
|
1606
1548
|
};
|
|
1607
1549
|
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
checkNumber =
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
setIndeterminate = _useState2[1]; // 半选中
|
|
1632
|
-
var _useState3 = useState(false),
|
|
1633
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1634
|
-
checked = _useState4[0],
|
|
1635
|
-
setChecked = _useState4[1]; // 选中
|
|
1636
|
-
useEffect(function () {
|
|
1550
|
+
const TableHead = props => {
|
|
1551
|
+
const {
|
|
1552
|
+
paginationType,
|
|
1553
|
+
flippingArrow,
|
|
1554
|
+
autoPagination,
|
|
1555
|
+
total,
|
|
1556
|
+
page,
|
|
1557
|
+
rowsPerPage,
|
|
1558
|
+
currentRowsPerPage,
|
|
1559
|
+
changePage,
|
|
1560
|
+
changeRowsPerPage,
|
|
1561
|
+
refreshInside,
|
|
1562
|
+
checkCount,
|
|
1563
|
+
onRefresh,
|
|
1564
|
+
selectAll,
|
|
1565
|
+
selectStatus,
|
|
1566
|
+
checkNumber = 0,
|
|
1567
|
+
currentPageTotal = 0
|
|
1568
|
+
} = props;
|
|
1569
|
+
const intl = useFormatMessage('Table', localeJson);
|
|
1570
|
+
const [indeterminate, setIndeterminate] = useState(false); // 半选中
|
|
1571
|
+
const [checked, setChecked] = useState(false); // 选中
|
|
1572
|
+
useEffect(() => {
|
|
1637
1573
|
// 全选
|
|
1638
1574
|
if (selectStatus === 'all') {
|
|
1639
1575
|
setChecked(true);
|
|
@@ -1655,23 +1591,23 @@ var TableHead = function TableHead(props) {
|
|
|
1655
1591
|
* @param event 操作元素
|
|
1656
1592
|
* @param bol 选中 / 不选中
|
|
1657
1593
|
*/
|
|
1658
|
-
|
|
1594
|
+
const onSelectAll = (event, bol) => {
|
|
1659
1595
|
if (selectAll) selectAll(event, bol);
|
|
1660
1596
|
};
|
|
1661
1597
|
// 改变页面
|
|
1662
|
-
|
|
1598
|
+
const changePageCom = num => {
|
|
1663
1599
|
changePage && changePage(num);
|
|
1664
1600
|
};
|
|
1665
1601
|
// 改变每页显示条数
|
|
1666
|
-
|
|
1602
|
+
const changeRowsPerPageCom = num => {
|
|
1667
1603
|
changeRowsPerPage && changeRowsPerPage(num);
|
|
1668
1604
|
};
|
|
1669
1605
|
// 刷新
|
|
1670
|
-
|
|
1606
|
+
const clickRefresh = () => {
|
|
1671
1607
|
onRefresh && onRefresh();
|
|
1672
1608
|
};
|
|
1673
1609
|
// 处理分页右侧
|
|
1674
|
-
|
|
1610
|
+
const handlePaginationRight = () => {
|
|
1675
1611
|
if (!checkCount) return null;
|
|
1676
1612
|
return jsxs("div", Object.assign({
|
|
1677
1613
|
className: 'table-pagination-right'
|
|
@@ -1694,8 +1630,8 @@ var TableHead = function TableHead(props) {
|
|
|
1694
1630
|
}));
|
|
1695
1631
|
};
|
|
1696
1632
|
// 处理样式
|
|
1697
|
-
|
|
1698
|
-
|
|
1633
|
+
const handleClass = () => {
|
|
1634
|
+
const str = 'table-pagination';
|
|
1699
1635
|
return str;
|
|
1700
1636
|
};
|
|
1701
1637
|
return jsxs("div", Object.assign({
|
|
@@ -1712,9 +1648,7 @@ var TableHead = function TableHead(props) {
|
|
|
1712
1648
|
currentRowsPerPage: currentRowsPerPage,
|
|
1713
1649
|
changePage: changePageCom,
|
|
1714
1650
|
changeRowsPerPage: changeRowsPerPageCom,
|
|
1715
|
-
getPopupContainer:
|
|
1716
|
-
return document.body;
|
|
1717
|
-
}
|
|
1651
|
+
getPopupContainer: () => document.body
|
|
1718
1652
|
}), refreshInside && jsx(Button.IconButton, Object.assign({
|
|
1719
1653
|
className: 'refresh-btn',
|
|
1720
1654
|
variant: "outlined",
|
|
@@ -1728,14 +1662,16 @@ var TableHead = function TableHead(props) {
|
|
|
1728
1662
|
var css_248z$2 = ".table-container {\n overflow-x: auto;\n}";
|
|
1729
1663
|
styleInject(css_248z$2);
|
|
1730
1664
|
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1665
|
+
const TableContainer = props => {
|
|
1666
|
+
const {
|
|
1667
|
+
cRef,
|
|
1668
|
+
className,
|
|
1669
|
+
style,
|
|
1670
|
+
children
|
|
1671
|
+
} = props,
|
|
1736
1672
|
otherProps = __rest(props, ["cRef", "className", "style", "children"]);
|
|
1737
|
-
|
|
1738
|
-
|
|
1673
|
+
const handClass = () => {
|
|
1674
|
+
let str = 'table-container';
|
|
1739
1675
|
if (className) str += " ".concat(className);
|
|
1740
1676
|
return str;
|
|
1741
1677
|
};
|
|
@@ -1751,14 +1687,16 @@ var TableContainer = function TableContainer(props) {
|
|
|
1751
1687
|
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.table-element {\n width: 100%;\n display: table;\n border-collapse: separate;\n border-spacing: 0;\n}\n.table-element.table-element-fixed-column > .table-body-element > .tr-element > .td-element {\n position: sticky;\n}\n.table-element > .table-head-element > .tr-element > .th-element {\n position: sticky;\n top: 0;\n z-index: 10;\n}\n.table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-left.table-fixed-dom-left-last::after {\n height: 100%;\n width: 30px;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(100%);\n content: \"\";\n transition: box-shadow 0.3s;\n pointer-events: none;\n}\n.table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-right.table-fixed-dom-right-first::after {\n height: 100%;\n width: 30px;\n position: absolute;\n top: 0;\n left: 0;\n transform: translate(-100%);\n content: \"\";\n transition: box-shadow 0.3s;\n pointer-events: none;\n}\n.table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-left {\n z-index: 11;\n}\n.table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-right {\n z-index: 11;\n}\n.table-element > .table-body-element > .tr-element > .td-element {\n z-index: 1;\n}\n.table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-left.table-fixed-dom-left-last::after {\n height: 100%;\n width: 30px;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(100%);\n content: \"\";\n transition: box-shadow 0.3s;\n pointer-events: none;\n}\n.table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-right.table-fixed-dom-right-first::after {\n height: 100%;\n width: 30px;\n position: absolute;\n top: 0;\n left: 0;\n transform: translate(-100%);\n content: \"\";\n transition: box-shadow 0.3s;\n pointer-events: none;\n}\n.table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-left {\n z-index: 2;\n}\n.table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-right {\n z-index: 2;\n}\n\n.table-scroll-left .table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-right.table-fixed-dom-right-first::after {\n box-shadow: inset -10px 0 10px -8px rgb(234, 236, 241);\n}\n.table-scroll-left .table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-right.table-fixed-dom-right-first::after {\n box-shadow: inset -10px 0 10px -8px rgb(234, 236, 241);\n}\n\n.table-scroll-right .table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-left.table-fixed-dom-left-last::after {\n box-shadow: inset 10px 0 10px -8px rgb(234, 236, 241);\n}\n.table-scroll-right .table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-left.table-fixed-dom-left-last::after {\n box-shadow: inset 10px 0 10px -8px rgb(234, 236, 241);\n}\n\n.table-scroll-middle .table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-left.table-fixed-dom-left-last::after {\n box-shadow: inset 10px 0 10px -8px rgb(234, 236, 241);\n}\n.table-scroll-middle .table-element > .table-head-element > .tr-element > .th-element.table-fixed-dom-right.table-fixed-dom-right-first::after {\n box-shadow: inset -10px 0 10px -8px rgb(234, 236, 241);\n}\n.table-scroll-middle .table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-left.table-fixed-dom-left-last::after {\n box-shadow: inset 10px 0 10px -8px rgb(234, 236, 241);\n}\n.table-scroll-middle .table-element > .table-body-element > .tr-element > .td-element.table-fixed-dom-right.table-fixed-dom-right-first::after {\n box-shadow: inset -10px 0 10px -8px rgb(234, 236, 241);\n}";
|
|
1752
1688
|
styleInject(css_248z$1);
|
|
1753
1689
|
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1690
|
+
const TableElement = props => {
|
|
1691
|
+
const {
|
|
1692
|
+
className,
|
|
1693
|
+
style,
|
|
1694
|
+
fixedColumn,
|
|
1695
|
+
children
|
|
1696
|
+
} = props,
|
|
1759
1697
|
otherProps = __rest(props, ["className", "style", "fixedColumn", "children"]);
|
|
1760
|
-
|
|
1761
|
-
|
|
1698
|
+
const handClass = () => {
|
|
1699
|
+
let str = 'table-element';
|
|
1762
1700
|
if (fixedColumn) str += ' table-element-fixed-column';
|
|
1763
1701
|
if (className) str += " ".concat(className);
|
|
1764
1702
|
return str;
|
|
@@ -1771,212 +1709,115 @@ var TableElement = function TableElement(props) {
|
|
|
1771
1709
|
}));
|
|
1772
1710
|
};
|
|
1773
1711
|
|
|
1774
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-table {\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n position: relative;\n}\n.paraui-v4-table.paraui-v4-table-draggable * {\n user-select: none !important;\n}\n.paraui-v4-table.paraui-v4-table-fixed-table > .table-contain > table {\n table-layout: fixed;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-checkbox {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-radio {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-expandable {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-radio.paraui-v4-table-check .table-radio {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check .table-expandable {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check.paraui-v4-table-radio .table-expandable {\n left: 80px;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table .paraui-v4-empty {\n overflow: hidden;\n}\n.paraui-v4-table.paraui-v4-table-load.paraui-v4-table-no-data > .table-container > table {\n height: auto;\n}\n.paraui-v4-table.paraui-v4-table-pagination > .table-contain {\n height: calc(100% - 60px);\n}\n.paraui-v4-table.paraui-v4-table-pagination.table-load-more > .table-contain {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-load-more.paraui-v4-table-pagination > .table-contain {\n height: 100%;\n}\n.paraui-v4-table > .table-contain {\n height: 100%;\n position: relative;\n}\n.paraui-v4-table > .table-contain > table {\n height: auto;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-expandable > svg {\n vertical-align: middle;\n}\n.paraui-v4-table > .table-contain > table > .table-head {\n width: 100%;\n white-space: nowrap;\n}\n.paraui-v4-table > .table-contain > table > .table-head > tr th {\n height: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-scroll tr th {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-serial-number .table-header-box .table-header-title {\n padding-right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box {\n height: 47px;\n line-height: 47px;\n position: relative;\n padding: 0 8px;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title {\n max-width: 100%;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-header-title-label {\n width: 100%;\n color: rgb(92, 101, 115);\n font-weight: 700;\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span {\n width: 20px;\n height: 20px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > svg {\n font-size: 12px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .up-svg {\n position: relative;\n top: 3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .down-svg {\n position: relative;\n top: -3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span {\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span > svg {\n font-size: 14px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-show > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span:after {\n position: absolute;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: rgb(244, 66, 66);\n content: \"\";\n right: 3px;\n top: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-filter > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort.table-header-box-filter > .table-header-title {\n max-width: calc(100% - 40px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-asc > .table-sort-svg > span > .up-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-desc > .table-sort-svg > span > .down-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums {\n width: 53px;\n cursor: pointer;\n border-left: 1px solid rgb(234, 236, 241);\n right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box > svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-no-btn tr th:first-child .table-header-box {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn > .table-header-box {\n width: 32px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child > .table-header-box {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body {\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-scroll tr td {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td {\n background-color: white;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate {\n padding-right: 16px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:nth-of-type(2n) td {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:hover td {\n background-color: rgb(240, 245, 255);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg {\n transition: all 0.3s;\n cursor: pointer;\n font-size: 18px;\n color: rgb(92, 101, 115);\n transform: rotate(270deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > .expand {\n transform: rotate(360deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row {\n cursor: pointer;\n position: sticky;\n bottom: 0;\n z-index: 10;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row .more-btn {\n color: rgb(46, 101, 230);\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row > .td-element {\n position: relative;\n background: white;\n box-shadow: 4px -4px 8px 0px rgb(234, 236, 241);\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr td:first-child {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr.more-table-row td:first-child {\n padding-left: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn > .table-no-data > td:first-child {\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data {\n height: calc(100% - 50px);\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data:hover td {\n background-color: white;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data > td {\n padding: 56px 0 0 0;\n}\n.paraui-v4-table > .table-contain > .table-pos-line {\n position: absolute;\n top: 0;\n width: 1px;\n background-color: rgb(46, 101, 230);\n z-index: 1000;\n}\n.paraui-v4-table > .table-pagination {\n width: 100%;\n height: 60px;\n display: flex;\n align-items: flex-end;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right {\n display: flex;\n height: 32px;\n align-items: center;\n color: rgb(29, 33, 38);\n line-height: 32px;\n padding-left: 16px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .all-select {\n margin-left: 12px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .line {\n width: 1px;\n height: 12px;\n background-color: rgb(212, 218, 227);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .check-number {\n width: 65px;\n display: inline-block;\n}\n.paraui-v4-table > .table-pagination .table-pagination-com {\n flex: 1;\n justify-content: flex-end;\n}\n.paraui-v4-table > .table-pagination .refresh-btn {\n margin-left: 20px;\n}\n\n.paraui-v4-table-show-colums-popover > .component-popover-content {\n min-width: 200px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled {\n cursor: inherit;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled > span {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled:hover {\n background: transparent;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button {\n width: 100%;\n height: 100%;\n margin: 0;\n}\n\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button {\n width: 50%;\n height: 100%;\n margin: 0;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select.filter-select-none {\n text-align: center;\n padding: 20px 0;\n}\n.paraui-v4-filter-popover.paraui-v4-filter-popover-default > .component-popover-content {\n min-width: 200px;\n}";
|
|
1712
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-table {\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n position: relative;\n}\n.paraui-v4-table.paraui-v4-table-draggable * {\n user-select: none !important;\n}\n.paraui-v4-table.paraui-v4-table-fixed-table > .table-contain > table {\n table-layout: fixed;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-checkbox {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-radio {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn > .table-contain > table .table-expandable {\n left: 0;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-radio.paraui-v4-table-check .table-radio {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check .table-expandable {\n left: 48px;\n}\n.paraui-v4-table.paraui-v4-table-fixed-cloumn.paraui-v4-table-expandable.paraui-v4-table-check.paraui-v4-table-radio .table-expandable {\n left: 80px;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-no-data > .table-container > table .paraui-v4-empty {\n overflow: hidden;\n}\n.paraui-v4-table.paraui-v4-table-load.paraui-v4-table-no-data > .table-container > table {\n height: auto;\n}\n.paraui-v4-table.paraui-v4-table-pagination > .table-contain {\n height: calc(100% - 36px);\n}\n.paraui-v4-table.paraui-v4-table-pagination.table-load-more > .table-contain {\n height: 100%;\n}\n.paraui-v4-table.paraui-v4-table-load-more.paraui-v4-table-pagination > .table-contain {\n height: 100%;\n}\n.paraui-v4-table > .table-contain {\n height: 100%;\n position: relative;\n}\n.paraui-v4-table > .table-contain > table {\n height: auto;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-checkbox .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-radio .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table .table-expandable > svg {\n vertical-align: middle;\n}\n.paraui-v4-table > .table-contain > table > .table-head {\n width: 100%;\n white-space: nowrap;\n}\n.paraui-v4-table > .table-contain > table > .table-head > tr th {\n height: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-scroll tr th {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-serial-number .table-header-box .table-header-title {\n padding-right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box {\n height: 47px;\n line-height: 47px;\n position: relative;\n padding: 0 8px;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title {\n max-width: 100%;\n display: flex;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-header-title-label {\n width: 100%;\n color: rgb(92, 101, 115);\n font-weight: 700;\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span {\n width: 20px;\n height: 20px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > svg {\n font-size: 12px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .up-svg {\n position: relative;\n top: 3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .down-svg {\n position: relative;\n top: -3px;\n transform: scale(0.8);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span {\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n border-radius: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover {\n background-color: rgba(46, 101, 230, 0.1);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span > svg {\n font-size: 14px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-show > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span:after {\n position: absolute;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: rgb(244, 66, 66);\n content: \"\";\n right: 3px;\n top: 2px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-filter > .table-header-title {\n padding-right: 8px;\n max-width: calc(100% - 20px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort.table-header-box-filter > .table-header-title {\n max-width: calc(100% - 40px);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-asc > .table-sort-svg > span > .up-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-desc > .table-sort-svg > span > .down-svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums {\n width: 53px;\n cursor: pointer;\n border-left: 1px solid rgb(234, 236, 241);\n right: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box > svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-table > .table-contain > table > .table-head .show-colums .table-header-box:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-head.table-head-no-btn tr th:first-child .table-header-box {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn > .table-header-box {\n width: 32px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-head .table-head-btn:first-child > .table-header-box {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body {\n width: 100%;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-scroll tr td {\n max-width: 240px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td {\n background-color: white;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate {\n padding-right: 16px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:nth-of-type(2n) td {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr:hover td {\n background-color: rgb(240, 245, 255);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg {\n transition: all 0.3s;\n cursor: pointer;\n font-size: 18px;\n color: rgb(92, 101, 115);\n transform: rotate(270deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > svg:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-table > .table-contain > table > .table-body tr .table-expandable > .expand {\n transform: rotate(360deg);\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row {\n cursor: pointer;\n position: sticky;\n bottom: 0;\n z-index: 10;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row .more-btn {\n color: rgb(46, 101, 230);\n font-size: 14px;\n}\n.paraui-v4-table > .table-contain > table > .table-body .more-table-row > .td-element {\n position: relative;\n background: white;\n box-shadow: 4px -4px 8px 0px rgb(234, 236, 241);\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr td:first-child {\n padding-left: 20px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn tr.more-table-row td:first-child {\n padding-left: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body.table-body-no-btn > .table-no-data > td:first-child {\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v4-table > .table-contain > table > .table-body .table-body-btn:first-child {\n width: 48px;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data {\n height: calc(100% - 50px);\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data:hover td {\n background-color: white;\n}\n.paraui-v4-table > .table-contain > table > .table-body > .table-no-data > td {\n padding: 56px 0 0 0;\n}\n.paraui-v4-table > .table-contain > .table-pos-line {\n position: absolute;\n top: 0;\n width: 1px;\n background-color: rgb(46, 101, 230);\n z-index: 1000;\n}\n.paraui-v4-table > .table-pagination {\n width: 100%;\n height: 36px;\n display: flex;\n align-items: flex-end;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right {\n display: flex;\n height: 32px;\n align-items: center;\n color: rgb(29, 33, 38);\n line-height: 32px;\n padding-left: 16px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .all-select {\n margin-left: 12px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .line {\n width: 1px;\n height: 12px;\n background-color: rgb(212, 218, 227);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-pagination .table-pagination-right .check-number {\n width: 65px;\n display: inline-block;\n}\n.paraui-v4-table > .table-pagination .table-pagination-com {\n flex: 1;\n justify-content: flex-end;\n}\n.paraui-v4-table > .table-pagination .refresh-btn {\n margin-left: 20px;\n}\n\n.paraui-v4-table-show-colums-popover > .component-popover-content {\n min-width: 200px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled {\n cursor: inherit;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled > span {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-disabled:hover {\n background: transparent;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button {\n width: 100%;\n height: 100%;\n margin: 0;\n}\n\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box {\n padding-top: 4px;\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item {\n height: 30px;\n line-height: 30px;\n cursor: pointer;\n display: flex;\n padding: 0 10px;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > span {\n padding-left: 8px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 14px);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item:hover {\n background: rgb(247, 248, 250);\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer {\n height: 36px;\n border-top: 1px solid rgb(247, 248, 250);\n text-align: center;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button {\n width: 50%;\n height: 100%;\n margin: 0;\n}\n.paraui-v4-filter-popover > .component-popover-content .filter-select.filter-select-none {\n text-align: center;\n padding: 20px 0;\n}\n.paraui-v4-filter-popover.paraui-v4-filter-popover-default > .component-popover-content {\n min-width: 200px;\n}";
|
|
1775
1713
|
styleInject(css_248z);
|
|
1776
1714
|
|
|
1777
|
-
|
|
1778
|
-
|
|
1715
|
+
const Table = propsInit => {
|
|
1716
|
+
const props = useGlobalProps(propsInit, 'Table');
|
|
1779
1717
|
// 判断浏览器
|
|
1780
|
-
|
|
1718
|
+
const Browser = GetBrowserClass();
|
|
1781
1719
|
if (Browser === 'ie') {
|
|
1782
1720
|
// IE浏览器没有固定列
|
|
1783
1721
|
props.fixedColumn = false;
|
|
1784
1722
|
}
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
method =
|
|
1792
|
-
data
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1884
|
-
pageCom = _useState2[0],
|
|
1885
|
-
setPageCom = _useState2[1]; // 页数
|
|
1886
|
-
var _useState3 = useState(null),
|
|
1887
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1888
|
-
sizeCom = _useState4[0],
|
|
1889
|
-
setSizeCom = _useState4[1]; // 每页条数
|
|
1890
|
-
var _useState5 = useState(sizeArr),
|
|
1891
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
1892
|
-
sizeArrCom = _useState6[0],
|
|
1893
|
-
setSizeArrCom = _useState6[1]; // 每页条数数组
|
|
1894
|
-
var _useState7 = useState(0),
|
|
1895
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
1896
|
-
total = _useState8[0],
|
|
1897
|
-
setTotal = _useState8[1]; // 总数
|
|
1898
|
-
var _useState9 = useState([]),
|
|
1899
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
1900
|
-
rowData = _useState10[0],
|
|
1901
|
-
setRowData = _useState10[1]; // 当前页数据
|
|
1902
|
-
var _useState11 = useState({}),
|
|
1903
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
1904
|
-
rowDataJson = _useState12[0],
|
|
1905
|
-
setRowDataJson = _useState12[1]; // 当前页数据对象
|
|
1906
|
-
var _useState13 = useState({}),
|
|
1907
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
1908
|
-
totalDataJson = _useState14[0],
|
|
1909
|
-
setTotalDataJson = _useState14[1]; // 数据总数对象--用来分页记录数据的
|
|
1910
|
-
var _useState15 = useState(Object.values(defaultSortValue || {})),
|
|
1911
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
1912
|
-
orderTypeArr = _useState16[0],
|
|
1913
|
-
setOrderTypeArr = _useState16[1]; // 排序类型
|
|
1914
|
-
var _useState17 = useState(Object.keys(defaultSortValue || {})),
|
|
1915
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
1916
|
-
orderFieldArr = _useState18[0],
|
|
1917
|
-
setOrderFieldArr = _useState18[1]; // 排序字段
|
|
1918
|
-
var _useState19 = useState('not'),
|
|
1919
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
1920
|
-
headSelectStatus = _useState20[0],
|
|
1921
|
-
setHeadSelectStatus = _useState20[1]; // 表格头复选框状态
|
|
1922
|
-
var _useState21 = useState({}),
|
|
1923
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
1924
|
-
checkJson = _useState22[0],
|
|
1925
|
-
setCheckJson = _useState22[1]; // 多选 选中的数据
|
|
1926
|
-
var _useState23 = useState(),
|
|
1927
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
1928
|
-
radioValue = _useState24[0],
|
|
1929
|
-
setRadioValue = _useState24[1]; // 单选 选中的数据
|
|
1930
|
-
var _useState25 = useState({}),
|
|
1931
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
1932
|
-
disabledJson = _useState26[0],
|
|
1933
|
-
setDisabledJson = _useState26[1]; // 禁用对象
|
|
1934
|
-
var _useState27 = useState({}),
|
|
1935
|
-
_useState28 = _slicedToArray(_useState27, 2),
|
|
1936
|
-
originalHead = _useState28[0],
|
|
1937
|
-
setOriginalHead = _useState28[1]; // 接口原数据表头json
|
|
1938
|
-
var _useState29 = useState([]),
|
|
1939
|
-
_useState30 = _slicedToArray(_useState29, 2),
|
|
1940
|
-
showHeadList = _useState30[0],
|
|
1941
|
-
setShowHeadList = _useState30[1]; // 显示列下拉值 所有头部的配置
|
|
1942
|
-
var _useState31 = useState([]),
|
|
1943
|
-
_useState32 = _slicedToArray(_useState31, 2),
|
|
1944
|
-
headDataCom = _useState32[0],
|
|
1945
|
-
setHeadDataCom = _useState32[1]; // 表格当前显示列 集合本地数据
|
|
1946
|
-
var _useState33 = useState(Object.assign({}, defaultFilterValue)),
|
|
1947
|
-
_useState34 = _slicedToArray(_useState33, 2),
|
|
1948
|
-
selectFilterCom = _useState34[0],
|
|
1949
|
-
setSelectFilterCom = _useState34[1]; // 过滤值
|
|
1950
|
-
var _useState35 = useState(true),
|
|
1951
|
-
_useState36 = _slicedToArray(_useState35, 2),
|
|
1952
|
-
loadState = _useState36[0],
|
|
1953
|
-
setLoadState = _useState36[1]; // 加载进度条状态
|
|
1954
|
-
var _useState37 = useState(false),
|
|
1955
|
-
_useState38 = _slicedToArray(_useState37, 2),
|
|
1956
|
-
loadMoreUrl = _useState38[0],
|
|
1957
|
-
setLoadMoreUrl = _useState38[1];
|
|
1958
|
-
var _useState39 = useState(Math.random().toString()),
|
|
1959
|
-
_useState40 = _slicedToArray(_useState39, 1),
|
|
1960
|
-
reqId = _useState40[0];
|
|
1961
|
-
var _useState41 = useState(),
|
|
1962
|
-
_useState42 = _slicedToArray(_useState41, 2),
|
|
1963
|
-
refreshCom = _useState42[0],
|
|
1964
|
-
setRefreshCom = _useState42[1];
|
|
1965
|
-
var _useState43 = useState(0),
|
|
1966
|
-
_useState44 = _slicedToArray(_useState43, 2),
|
|
1967
|
-
tableMinWidth = _useState44[0],
|
|
1968
|
-
setTableMinWidth = _useState44[1]; // 表格最小width
|
|
1969
|
-
var _useState45 = useState({}),
|
|
1970
|
-
_useState46 = _slicedToArray(_useState45, 2),
|
|
1971
|
-
posFixed = _useState46[0],
|
|
1972
|
-
setPosFixed = _useState46[1]; // 固定位置
|
|
1973
|
-
var _useState47 = useState({}),
|
|
1974
|
-
_useState48 = _slicedToArray(_useState47, 2),
|
|
1975
|
-
headDataConfig = _useState48[0],
|
|
1976
|
-
setHeadDataConfig = _useState48[1]; // 表头配置
|
|
1977
|
-
var containerRef = useRef(); // 表格内容高度
|
|
1978
|
-
var tableRef = useRef(); // 表格
|
|
1979
|
-
var constData = useRef({
|
|
1723
|
+
const {
|
|
1724
|
+
className,
|
|
1725
|
+
style,
|
|
1726
|
+
url,
|
|
1727
|
+
ctx,
|
|
1728
|
+
emptyProps,
|
|
1729
|
+
method = 'Get',
|
|
1730
|
+
data,
|
|
1731
|
+
page = 1,
|
|
1732
|
+
size = 10,
|
|
1733
|
+
sizeArr = [10, 20, 50, 100],
|
|
1734
|
+
search,
|
|
1735
|
+
pagination = true,
|
|
1736
|
+
paginationType = 'complex',
|
|
1737
|
+
flippingArrow,
|
|
1738
|
+
autoPagination = true,
|
|
1739
|
+
tableCell,
|
|
1740
|
+
requestCallback,
|
|
1741
|
+
checkDefaultValue,
|
|
1742
|
+
setCheck,
|
|
1743
|
+
radioDefaultValue,
|
|
1744
|
+
setRadio,
|
|
1745
|
+
refresh,
|
|
1746
|
+
disabledArr,
|
|
1747
|
+
disabledArrStatus,
|
|
1748
|
+
headData = [],
|
|
1749
|
+
sortTableRadio,
|
|
1750
|
+
sortTable = false,
|
|
1751
|
+
filter = false,
|
|
1752
|
+
expandable,
|
|
1753
|
+
rowKey = 'key',
|
|
1754
|
+
check = false,
|
|
1755
|
+
radio = false,
|
|
1756
|
+
checkRememberPage = false,
|
|
1757
|
+
align = 'left',
|
|
1758
|
+
paramsCallback,
|
|
1759
|
+
operate,
|
|
1760
|
+
showColumns = 'inside',
|
|
1761
|
+
fixedTable = true,
|
|
1762
|
+
fixedColumn = true,
|
|
1763
|
+
dragColumn = true,
|
|
1764
|
+
formatter,
|
|
1765
|
+
lineHeight = 48,
|
|
1766
|
+
lineWidth = 80,
|
|
1767
|
+
autoSize = true,
|
|
1768
|
+
loadMore = false,
|
|
1769
|
+
loadMoreRender,
|
|
1770
|
+
onClickMore,
|
|
1771
|
+
expandValue,
|
|
1772
|
+
expandMultiple,
|
|
1773
|
+
disabledExpand,
|
|
1774
|
+
onExpand,
|
|
1775
|
+
defaultExpandAllRows = false,
|
|
1776
|
+
onClickColumns,
|
|
1777
|
+
beyondText = true,
|
|
1778
|
+
tipMaxWidth = 500,
|
|
1779
|
+
loading,
|
|
1780
|
+
defaultSortValue,
|
|
1781
|
+
defaultFilterValue,
|
|
1782
|
+
searchKeyName,
|
|
1783
|
+
filterSearchCallback,
|
|
1784
|
+
onClickRow,
|
|
1785
|
+
rowClassMapping,
|
|
1786
|
+
getPopupContainer,
|
|
1787
|
+
onSort,
|
|
1788
|
+
onError,
|
|
1789
|
+
refreshInside = props.url ? true : false,
|
|
1790
|
+
checkCount = props.check ? true : false
|
|
1791
|
+
} = props;
|
|
1792
|
+
const intl = useFormatMessage('Table', localeJson);
|
|
1793
|
+
const dayNum = props.expirationTime ? props.expirationTime === 0 ? 100000000 : props.expirationTime : 7; // 过期天数
|
|
1794
|
+
const [pageCom, setPageCom] = useState(props.page !== undefined ? props.page : 1); // 页数
|
|
1795
|
+
const [sizeCom, setSizeCom] = useState(null); // 每页条数
|
|
1796
|
+
const [sizeArrCom, setSizeArrCom] = useState(sizeArr); // 每页条数数组
|
|
1797
|
+
const [total, setTotal] = useState(0); // 总数
|
|
1798
|
+
const [rowData, setRowData] = useState([]); // 当前页数据
|
|
1799
|
+
const [rowDataJson, setRowDataJson] = useState({}); // 当前页数据对象
|
|
1800
|
+
const [totalDataJson, setTotalDataJson] = useState({}); // 数据总数对象--用来分页记录数据的
|
|
1801
|
+
const [orderTypeArr, setOrderTypeArr] = useState(Object.values(defaultSortValue || {})); // 排序类型
|
|
1802
|
+
const [orderFieldArr, setOrderFieldArr] = useState(Object.keys(defaultSortValue || {})); // 排序字段
|
|
1803
|
+
const [headSelectStatus, setHeadSelectStatus] = useState('not'); // 表格头复选框状态
|
|
1804
|
+
const [checkJson, setCheckJson] = useState({}); // 多选 选中的数据
|
|
1805
|
+
const [radioValue, setRadioValue] = useState(); // 单选 选中的数据
|
|
1806
|
+
const [disabledJson, setDisabledJson] = useState({}); // 禁用对象
|
|
1807
|
+
const [originalHead, setOriginalHead] = useState({}); // 接口原数据表头json
|
|
1808
|
+
const [showHeadList, setShowHeadList] = useState([]); // 显示列下拉值 所有头部的配置
|
|
1809
|
+
const [headDataCom, setHeadDataCom] = useState([]); // 表格当前显示列 集合本地数据
|
|
1810
|
+
const [selectFilterCom, setSelectFilterCom] = useState(Object.assign({}, defaultFilterValue)); // 过滤值
|
|
1811
|
+
const [loadState, setLoadState] = useState(true); // 加载进度条状态
|
|
1812
|
+
const [loadMoreUrl, setLoadMoreUrl] = useState(false);
|
|
1813
|
+
const [reqId] = useState(Math.random().toString());
|
|
1814
|
+
const [refreshCom, setRefreshCom] = useState();
|
|
1815
|
+
const [tableMinWidth, setTableMinWidth] = useState(0); // 表格最小width
|
|
1816
|
+
const [posFixed, setPosFixed] = useState({}); // 固定位置
|
|
1817
|
+
const [headDataConfig, setHeadDataConfig] = useState({}); // 表头配置
|
|
1818
|
+
const containerRef = useRef(); // 表格内容高度
|
|
1819
|
+
const tableRef = useRef(); // 表格
|
|
1820
|
+
const constData = useRef({
|
|
1980
1821
|
page: props.page !== undefined ? props.page : 1,
|
|
1981
1822
|
headDataConfig: {}
|
|
1982
1823
|
}); // 存储常量
|
|
@@ -1990,9 +1831,9 @@ var Table = function Table(propsInit) {
|
|
|
1990
1831
|
constData.current.searchKeyName = searchKeyName;
|
|
1991
1832
|
constData.current.filterSearchCallback = filterSearchCallback;
|
|
1992
1833
|
constData.current.onError = onError;
|
|
1993
|
-
useEffect(
|
|
1834
|
+
useEffect(() => {
|
|
1994
1835
|
window.addEventListener('resize', changeResize);
|
|
1995
|
-
return
|
|
1836
|
+
return () => {
|
|
1996
1837
|
constData.current.isDestroy = true;
|
|
1997
1838
|
clearTimeout(constData.current.reqTimer);
|
|
1998
1839
|
clearTimeout(constData.current.loadingTimer);
|
|
@@ -2000,69 +1841,72 @@ var Table = function Table(propsInit) {
|
|
|
2000
1841
|
window.removeEventListener('resize', changeResize);
|
|
2001
1842
|
};
|
|
2002
1843
|
}, []);
|
|
2003
|
-
useEffect(
|
|
1844
|
+
useEffect(() => {
|
|
2004
1845
|
if (loading !== undefined) {
|
|
2005
1846
|
clearTimeout(constData.current.loadingTimer);
|
|
2006
|
-
constData.current.loadingTimer = setTimeout(
|
|
1847
|
+
constData.current.loadingTimer = setTimeout(() => {
|
|
2007
1848
|
setLoadState(loading);
|
|
2008
1849
|
}, 50);
|
|
2009
1850
|
}
|
|
2010
1851
|
}, [loading]);
|
|
2011
|
-
useEffect(
|
|
1852
|
+
useEffect(() => {
|
|
2012
1853
|
setLoadMoreUrl(Boolean(loadMore && url));
|
|
2013
1854
|
}, [loadMore, url]);
|
|
2014
1855
|
// 监听page
|
|
2015
|
-
useEffect(
|
|
1856
|
+
useEffect(() => {
|
|
2016
1857
|
if (props.page !== undefined) {
|
|
2017
1858
|
handPage(props.page);
|
|
2018
1859
|
}
|
|
2019
1860
|
}, [page]);
|
|
2020
1861
|
// 自动计算表格一页展示条数
|
|
2021
|
-
useEffect(
|
|
1862
|
+
useEffect(() => {
|
|
2022
1863
|
if (!autoSize) return handSize(size);
|
|
2023
1864
|
if (props.size) {
|
|
2024
1865
|
handSize(size);
|
|
2025
1866
|
} else {
|
|
2026
1867
|
if (containerRef && containerRef.current) {
|
|
2027
|
-
|
|
1868
|
+
let height = containerRef.current.clientHeight - 48;
|
|
2028
1869
|
if (props.loadMore) height -= lineHeight;
|
|
2029
|
-
|
|
2030
|
-
|
|
1870
|
+
let num = Math.floor(height / lineHeight);
|
|
1871
|
+
/*// 取余大于0.5,加一条
|
|
1872
|
+
const numRemainder = height % lineHeight / lineHeight;
|
|
1873
|
+
if (numRemainder > 0.5) num += 1;*/
|
|
1874
|
+
const columnsNUmber = num < 1 ? size : num;
|
|
2031
1875
|
if (sizeArr.indexOf(columnsNUmber) === -1) {
|
|
2032
1876
|
sizeArr.unshift(columnsNUmber);
|
|
2033
1877
|
// 数组排序
|
|
2034
|
-
sizeArr.sort(
|
|
1878
|
+
sizeArr.sort((a, b) => {
|
|
2035
1879
|
return a - b;
|
|
2036
1880
|
});
|
|
2037
|
-
setSizeArrCom(
|
|
1881
|
+
setSizeArrCom([...sizeArr]);
|
|
2038
1882
|
}
|
|
2039
1883
|
handSize(columnsNUmber);
|
|
2040
1884
|
}
|
|
2041
1885
|
}
|
|
2042
1886
|
}, [size, autoSize]);
|
|
2043
1887
|
// 处理表格头部
|
|
2044
|
-
useEffect(
|
|
1888
|
+
useEffect(() => {
|
|
2045
1889
|
if (props.headData !== undefined) {
|
|
2046
1890
|
handInitHead(headData, false);
|
|
2047
1891
|
}
|
|
2048
1892
|
}, [headData]);
|
|
2049
1893
|
// 设置总数对象
|
|
2050
|
-
useEffect(
|
|
1894
|
+
useEffect(() => {
|
|
2051
1895
|
if (data) {
|
|
2052
1896
|
constData.current.historyData = [];
|
|
2053
|
-
|
|
2054
|
-
|
|
1897
|
+
const dataHand = handLocalData();
|
|
1898
|
+
const handTotalDataJson = ArrayToObject(rowKey, dataHand);
|
|
2055
1899
|
setTotalDataJson(handTotalDataJson);
|
|
2056
1900
|
setRefreshCom(Math.random());
|
|
2057
1901
|
}
|
|
2058
1902
|
}, [data]);
|
|
2059
|
-
useEffect(
|
|
1903
|
+
useEffect(() => {
|
|
2060
1904
|
// 第一次初始化不设置
|
|
2061
1905
|
if (!constData.current.initReq) return;
|
|
2062
1906
|
handPage(1);
|
|
2063
1907
|
constData.current.historyData = [];
|
|
2064
1908
|
}, [search, url]);
|
|
2065
|
-
useEffect(
|
|
1909
|
+
useEffect(() => {
|
|
2066
1910
|
if (constData.current.loadMoreUrl) {
|
|
2067
1911
|
constData.current.historyData = [];
|
|
2068
1912
|
handPage(1);
|
|
@@ -2071,14 +1915,14 @@ var Table = function Table(propsInit) {
|
|
|
2071
1915
|
}
|
|
2072
1916
|
}, [refresh]);
|
|
2073
1917
|
// 表格数据获取赋值
|
|
2074
|
-
useEffect(
|
|
1918
|
+
useEffect(() => {
|
|
2075
1919
|
clearTimeout(constData.current.reqTimer);
|
|
2076
1920
|
if (constData.current.url) Cancel(reqId);
|
|
2077
|
-
constData.current.reqTimer = setTimeout(
|
|
1921
|
+
constData.current.reqTimer = setTimeout(() => {
|
|
2078
1922
|
constData.current.initReq = true;
|
|
2079
1923
|
if (constData.current.url) {
|
|
2080
1924
|
// 提交参数
|
|
2081
|
-
|
|
1925
|
+
let postBody = {};
|
|
2082
1926
|
if (pagination) {
|
|
2083
1927
|
if (constData.current.page === null || constData.current.size === null) return;
|
|
2084
1928
|
postBody.size = constData.current.size;
|
|
@@ -2094,54 +1938,54 @@ var Table = function Table(propsInit) {
|
|
|
2094
1938
|
}
|
|
2095
1939
|
}
|
|
2096
1940
|
if (selectFilterCom && Object.keys(selectFilterCom).length > 0) {
|
|
2097
|
-
|
|
1941
|
+
const filterValue = handFilterReq();
|
|
2098
1942
|
if (Object.keys(filterValue).length > 0) postBody.filter = filterValue;
|
|
2099
1943
|
}
|
|
2100
1944
|
if (constData.current.search) {
|
|
2101
|
-
if (
|
|
1945
|
+
if (typeof constData.current.search === 'object') {
|
|
2102
1946
|
postBody = Object.assign(Object.assign({}, postBody), constData.current.search);
|
|
2103
1947
|
}
|
|
2104
1948
|
}
|
|
2105
|
-
|
|
1949
|
+
const obj = {
|
|
2106
1950
|
url: constData.current.url,
|
|
2107
|
-
ctx
|
|
2108
|
-
method
|
|
1951
|
+
ctx,
|
|
1952
|
+
method,
|
|
2109
1953
|
data: postBody
|
|
2110
1954
|
};
|
|
2111
1955
|
// get 请求
|
|
2112
1956
|
if (method === 'Get') {
|
|
2113
1957
|
if (paramsCallback) {
|
|
2114
|
-
paramsCallback(obj,
|
|
2115
|
-
|
|
1958
|
+
paramsCallback(obj, handObj => {
|
|
1959
|
+
const handUrl = handGetReqParams(handObj);
|
|
2116
1960
|
requestData(Object.assign(Object.assign({}, handObj), {
|
|
2117
1961
|
url: handUrl,
|
|
2118
|
-
ctx
|
|
2119
|
-
method
|
|
1962
|
+
ctx,
|
|
1963
|
+
method
|
|
2120
1964
|
}));
|
|
2121
1965
|
});
|
|
2122
1966
|
} else {
|
|
2123
|
-
|
|
1967
|
+
const handUrl = handGetReqParams(obj);
|
|
2124
1968
|
requestData({
|
|
2125
1969
|
url: handUrl,
|
|
2126
|
-
ctx
|
|
2127
|
-
method
|
|
1970
|
+
ctx,
|
|
1971
|
+
method
|
|
2128
1972
|
});
|
|
2129
1973
|
}
|
|
2130
1974
|
}
|
|
2131
1975
|
// post 请求
|
|
2132
1976
|
if (method === 'Post') {
|
|
2133
|
-
if (paramsCallback) paramsCallback(obj,
|
|
1977
|
+
if (paramsCallback) paramsCallback(obj, handObj => {
|
|
2134
1978
|
requestData(handObj);
|
|
2135
1979
|
});else requestData(obj);
|
|
2136
1980
|
}
|
|
2137
1981
|
}
|
|
2138
1982
|
if (constData.current.data) {
|
|
2139
|
-
|
|
1983
|
+
let dataT = handLocalData();
|
|
2140
1984
|
dataT = filterSearchData(dataT); // 过滤数据
|
|
2141
1985
|
if (pagination) {
|
|
2142
1986
|
if (constData.current.page === null || constData.current.size === null) return;
|
|
2143
1987
|
// 分页
|
|
2144
|
-
|
|
1988
|
+
const sliceData = dataT.slice((constData.current.page - 1) * constData.current.size, (constData.current.page - 1) * constData.current.size + constData.current.size);
|
|
2145
1989
|
setNowPageData(sliceData);
|
|
2146
1990
|
setTotal(dataT.length);
|
|
2147
1991
|
} else {
|
|
@@ -2153,47 +1997,47 @@ var Table = function Table(propsInit) {
|
|
|
2153
1997
|
}, 50);
|
|
2154
1998
|
}, [refreshCom]);
|
|
2155
1999
|
// 单选赋值默认值
|
|
2156
|
-
useEffect(
|
|
2000
|
+
useEffect(() => {
|
|
2157
2001
|
if (radioDefaultValue !== undefined && radioDefaultValue !== radioValue) {
|
|
2158
2002
|
setRadioValue(radioDefaultValue);
|
|
2159
2003
|
}
|
|
2160
2004
|
}, [radioDefaultValue]);
|
|
2161
2005
|
// 复选框赋默认值
|
|
2162
|
-
useEffect(
|
|
2006
|
+
useEffect(() => {
|
|
2163
2007
|
if (checkDefaultValue) {
|
|
2164
|
-
|
|
2165
|
-
for (
|
|
2166
|
-
|
|
2008
|
+
const json = {};
|
|
2009
|
+
for (let i = 0, l = checkDefaultValue.length; i < l; i++) {
|
|
2010
|
+
const item = checkDefaultValue[i];
|
|
2167
2011
|
json[item] = true;
|
|
2168
2012
|
}
|
|
2169
2013
|
setCheckJson(json);
|
|
2170
2014
|
}
|
|
2171
2015
|
}, [checkDefaultValue]);
|
|
2172
2016
|
// 设置禁用对象
|
|
2173
|
-
useEffect(
|
|
2017
|
+
useEffect(() => {
|
|
2174
2018
|
if (disabledArr) {
|
|
2175
|
-
|
|
2176
|
-
for (
|
|
2177
|
-
|
|
2019
|
+
const json = {};
|
|
2020
|
+
for (let i = 0, l = disabledArr.length; i < l; i++) {
|
|
2021
|
+
const item = disabledArr[i];
|
|
2178
2022
|
json[item] = true;
|
|
2179
2023
|
}
|
|
2180
2024
|
setDisabledJson(json);
|
|
2181
2025
|
}
|
|
2182
2026
|
}, [disabledArr]);
|
|
2183
2027
|
// 计算复选框状态
|
|
2184
|
-
useEffect(
|
|
2028
|
+
useEffect(() => {
|
|
2185
2029
|
if (Object.keys(checkJson).length === 0) {
|
|
2186
2030
|
// 全不选
|
|
2187
2031
|
setHeadSelectStatus('not');
|
|
2188
2032
|
} else {
|
|
2189
|
-
|
|
2033
|
+
const arr = Object.keys(rowDataJson);
|
|
2190
2034
|
if (arr.length === 0) {
|
|
2191
2035
|
return setHeadSelectStatus('not');
|
|
2192
2036
|
}
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
for (
|
|
2196
|
-
|
|
2037
|
+
let numTotal = arr.length;
|
|
2038
|
+
let num = 0;
|
|
2039
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2040
|
+
const key = arr[i];
|
|
2197
2041
|
if (disabledJson[key]) {
|
|
2198
2042
|
numTotal--;
|
|
2199
2043
|
} else {
|
|
@@ -2217,13 +2061,13 @@ var Table = function Table(propsInit) {
|
|
|
2217
2061
|
}
|
|
2218
2062
|
}, [checkJson, rowData, disabledJson]);
|
|
2219
2063
|
// 表格更新计算是否有滚动条
|
|
2220
|
-
useEffect(
|
|
2064
|
+
useEffect(() => {
|
|
2221
2065
|
tableBoxScroll({
|
|
2222
2066
|
target: containerRef.current
|
|
2223
2067
|
});
|
|
2224
2068
|
});
|
|
2225
2069
|
/** 设置size */
|
|
2226
|
-
|
|
2070
|
+
const handSize = num => {
|
|
2227
2071
|
constData.current.size = num;
|
|
2228
2072
|
setSizeCom(num);
|
|
2229
2073
|
setRefreshCom(Math.random());
|
|
@@ -2231,15 +2075,15 @@ var Table = function Table(propsInit) {
|
|
|
2231
2075
|
/**
|
|
2232
2076
|
* 处理page
|
|
2233
2077
|
* */
|
|
2234
|
-
|
|
2078
|
+
const handPage = num => {
|
|
2235
2079
|
constData.current.page = num;
|
|
2236
2080
|
setPageCom(num);
|
|
2237
2081
|
setRefreshCom(Math.random());
|
|
2238
2082
|
};
|
|
2239
2083
|
/** 处理本地data */
|
|
2240
|
-
|
|
2084
|
+
const handLocalData = () => {
|
|
2241
2085
|
var _a;
|
|
2242
|
-
|
|
2086
|
+
let dataT = [];
|
|
2243
2087
|
if (constData.current.data instanceof Array) {
|
|
2244
2088
|
dataT = constData.current.data;
|
|
2245
2089
|
} else {
|
|
@@ -2248,12 +2092,12 @@ var Table = function Table(propsInit) {
|
|
|
2248
2092
|
return dataT;
|
|
2249
2093
|
};
|
|
2250
2094
|
/** 本地数据过滤搜索数据 */
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
for (
|
|
2255
|
-
|
|
2256
|
-
|
|
2095
|
+
const filterSearchData = arr => {
|
|
2096
|
+
const filterKeys = Object.keys(constData.current.selectFilterCom || {});
|
|
2097
|
+
const handArr = [];
|
|
2098
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2099
|
+
const item = arr[i];
|
|
2100
|
+
let bol = true;
|
|
2257
2101
|
if (constData.current.filterSearchCallback) {
|
|
2258
2102
|
// 自定义过滤方法
|
|
2259
2103
|
bol = constData.current.filterSearchCallback(item, {
|
|
@@ -2262,10 +2106,10 @@ var Table = function Table(propsInit) {
|
|
|
2262
2106
|
});
|
|
2263
2107
|
} else {
|
|
2264
2108
|
// 过滤条件
|
|
2265
|
-
for (
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2109
|
+
for (let j = 0, k = filterKeys.length; j < k; j++) {
|
|
2110
|
+
const name = filterKeys[j];
|
|
2111
|
+
const filterVal = constData.current.selectFilterCom[name];
|
|
2112
|
+
const val = item[name];
|
|
2269
2113
|
// 不满足当前过滤的数据,过滤掉
|
|
2270
2114
|
if (filterVal.length > 0 && filterVal.indexOf(val) === -1) {
|
|
2271
2115
|
bol = false;
|
|
@@ -2282,15 +2126,15 @@ var Table = function Table(propsInit) {
|
|
|
2282
2126
|
return handArr;
|
|
2283
2127
|
};
|
|
2284
2128
|
/** 处理本地搜索, 返回true满足搜索条件 */
|
|
2285
|
-
|
|
2286
|
-
|
|
2129
|
+
const handLocalSearch = item => {
|
|
2130
|
+
let searchKey;
|
|
2287
2131
|
if (constData.current.search && typeof constData.current.search !== 'string' && constData.current.search.searchKey) {
|
|
2288
2132
|
searchKey = constData.current.search.searchKey;
|
|
2289
2133
|
}
|
|
2290
2134
|
if (searchKey !== undefined && constData.current.searchKeyName && constData.current.searchKeyName.length > 0) {
|
|
2291
|
-
for (
|
|
2292
|
-
|
|
2293
|
-
|
|
2135
|
+
for (let i = 0, l = constData.current.searchKeyName.length; i < l; i++) {
|
|
2136
|
+
const name = constData.current.searchKeyName[i];
|
|
2137
|
+
const nameVal = item[name];
|
|
2294
2138
|
if (nameVal.indexOf(searchKey) !== -1) {
|
|
2295
2139
|
// 存在一项就满足
|
|
2296
2140
|
return true;
|
|
@@ -2302,7 +2146,7 @@ var Table = function Table(propsInit) {
|
|
|
2302
2146
|
return false;
|
|
2303
2147
|
};
|
|
2304
2148
|
/** 本地显示列key */
|
|
2305
|
-
|
|
2149
|
+
const getTableHeadKey = () => {
|
|
2306
2150
|
// 自定义key
|
|
2307
2151
|
if (props.tableKey) {
|
|
2308
2152
|
return props.tableKey;
|
|
@@ -2318,19 +2162,19 @@ var Table = function Table(propsInit) {
|
|
|
2318
2162
|
return '';
|
|
2319
2163
|
};
|
|
2320
2164
|
/** 获取储存的表头列 */
|
|
2321
|
-
|
|
2165
|
+
const getLocalStorageHeadCom = () => {
|
|
2322
2166
|
if (props.rememberColumns === false) return {};
|
|
2323
|
-
|
|
2167
|
+
const json = getLocalStorageSelectHead(getTableHeadKey(), dayNum);
|
|
2324
2168
|
return json;
|
|
2325
2169
|
};
|
|
2326
2170
|
/**
|
|
2327
2171
|
* 设置本地表格列
|
|
2328
2172
|
*
|
|
2329
2173
|
* */
|
|
2330
|
-
|
|
2174
|
+
const setLocalStorageHeadCom = obj => {
|
|
2331
2175
|
if (props.rememberColumns === false) return;
|
|
2332
|
-
|
|
2333
|
-
|
|
2176
|
+
const localStorageData = getLocalStorageHeadCom();
|
|
2177
|
+
const json = {
|
|
2334
2178
|
headName: localStorageData.headName || {},
|
|
2335
2179
|
headDataConfig: localStorageData.headDataConfig || {},
|
|
2336
2180
|
storageTime: new Date().getTime(),
|
|
@@ -2338,10 +2182,10 @@ var Table = function Table(propsInit) {
|
|
|
2338
2182
|
};
|
|
2339
2183
|
// 设置固定列
|
|
2340
2184
|
if (obj.setFixed) {
|
|
2341
|
-
|
|
2342
|
-
for (
|
|
2343
|
-
|
|
2344
|
-
|
|
2185
|
+
const selectHeadJson = ArrayToObject('name', obj.headArr || []);
|
|
2186
|
+
for (let i = 0, l = showHeadList.length; i < l; i++) {
|
|
2187
|
+
const item = showHeadList[i];
|
|
2188
|
+
const name = item.name || '';
|
|
2345
2189
|
json.headName[name] = false;
|
|
2346
2190
|
if (selectHeadJson[name]) {
|
|
2347
2191
|
json.headName[name] = true;
|
|
@@ -2360,7 +2204,7 @@ var Table = function Table(propsInit) {
|
|
|
2360
2204
|
* @param showHeadArr {HeadDataProps[]} 显示列与本地数据集合
|
|
2361
2205
|
* @param localHead {HeadLocalStorageItem} 本地显示列数据
|
|
2362
2206
|
* */
|
|
2363
|
-
|
|
2207
|
+
const handHeadShow = (item, showHeadArr, localHead) => {
|
|
2364
2208
|
if (showColumns === false) {
|
|
2365
2209
|
// 如果不显示选择列,全部显示
|
|
2366
2210
|
showHeadArr.push(item);
|
|
@@ -2371,9 +2215,9 @@ var Table = function Table(propsInit) {
|
|
|
2371
2215
|
if (item.selected) showHeadArr.push(item);
|
|
2372
2216
|
} else {
|
|
2373
2217
|
// 记住列
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2218
|
+
const nameSelectJson = localHead.headName || {};
|
|
2219
|
+
const name = item.name || '';
|
|
2220
|
+
const nameSelect = nameSelectJson[name];
|
|
2377
2221
|
if (nameSelect !== undefined) {
|
|
2378
2222
|
// 存在本地选择列里面,选中添加到显示列
|
|
2379
2223
|
if (nameSelect) showHeadArr.push(item);
|
|
@@ -2384,8 +2228,8 @@ var Table = function Table(propsInit) {
|
|
|
2384
2228
|
}
|
|
2385
2229
|
};
|
|
2386
2230
|
/** 处理序号 */
|
|
2387
|
-
|
|
2388
|
-
|
|
2231
|
+
const handSerial = arr => {
|
|
2232
|
+
const defaultVal = {
|
|
2389
2233
|
label: intl({
|
|
2390
2234
|
id: 'serial'
|
|
2391
2235
|
}),
|
|
@@ -2397,7 +2241,7 @@ var Table = function Table(propsInit) {
|
|
|
2397
2241
|
name: 'table-serial-number',
|
|
2398
2242
|
sort: false,
|
|
2399
2243
|
filter: false,
|
|
2400
|
-
render:
|
|
2244
|
+
render: (row, item, val, index, rowIndex) => {
|
|
2401
2245
|
return Number(rowIndex) + 1;
|
|
2402
2246
|
}
|
|
2403
2247
|
};
|
|
@@ -2414,15 +2258,15 @@ var Table = function Table(propsInit) {
|
|
|
2414
2258
|
* @param arr {(HeadDataProps | HeadDataReqProps)[]} 表头数据
|
|
2415
2259
|
* @param bol {boolean} true请求表头
|
|
2416
2260
|
* */
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2261
|
+
const handInitHead = (arr, bol) => {
|
|
2262
|
+
const headShowArr = []; // 表格显示列
|
|
2263
|
+
const headArr = []; // 显示列列表
|
|
2264
|
+
const json = {};
|
|
2265
|
+
const localHead = getLocalStorageHeadCom();
|
|
2422
2266
|
constData.current.headDataConfig = localHead.headDataConfig || {};
|
|
2423
|
-
for (
|
|
2424
|
-
|
|
2425
|
-
|
|
2267
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2268
|
+
const item = arr[i];
|
|
2269
|
+
const name = item.name || '';
|
|
2426
2270
|
if (typeof item.width === 'number') item.width = "".concat(item.width, "px");
|
|
2427
2271
|
if (!bol) item.orderNum = i;
|
|
2428
2272
|
handHeadShow(item, headShowArr, localHead);
|
|
@@ -2430,10 +2274,10 @@ var Table = function Table(propsInit) {
|
|
|
2430
2274
|
json[name] = item;
|
|
2431
2275
|
}
|
|
2432
2276
|
if (bol) {
|
|
2433
|
-
headShowArr.sort(
|
|
2277
|
+
headShowArr.sort((a, b) => {
|
|
2434
2278
|
return Number(a.orderNum) - Number(b.orderNum);
|
|
2435
2279
|
});
|
|
2436
|
-
headArr.sort(
|
|
2280
|
+
headArr.sort((a, b) => {
|
|
2437
2281
|
return Number(a.orderNum) - Number(b.orderNum);
|
|
2438
2282
|
});
|
|
2439
2283
|
}
|
|
@@ -2445,8 +2289,8 @@ var Table = function Table(propsInit) {
|
|
|
2445
2289
|
constData.current.headDataJson = json;
|
|
2446
2290
|
};
|
|
2447
2291
|
// 计算左边的差量
|
|
2448
|
-
|
|
2449
|
-
|
|
2292
|
+
const handLeftWidth = () => {
|
|
2293
|
+
let leftNum = 0;
|
|
2450
2294
|
// 复选
|
|
2451
2295
|
if (props.check) {
|
|
2452
2296
|
leftNum += 48;
|
|
@@ -2470,8 +2314,8 @@ var Table = function Table(propsInit) {
|
|
|
2470
2314
|
return leftNum;
|
|
2471
2315
|
};
|
|
2472
2316
|
// 计算右边的差量
|
|
2473
|
-
|
|
2474
|
-
|
|
2317
|
+
const handRightWidth = () => {
|
|
2318
|
+
let rightNum = 0;
|
|
2475
2319
|
// 显示列宽度
|
|
2476
2320
|
if (props.showColumns === 'inside' || props.showColumns === undefined) {
|
|
2477
2321
|
rightNum += 53;
|
|
@@ -2489,42 +2333,41 @@ var Table = function Table(propsInit) {
|
|
|
2489
2333
|
}
|
|
2490
2334
|
}
|
|
2491
2335
|
}
|
|
2492
|
-
|
|
2493
2336
|
return rightNum;
|
|
2494
2337
|
};
|
|
2495
2338
|
// 获取宽度
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2339
|
+
const getWidth = item => {
|
|
2340
|
+
let w = item.width || '';
|
|
2341
|
+
const name = item.name || '';
|
|
2342
|
+
const wDrag = constData.current.headDataConfig[name] && constData.current.headDataConfig[name].width;
|
|
2500
2343
|
if (wDrag) w = wDrag;
|
|
2501
2344
|
return w;
|
|
2502
2345
|
};
|
|
2503
2346
|
/**
|
|
2504
2347
|
* 处理显示列宽度
|
|
2505
2348
|
* */
|
|
2506
|
-
|
|
2349
|
+
const handHeadDataCom = arr => {
|
|
2507
2350
|
// 左侧定位数组
|
|
2508
|
-
|
|
2351
|
+
const leftArr = [];
|
|
2509
2352
|
// 右侧定位数组
|
|
2510
|
-
|
|
2353
|
+
const rightArr = [];
|
|
2511
2354
|
// 表格最小宽度
|
|
2512
|
-
|
|
2355
|
+
let tableMinWidth = 0;
|
|
2513
2356
|
// 左边差量
|
|
2514
|
-
|
|
2357
|
+
const leftWidth = handLeftWidth();
|
|
2515
2358
|
tableMinWidth += leftWidth;
|
|
2516
2359
|
// 右边差量
|
|
2517
|
-
|
|
2360
|
+
const rightWidth = handRightWidth();
|
|
2518
2361
|
tableMinWidth += rightWidth;
|
|
2519
|
-
|
|
2362
|
+
const posJson = {
|
|
2520
2363
|
leftBol: false,
|
|
2521
2364
|
rightBol: false
|
|
2522
2365
|
};
|
|
2523
2366
|
// 显示列
|
|
2524
|
-
for (
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2367
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2368
|
+
const item = arr[i];
|
|
2369
|
+
let itemWidth = 0;
|
|
2370
|
+
const handW = getWidth(item); // 获取宽度,有拖动过后宽度,就用拖动的
|
|
2528
2371
|
if (handW) {
|
|
2529
2372
|
itemWidth = getStringInNumber(handW);
|
|
2530
2373
|
tableMinWidth += itemWidth;
|
|
@@ -2543,19 +2386,19 @@ var Table = function Table(propsInit) {
|
|
|
2543
2386
|
if (leftArr.length > 0) {
|
|
2544
2387
|
posJson.leftBol = true;
|
|
2545
2388
|
// 左边定位位置
|
|
2546
|
-
|
|
2547
|
-
for (
|
|
2548
|
-
|
|
2549
|
-
if (
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
leftOps +=
|
|
2389
|
+
let leftOps = leftWidth;
|
|
2390
|
+
for (let i = 0, l = leftArr.length; i < l; i++) {
|
|
2391
|
+
const item = leftArr[i];
|
|
2392
|
+
if (item.width) {
|
|
2393
|
+
const handW = getWidth(item); // 获取宽度,有拖动过后宽度,就用拖动的
|
|
2394
|
+
const itemWidth = getStringInNumber(handW);
|
|
2395
|
+
item.paraui_left_width = leftOps;
|
|
2396
|
+
leftOps += itemWidth;
|
|
2554
2397
|
// 最后一个
|
|
2555
|
-
if (
|
|
2556
|
-
|
|
2398
|
+
if (i === leftArr.length - 1) {
|
|
2399
|
+
item.paraui_fixed_left_last = true;
|
|
2557
2400
|
} else {
|
|
2558
|
-
|
|
2401
|
+
item.paraui_fixed_left_last = false;
|
|
2559
2402
|
}
|
|
2560
2403
|
}
|
|
2561
2404
|
}
|
|
@@ -2563,19 +2406,19 @@ var Table = function Table(propsInit) {
|
|
|
2563
2406
|
if (rightArr.length > 0) {
|
|
2564
2407
|
posJson.rightBol = true;
|
|
2565
2408
|
// 右边定位位置
|
|
2566
|
-
|
|
2567
|
-
for (
|
|
2568
|
-
|
|
2569
|
-
if (
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
rightOps +=
|
|
2409
|
+
let rightOps = rightWidth;
|
|
2410
|
+
for (let i = rightArr.length - 1; i >= 0; i--) {
|
|
2411
|
+
const item = rightArr[i];
|
|
2412
|
+
if (item.width) {
|
|
2413
|
+
const handW = getWidth(item); // 获取宽度,有拖动过后宽度,就用拖动的
|
|
2414
|
+
const itemWidth = getStringInNumber(handW);
|
|
2415
|
+
item.paraui_right_width = rightOps;
|
|
2416
|
+
rightOps += itemWidth;
|
|
2574
2417
|
// 第一个
|
|
2575
|
-
if (
|
|
2576
|
-
|
|
2418
|
+
if (i === 0) {
|
|
2419
|
+
item.paraui_fixed_right_first = true;
|
|
2577
2420
|
} else {
|
|
2578
|
-
|
|
2421
|
+
item.paraui_fixed_right_first = false;
|
|
2579
2422
|
}
|
|
2580
2423
|
}
|
|
2581
2424
|
}
|
|
@@ -2586,15 +2429,15 @@ var Table = function Table(propsInit) {
|
|
|
2586
2429
|
/**
|
|
2587
2430
|
* 处理过滤请求数据
|
|
2588
2431
|
* */
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
for (
|
|
2594
|
-
|
|
2595
|
-
|
|
2432
|
+
const handFilterReq = () => {
|
|
2433
|
+
const json = {};
|
|
2434
|
+
const arr = Object.keys(selectFilterCom);
|
|
2435
|
+
const headDataJson = constData.current.headDataJson || {};
|
|
2436
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2437
|
+
const name = arr[i];
|
|
2438
|
+
const itemValue = selectFilterCom[name];
|
|
2596
2439
|
if (itemValue.length === 0) continue; // 未选择的过滤项不参与请求
|
|
2597
|
-
|
|
2440
|
+
const item = headDataJson[name];
|
|
2598
2441
|
if (item && item.filterRadio) {
|
|
2599
2442
|
json[name] = itemValue[0];
|
|
2600
2443
|
} else {
|
|
@@ -2607,92 +2450,57 @@ var Table = function Table(propsInit) {
|
|
|
2607
2450
|
* 发送请求
|
|
2608
2451
|
* @param obj {ReqProps} 请求信息
|
|
2609
2452
|
*/
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
_context.next = 9;
|
|
2626
|
-
break;
|
|
2627
|
-
}
|
|
2628
|
-
return _context.abrupt("return");
|
|
2629
|
-
case 9:
|
|
2630
|
-
if (!err) {
|
|
2631
|
-
_context.next = 23;
|
|
2632
|
-
break;
|
|
2633
|
-
}
|
|
2634
|
-
if (props.loading === undefined) setLoadState(false);
|
|
2635
|
-
// cancel的接口 不清除上次展示的数据
|
|
2636
|
-
if (err.__CANCEL__) {
|
|
2637
|
-
_context.next = 22;
|
|
2638
|
-
break;
|
|
2639
|
-
}
|
|
2640
|
-
onErrorFlag = false;
|
|
2641
|
-
if (!constData.current.onError) {
|
|
2642
|
-
_context.next = 17;
|
|
2643
|
-
break;
|
|
2644
|
-
}
|
|
2645
|
-
_context.next = 16;
|
|
2646
|
-
return constData.current.onError(err);
|
|
2647
|
-
case 16:
|
|
2648
|
-
onErrorFlag = _context.sent;
|
|
2649
|
-
case 17:
|
|
2650
|
-
if (onErrorFlag) {
|
|
2651
|
-
_context.next = 19;
|
|
2652
|
-
break;
|
|
2653
|
-
}
|
|
2654
|
-
return _context.abrupt("return");
|
|
2655
|
-
case 19:
|
|
2656
|
-
setRowData([]);
|
|
2657
|
-
setTotal(0);
|
|
2658
|
-
setRowDataJson({});
|
|
2659
|
-
case 22:
|
|
2660
|
-
return _context.abrupt("return", false);
|
|
2661
|
-
case 23:
|
|
2662
|
-
if (requestCallback) {
|
|
2663
|
-
requestCallback(data, function (handData) {
|
|
2664
|
-
if (handData) {
|
|
2665
|
-
if (handData.data) handData = handData.data;
|
|
2666
|
-
handReqData(handData);
|
|
2667
|
-
if (props.loading === undefined) setLoadState(false);
|
|
2668
|
-
}
|
|
2669
|
-
});
|
|
2670
|
-
} else {
|
|
2671
|
-
if (data.data) data = data.data;
|
|
2672
|
-
handReqData(data);
|
|
2673
|
-
if (props.loading === undefined) setLoadState(false);
|
|
2674
|
-
}
|
|
2675
|
-
case 24:
|
|
2676
|
-
case "end":
|
|
2677
|
-
return _context.stop();
|
|
2453
|
+
const requestData = obj => __awaiter(void 0, void 0, void 0, function* () {
|
|
2454
|
+
obj.uuid = reqId;
|
|
2455
|
+
if (props.loading === undefined) setLoadState(true);
|
|
2456
|
+
let {
|
|
2457
|
+
data,
|
|
2458
|
+
err
|
|
2459
|
+
} = yield requestFunc(obj);
|
|
2460
|
+
if (constData.current.isDestroy) return;
|
|
2461
|
+
if (err) {
|
|
2462
|
+
if (props.loading === undefined) setLoadState(false);
|
|
2463
|
+
// cancel的接口 不清除上次展示的数据
|
|
2464
|
+
if (!err.__CANCEL__) {
|
|
2465
|
+
let onErrorFlag = false;
|
|
2466
|
+
if (constData.current.onError) {
|
|
2467
|
+
onErrorFlag = yield constData.current.onError(err);
|
|
2678
2468
|
}
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2469
|
+
if (!onErrorFlag) return;
|
|
2470
|
+
setRowData([]);
|
|
2471
|
+
setTotal(0);
|
|
2472
|
+
setRowDataJson({});
|
|
2473
|
+
}
|
|
2474
|
+
return false;
|
|
2475
|
+
}
|
|
2476
|
+
if (requestCallback) {
|
|
2477
|
+
requestCallback(data, handData => {
|
|
2478
|
+
if (handData) {
|
|
2479
|
+
if (handData.data) handData = handData.data;
|
|
2480
|
+
handReqData(handData);
|
|
2481
|
+
if (props.loading === undefined) setLoadState(false);
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
} else {
|
|
2485
|
+
if (data.data) data = data.data;
|
|
2486
|
+
handReqData(data);
|
|
2487
|
+
if (props.loading === undefined) setLoadState(false);
|
|
2488
|
+
}
|
|
2489
|
+
});
|
|
2682
2490
|
/**
|
|
2683
2491
|
* 设置请求数据
|
|
2684
2492
|
* @param data {any} 请求信息
|
|
2685
2493
|
*/
|
|
2686
|
-
|
|
2494
|
+
const handReqData = data => {
|
|
2687
2495
|
if (data.columns && props.headData === undefined) {
|
|
2688
|
-
|
|
2496
|
+
const str = JSON.stringify(data.columns);
|
|
2689
2497
|
if (str !== JSON.stringify(originalHead)) {
|
|
2690
2498
|
setOriginalHead(data.columns);
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
for (
|
|
2694
|
-
|
|
2695
|
-
|
|
2499
|
+
const arr = Object.keys(data.columns);
|
|
2500
|
+
const headDataArr = []; // 表头数据
|
|
2501
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2502
|
+
const key = arr[i];
|
|
2503
|
+
const item = data.columns[key];
|
|
2696
2504
|
item.name = key;
|
|
2697
2505
|
item.label = item.displayName;
|
|
2698
2506
|
item.filter = item.filterFlag;
|
|
@@ -2714,7 +2522,7 @@ var Table = function Table(propsInit) {
|
|
|
2714
2522
|
setPageCom(Number(data.page));
|
|
2715
2523
|
}
|
|
2716
2524
|
} else {
|
|
2717
|
-
|
|
2525
|
+
let handData1 = [];
|
|
2718
2526
|
if (data instanceof Array) {
|
|
2719
2527
|
handData1 = data;
|
|
2720
2528
|
} else {
|
|
@@ -2727,15 +2535,15 @@ var Table = function Table(propsInit) {
|
|
|
2727
2535
|
* 设置当前页数据
|
|
2728
2536
|
* @param nowPageData {any} 当前页数据
|
|
2729
2537
|
*/
|
|
2730
|
-
|
|
2538
|
+
const setNowPageData = nowPageData => {
|
|
2731
2539
|
// 加载更多请求放在里面
|
|
2732
2540
|
if (constData.current.loadMoreUrl) {
|
|
2733
|
-
|
|
2541
|
+
const historyData = constData.current.historyData || [];
|
|
2734
2542
|
if (historyData.length > 0) {
|
|
2735
|
-
nowPageData = [
|
|
2543
|
+
nowPageData = [...historyData, ...nowPageData];
|
|
2736
2544
|
}
|
|
2737
2545
|
}
|
|
2738
|
-
|
|
2546
|
+
const handDataJson = ArrayToObject(rowKey, nowPageData);
|
|
2739
2547
|
constData.current.historyData = nowPageData;
|
|
2740
2548
|
setRowDataJson(handDataJson);
|
|
2741
2549
|
setRowData(nowPageData);
|
|
@@ -2748,7 +2556,7 @@ var Table = function Table(propsInit) {
|
|
|
2748
2556
|
* 改变页数
|
|
2749
2557
|
* @param num {number | undefined} 页数
|
|
2750
2558
|
*/
|
|
2751
|
-
|
|
2559
|
+
const changePage = num => {
|
|
2752
2560
|
if (num !== undefined) handPage(num);
|
|
2753
2561
|
clearCheckValue();
|
|
2754
2562
|
};
|
|
@@ -2756,7 +2564,7 @@ var Table = function Table(propsInit) {
|
|
|
2756
2564
|
* 改变每页条数
|
|
2757
2565
|
* @param num {number | undefined} 条数
|
|
2758
2566
|
*/
|
|
2759
|
-
|
|
2567
|
+
const changeRowsPerPage = num => {
|
|
2760
2568
|
if (num !== undefined) handSize(num);
|
|
2761
2569
|
handPage(1);
|
|
2762
2570
|
clearCheckValue();
|
|
@@ -2764,8 +2572,8 @@ var Table = function Table(propsInit) {
|
|
|
2764
2572
|
/**
|
|
2765
2573
|
* 加载更多,点击改变分页
|
|
2766
2574
|
*/
|
|
2767
|
-
|
|
2768
|
-
|
|
2575
|
+
const changePageMore = () => {
|
|
2576
|
+
const pageHnad = Number(pageCom) + 1;
|
|
2769
2577
|
handPage(pageHnad);
|
|
2770
2578
|
};
|
|
2771
2579
|
/**
|
|
@@ -2773,12 +2581,12 @@ var Table = function Table(propsInit) {
|
|
|
2773
2581
|
* @param event 元素
|
|
2774
2582
|
* @param name 当前列name
|
|
2775
2583
|
*/
|
|
2776
|
-
|
|
2584
|
+
const handleRequestSort = (event, name) => {
|
|
2777
2585
|
// asc 升序 -> desc降序 -> undefined 无序
|
|
2778
|
-
|
|
2586
|
+
const index = orderFieldArr.indexOf(name);
|
|
2779
2587
|
if (index !== -1) {
|
|
2780
2588
|
// 排序过
|
|
2781
|
-
|
|
2589
|
+
const orderType = orderTypeArr[index];
|
|
2782
2590
|
if (orderType === 'asc') {
|
|
2783
2591
|
orderTypeArr[index] = 'desc';
|
|
2784
2592
|
}
|
|
@@ -2794,11 +2602,11 @@ var Table = function Table(propsInit) {
|
|
|
2794
2602
|
orderFieldArr.push(name);
|
|
2795
2603
|
orderTypeArr.push('asc');
|
|
2796
2604
|
}
|
|
2797
|
-
|
|
2798
|
-
|
|
2605
|
+
let orderFieldArrHand = [...orderFieldArr];
|
|
2606
|
+
let orderTypeArrHand = [...orderTypeArr];
|
|
2799
2607
|
// 单个排序
|
|
2800
2608
|
if (sortTableRadio) {
|
|
2801
|
-
|
|
2609
|
+
const num = orderFieldArrHand.indexOf(name);
|
|
2802
2610
|
if (num !== -1) {
|
|
2803
2611
|
orderFieldArrHand = [orderFieldArrHand[num]];
|
|
2804
2612
|
orderTypeArrHand = [orderTypeArrHand[num]];
|
|
@@ -2823,12 +2631,12 @@ var Table = function Table(propsInit) {
|
|
|
2823
2631
|
* 处理复选框往外抛值
|
|
2824
2632
|
* @param json 当前选中值
|
|
2825
2633
|
*/
|
|
2826
|
-
|
|
2634
|
+
const handCheckValue = json => {
|
|
2827
2635
|
if (props.checkDefaultValue === undefined) setCheckJson(Object.assign({}, json));
|
|
2828
|
-
|
|
2636
|
+
const arr = Object.keys(json);
|
|
2829
2637
|
if (setCheck) {
|
|
2830
|
-
|
|
2831
|
-
for (
|
|
2638
|
+
const selectData = [];
|
|
2639
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2832
2640
|
if (totalDataJson[arr[i]]) selectData.push(totalDataJson[arr[i]]);
|
|
2833
2641
|
}
|
|
2834
2642
|
setCheck(arr, selectData);
|
|
@@ -2839,12 +2647,12 @@ var Table = function Table(propsInit) {
|
|
|
2839
2647
|
* @param event 选择的元素
|
|
2840
2648
|
* @param bol 全选 / 全不选
|
|
2841
2649
|
*/
|
|
2842
|
-
|
|
2650
|
+
const setAllCheck = (event, bol) => {
|
|
2843
2651
|
// 存在checkDefaultValue, {...checkJson}解决直接使用checkJson, 复选框会一闪
|
|
2844
2652
|
// 不存在checkDefaultValue,内部直接记录状态
|
|
2845
|
-
|
|
2846
|
-
for (
|
|
2847
|
-
|
|
2653
|
+
const checkJsonDeep = props.checkDefaultValue !== undefined ? Object.assign({}, checkJson) : checkJson;
|
|
2654
|
+
for (let i = 0, l = rowData.length; i < l; i++) {
|
|
2655
|
+
const key = rowData[i][rowKey];
|
|
2848
2656
|
if (!disabledJson[key]) {
|
|
2849
2657
|
if (bol) {
|
|
2850
2658
|
checkJsonDeep[key] = true;
|
|
@@ -2861,10 +2669,10 @@ var Table = function Table(propsInit) {
|
|
|
2861
2669
|
* @param bol 选 / 不选
|
|
2862
2670
|
* @param key 当前行key
|
|
2863
2671
|
*/
|
|
2864
|
-
|
|
2672
|
+
const selectCheck = (event, bol, key) => {
|
|
2865
2673
|
// 存在checkDefaultValue, {...checkJson}解决直接使用checkJson, 复选框会一闪
|
|
2866
2674
|
// 不存在checkDefaultValue,内部直接记录状态
|
|
2867
|
-
|
|
2675
|
+
const checkJsonDeep = props.checkDefaultValue !== undefined ? Object.assign({}, checkJson) : checkJson;
|
|
2868
2676
|
checkJsonDeep[key] = bol;
|
|
2869
2677
|
if (checkJsonDeep[key] === false) delete checkJsonDeep[key]; // 确保json里面的数据都是选中的
|
|
2870
2678
|
handCheckValue(checkJsonDeep);
|
|
@@ -2874,13 +2682,13 @@ var Table = function Table(propsInit) {
|
|
|
2874
2682
|
* @param event 选择的元素
|
|
2875
2683
|
* @param item 当前行数据
|
|
2876
2684
|
*/
|
|
2877
|
-
|
|
2685
|
+
const selectRadio = (event, val) => {
|
|
2878
2686
|
if (setRadio) setRadio(val, totalDataJson[val]);
|
|
2879
2687
|
};
|
|
2880
2688
|
/**
|
|
2881
2689
|
* 清空复选框选中值
|
|
2882
2690
|
*/
|
|
2883
|
-
|
|
2691
|
+
const clearCheckValue = () => {
|
|
2884
2692
|
if (!checkRememberPage) {
|
|
2885
2693
|
setCheckJson({});
|
|
2886
2694
|
handCheckValue({});
|
|
@@ -2892,10 +2700,10 @@ var Table = function Table(propsInit) {
|
|
|
2892
2700
|
* @param item 当前点击项
|
|
2893
2701
|
* @param isRest 是否重置
|
|
2894
2702
|
* */
|
|
2895
|
-
|
|
2703
|
+
const changeSelectHead = (arr, item, isRest) => {
|
|
2896
2704
|
handHeadDataCom(arr);
|
|
2897
2705
|
setHeadDataCom(arr);
|
|
2898
|
-
|
|
2706
|
+
const obj = {
|
|
2899
2707
|
setFixed: true,
|
|
2900
2708
|
headArr: arr
|
|
2901
2709
|
};
|
|
@@ -2913,45 +2721,45 @@ var Table = function Table(propsInit) {
|
|
|
2913
2721
|
* @param bol 重置
|
|
2914
2722
|
* @param item 当前点击项
|
|
2915
2723
|
*/
|
|
2916
|
-
|
|
2724
|
+
const changeShowList = (headShowArr, bol, item) => {
|
|
2917
2725
|
if (bol) {
|
|
2918
2726
|
constData.current.headDataConfig = {};
|
|
2919
2727
|
setHeadDataConfig({}); // 重置拖拽列
|
|
2920
|
-
|
|
2921
|
-
|
|
2728
|
+
const arr = [];
|
|
2729
|
+
const arrShow = [...showHeadList];
|
|
2922
2730
|
handSerial(arrShow);
|
|
2923
|
-
for (
|
|
2924
|
-
|
|
2925
|
-
if (
|
|
2731
|
+
for (let i = 0, l = arrShow.length; i < l; i++) {
|
|
2732
|
+
const item = arrShow[i];
|
|
2733
|
+
if (item && item.selected) {
|
|
2926
2734
|
// 当前显示字段
|
|
2927
|
-
arr.push(
|
|
2735
|
+
arr.push(item);
|
|
2928
2736
|
}
|
|
2929
2737
|
}
|
|
2930
2738
|
changeSelectHead(arr, item, true);
|
|
2931
2739
|
return;
|
|
2932
2740
|
}
|
|
2933
|
-
headShowArr.sort(
|
|
2741
|
+
headShowArr.sort((a, b) => {
|
|
2934
2742
|
return Number(a.orderNum) - Number(b.orderNum);
|
|
2935
2743
|
});
|
|
2936
|
-
|
|
2744
|
+
const headShowArrHand = [...headShowArr];
|
|
2937
2745
|
changeSelectHead(headShowArrHand, item);
|
|
2938
2746
|
};
|
|
2939
2747
|
/**
|
|
2940
2748
|
* 改变过滤
|
|
2941
2749
|
*/
|
|
2942
|
-
|
|
2750
|
+
const changeFilter = val => {
|
|
2943
2751
|
constData.current.selectFilterCom = DeepClone(val);
|
|
2944
2752
|
setSelectFilterCom(DeepClone(val));
|
|
2945
2753
|
handPage(1);
|
|
2946
2754
|
};
|
|
2947
2755
|
/** 改变拖拽列width */
|
|
2948
|
-
|
|
2949
|
-
|
|
2756
|
+
const changeColumnWidth = (headCell, result) => {
|
|
2757
|
+
const name = headCell.name || '';
|
|
2950
2758
|
constData.current.headDataConfig[name] = {
|
|
2951
2759
|
width: result.width
|
|
2952
2760
|
};
|
|
2953
2761
|
setHeadDataConfig(Object.assign({}, constData.current.headDataConfig)); // 设置表格列配置,被拖动的width
|
|
2954
|
-
handHeadDataCom(
|
|
2762
|
+
handHeadDataCom([...headData]); // 重新计算表格的最小宽度
|
|
2955
2763
|
// 本地记住拖动列宽度
|
|
2956
2764
|
setLocalStorageHeadCom({
|
|
2957
2765
|
headDataConfig: constData.current.headDataConfig,
|
|
@@ -2959,7 +2767,7 @@ var Table = function Table(propsInit) {
|
|
|
2959
2767
|
});
|
|
2960
2768
|
};
|
|
2961
2769
|
// 表格头部memo
|
|
2962
|
-
|
|
2770
|
+
const TableHeadMemo = useMemo(() => {
|
|
2963
2771
|
return jsx(TableHead$1, {
|
|
2964
2772
|
orderTypeArr: orderTypeArr,
|
|
2965
2773
|
orderFieldArr: orderFieldArr,
|
|
@@ -2993,7 +2801,7 @@ var Table = function Table(propsInit) {
|
|
|
2993
2801
|
});
|
|
2994
2802
|
}, [totalDataJson, showColumns, rowKey, rowData, checkJson, disabledJson, orderTypeArr, orderFieldArr, sortTable, filter, expandable, check, headSelectStatus, radio, align, showHeadList, headDataCom, selectFilterCom, operate, onClickColumns, sortTableRadio, fixedTable, posFixed, beyondText, fixedColumn, lineWidth, dragColumn, headDataConfig, getPopupContainer, onSort, tipMaxWidth]);
|
|
2995
2803
|
// 表格内容memo
|
|
2996
|
-
|
|
2804
|
+
const TableBodyMemo = useMemo(() => {
|
|
2997
2805
|
return jsx(TableBody, {
|
|
2998
2806
|
url: url,
|
|
2999
2807
|
emptyProps: emptyProps,
|
|
@@ -3031,9 +2839,7 @@ var Table = function Table(propsInit) {
|
|
|
3031
2839
|
disabledExpand: disabledExpand,
|
|
3032
2840
|
onExpand: onExpand,
|
|
3033
2841
|
defaultExpandAllRows: defaultExpandAllRows,
|
|
3034
|
-
onRefresh:
|
|
3035
|
-
return setRefreshCom(Math.random());
|
|
3036
|
-
},
|
|
2842
|
+
onRefresh: () => setRefreshCom(Math.random()),
|
|
3037
2843
|
posFixed: posFixed,
|
|
3038
2844
|
beyondText: beyondText,
|
|
3039
2845
|
fixedColumn: fixedColumn,
|
|
@@ -3045,7 +2851,7 @@ var Table = function Table(propsInit) {
|
|
|
3045
2851
|
});
|
|
3046
2852
|
}, [showColumns, formatter, rowKey, rowData, headDataCom, expandable, check, radio, checkJson, sortTable, orderTypeArr, orderFieldArr, radioValue, disabledJson, align, tableCell, operate, setRadio, setCheck, totalDataJson, loadMore, loadMoreRender, onClickMore, total, pageCom, sizeCom, loadMoreUrl, expandValue, expandMultiple, disabledExpand, onExpand, defaultExpandAllRows, loadState, emptyProps, url, disabledArrStatus, posFixed, beyondText, fixedTable, fixedColumn, onClickRow, rowClassMapping, tipMaxWidth, lineHeight]);
|
|
3047
2853
|
// 表格分页memo
|
|
3048
|
-
|
|
2854
|
+
const TablePaginationMemo = useMemo(() => {
|
|
3049
2855
|
if (constData.current.page === null || constData.current.size === null || loadMore) return;
|
|
3050
2856
|
return pagination && jsx(TableHead, {
|
|
3051
2857
|
paginationType: paginationType,
|
|
@@ -3059,9 +2865,7 @@ var Table = function Table(propsInit) {
|
|
|
3059
2865
|
changeRowsPerPage: changeRowsPerPage,
|
|
3060
2866
|
refreshInside: refreshInside,
|
|
3061
2867
|
checkCount: checkCount,
|
|
3062
|
-
onRefresh:
|
|
3063
|
-
return setRefreshCom(Math.random());
|
|
3064
|
-
},
|
|
2868
|
+
onRefresh: () => setRefreshCom(Math.random()),
|
|
3065
2869
|
selectStatus: headSelectStatus,
|
|
3066
2870
|
selectAll: setAllCheck,
|
|
3067
2871
|
checkNumber: Object.keys(checkJson).length,
|
|
@@ -3069,9 +2873,9 @@ var Table = function Table(propsInit) {
|
|
|
3069
2873
|
});
|
|
3070
2874
|
}, [total, pageCom, sizeCom, sizeArrCom, pagination, loadMore, autoPagination, paginationType, flippingArrow, refreshInside, checkCount, headSelectStatus, rowData, checkJson, disabledJson, totalDataJson, rowData]);
|
|
3071
2875
|
// 表格内容滚动
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
2876
|
+
const tableBoxScroll = e => {
|
|
2877
|
+
const dom = tableRef.current;
|
|
2878
|
+
const scrollDom = e.target;
|
|
3075
2879
|
if (!dom || !scrollDom) return;
|
|
3076
2880
|
dom.classList.remove('table-scroll-left', 'table-scroll-right', 'table-scroll-middle');
|
|
3077
2881
|
if (scrollDom.scrollWidth <= scrollDom.clientWidth) return;
|
|
@@ -3088,8 +2892,8 @@ var Table = function Table(propsInit) {
|
|
|
3088
2892
|
dom.classList.add('table-scroll-middle');
|
|
3089
2893
|
};
|
|
3090
2894
|
// 处理class
|
|
3091
|
-
|
|
3092
|
-
|
|
2895
|
+
const handClass = () => {
|
|
2896
|
+
let str = "".concat($prefixCls, "-table");
|
|
3093
2897
|
if (showColumns === 'inside') str += " ".concat($prefixCls, "-table-columns-inside");
|
|
3094
2898
|
if (pagination) str += " ".concat($prefixCls, "-table-pagination");
|
|
3095
2899
|
if (loadMore) str += " ".concat($prefixCls, "-table-load-more");
|
|
@@ -3105,7 +2909,7 @@ var Table = function Table(propsInit) {
|
|
|
3105
2909
|
return str;
|
|
3106
2910
|
};
|
|
3107
2911
|
// 改变屏幕大小
|
|
3108
|
-
|
|
2912
|
+
const changeResize = () => {
|
|
3109
2913
|
tableBoxScroll({
|
|
3110
2914
|
target: containerRef.current
|
|
3111
2915
|
});
|