@para-ui/core 4.0.45 → 4.0.47
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/AlignBox/index.d.ts +18 -0
- package/AlignBox/index.js +26 -0
- package/Anchor/index.js +1 -1
- package/Argv/index.js +1 -1
- package/AutoBox/index.js +1 -1
- package/AutoButton/index.js +1 -1
- package/AutoTips/index.js +1 -1
- package/Breadcrumbs/index.js +1 -1
- package/Button/index.js +1 -1
- package/ButtonGroup/index.js +1 -1
- package/Card/index.js +1 -1
- package/Carousel/index.js +1 -1
- package/Cascader/index.js +6 -5
- package/Checkbox/index.js +1 -1
- package/CheckboxGroup/index.js +1 -1
- package/CodeEditor/index.js +1 -1
- package/ComboSelect/index.js +6 -4
- package/CopyText/index.js +1 -1
- package/CycleSelector/index.js +6 -3
- package/DatePicker/index.js +6 -2
- package/Descriptions/index.js +1 -1
- package/Desktop/index.js +1 -1
- package/DragVerify/index.js +1 -1
- package/Drawer/index.js +1 -1
- package/DynamicMultiBox/index.js +6 -4
- package/Form/index.js +6 -4
- package/FormItem/index.js +6 -4
- package/FunctionModal/index.js +3 -3
- package/GlobalContext/componentsProps.d.ts +4 -0
- package/Help/index.js +2 -2
- package/Image/index.js +4 -3
- package/InputCode/index.js +1 -1
- package/InputLang/index.js +1 -1
- package/InputNumber/index.js +1 -1
- package/Label/index.js +1 -1
- package/Menu/index.js +1 -1
- package/Modal/index.js +1 -1
- package/MultiBox/index.js +1 -1
- package/OperateBtn/index.js +1 -1
- package/PageHeader/index.js +1 -1
- package/Pagination/index.js +1 -1
- package/PopConfirm/index.js +1 -1
- package/PopMenu/index.js +1 -1
- package/Popover/index.js +1 -1
- package/Progress/index.js +1 -1
- package/QuickReply/index.js +1 -1
- package/README.md +16 -2
- package/Radio/index.js +1 -1
- package/RadioGroup/index.js +1 -1
- package/RangeInput/index.js +1 -1
- package/Result/index.js +1 -1
- package/ScrollBar/index.d.ts +27 -0
- package/ScrollBar/index.js +153 -0
- package/Search/index.js +1 -1
- package/Select/index.js +1 -1
- package/SelectInput/index.js +1 -1
- package/Selector/index.js +1 -1
- package/SelectorPicker/index.js +1 -1
- package/SingleBox/index.js +1 -1
- package/Slider/index.js +1 -1
- package/Stepper/index.js +1 -1
- package/Switch/index.js +1 -1
- package/Table/index.js +534 -509
- package/Table/interface.d.ts +2 -0
- package/Table/tableBodyInterface.d.ts +4 -0
- package/Table/tableElement/index.d.ts +1 -0
- package/Tabs/index.js +3 -3
- package/Tag/TagGroup.d.ts +4 -0
- package/Tag/index.d.ts +4 -0
- package/Tag/index.js +110 -63
- package/TextEditor/index.js +1 -1
- package/TextField/index.js +1 -1
- package/TimePicker/index.js +6 -2
- package/Timeline/index.js +3 -2
- package/Title/index.js +1 -1
- package/ToggleButton/index.js +3 -2
- package/Tooltip/index.js +1 -1
- package/Transfer/index.js +1 -1
- package/Tree/index.js +5 -4
- package/Upload/index.js +4 -3
- package/_verture/{Portal-42560ff0.js → Portal-f9bedb3a.js} +2 -1
- package/_verture/{defineProperty-f0e15205.js → defineProperty-6f62bb2a.js} +2 -10
- package/_verture/{index-5f0bfdcf.js → index-6647cbf6.js} +3 -2
- package/_verture/{index-3fcb421f.js → index-972707a5.js} +4 -3
- package/_verture/{modalContext-369509dd.js → modalContext-8a48c400.js} +1 -1
- package/_verture/{tslib.es6-f43aa41d.js → tslib.es6-55ed4bd2.js} +1 -1
- package/_verture/typeof-adeedc13.js +11 -0
- package/index.d.ts +4 -0
- package/index.js +12 -9
- package/package.json +1 -1
- package/umd/AlignBox.js +1 -0
- package/umd/Anchor.js +1 -1
- package/umd/Argv.js +1 -1
- package/umd/Checkbox.js +1 -1
- package/umd/CheckboxGroup.js +1 -1
- package/umd/ComboSelect.js +9 -9
- package/umd/CopyText.js +1 -1
- package/umd/CycleSelector.js +2 -2
- package/umd/DatePicker.js +2 -2
- package/umd/Descriptions.js +1 -1
- package/umd/Desktop.js +1 -1
- package/umd/DynamicMultiBox.js +5 -5
- package/umd/Form.js +5 -5
- package/umd/FormItem.js +5 -5
- package/umd/Help.js +1 -1
- package/umd/InputCode.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/InputNumber.js +1 -1
- package/umd/Label.js +1 -1
- package/umd/MultiBox.js +1 -1
- package/umd/Pagination.js +1 -1
- package/umd/PopMenu.js +1 -1
- package/umd/QuickReply.js +1 -1
- package/umd/Radio.js +1 -1
- package/umd/RadioGroup.js +1 -1
- package/umd/RangeInput.js +1 -1
- package/umd/ScrollBar.js +1 -0
- package/umd/Search.js +1 -1
- package/umd/Select.js +1 -1
- package/umd/SelectInput.js +1 -1
- package/umd/Selector.js +1 -1
- package/umd/SelectorPicker.js +1 -1
- package/umd/SingleBox.js +1 -1
- package/umd/Switch.js +1 -1
- package/umd/Table.js +5 -5
- package/umd/Tabs.js +1 -1
- package/umd/Tag.js +6 -6
- package/umd/TextEditor.js +1 -1
- package/umd/TextField.js +1 -1
- package/umd/TimePicker.js +2 -2
- package/umd/Title.js +1 -1
- package/umd/Transfer.js +1 -1
- package/umd/Tree.js +1 -1
- /package/_verture/{index-95e30df5.js → index-73a0446f.js} +0 -0
package/Table/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as __rest, a as __awaiter } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useRef, useState, useEffect, useMemo, useCallback, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { Get, Post, DeepClone, GetBrowserClass, Cancel, ArrayToObject } from '@paraview/lib';
|
|
5
|
-
import { _ as _typeof, a as _defineProperty } from '../_verture/defineProperty-f0e15205.js';
|
|
6
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
|
|
7
5
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
6
|
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
9
7
|
import { Popover } from '../Popover/index.js';
|
|
@@ -25,6 +23,7 @@ import Refresh from '@para-ui/icons/Refresh';
|
|
|
25
23
|
import { Pagination } from '../Pagination/index.js';
|
|
26
24
|
import { Loading } from '../Loading/index.js';
|
|
27
25
|
import { u as useGlobalProps } from '../_verture/useGlobalProps-4ae1a007.js';
|
|
26
|
+
import ScrollBar from '../ScrollBar/index.js';
|
|
28
27
|
import '../Tooltip/index.js';
|
|
29
28
|
import 'rc-tooltip';
|
|
30
29
|
import 'rc-tooltip/lib/placements';
|
|
@@ -64,23 +63,25 @@ import '@para-ui/icons/DoubleRight';
|
|
|
64
63
|
* 发送请求
|
|
65
64
|
* @param obj {ReqProps} 请求信息
|
|
66
65
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
const requestFunc = obj => {
|
|
67
|
+
const {
|
|
68
|
+
method,
|
|
69
|
+
url,
|
|
70
|
+
ctx,
|
|
71
|
+
data
|
|
72
|
+
} = obj,
|
|
72
73
|
otherProps = __rest(obj, ["method", "url", "ctx", "data"]);
|
|
73
74
|
if (method === 'Get') {
|
|
74
75
|
return Get(Object.assign({
|
|
75
76
|
url: url,
|
|
76
|
-
ctx
|
|
77
|
+
ctx
|
|
77
78
|
}, otherProps));
|
|
78
79
|
}
|
|
79
80
|
if (method === 'Post') {
|
|
80
81
|
return Post(Object.assign({
|
|
81
82
|
url: url,
|
|
82
|
-
ctx
|
|
83
|
-
data
|
|
83
|
+
ctx,
|
|
84
|
+
data
|
|
84
85
|
}, otherProps));
|
|
85
86
|
}
|
|
86
87
|
};
|
|
@@ -89,23 +90,23 @@ var requestFunc = function requestFunc(obj) {
|
|
|
89
90
|
* @param obj {ReqProps} 请求信息
|
|
90
91
|
* @return string get请求地址参数
|
|
91
92
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
for (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (
|
|
93
|
+
const handGetReqParams = obj => {
|
|
94
|
+
let str = obj.url;
|
|
95
|
+
const params = obj.data || {};
|
|
96
|
+
const arrKey = Object.keys(params);
|
|
97
|
+
const paramsArr = [];
|
|
98
|
+
for (let i = 0, l = arrKey.length; i < l; i++) {
|
|
99
|
+
const key = arrKey[i];
|
|
100
|
+
let val = params[key];
|
|
101
|
+
if (typeof val === 'object') {
|
|
101
102
|
val = encodeURIComponent(JSON.stringify(val));
|
|
102
103
|
} else {
|
|
103
104
|
val = encodeURIComponent(val);
|
|
104
105
|
}
|
|
105
106
|
paramsArr.push("".concat(key, "=").concat(val));
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
const paramsStr = paramsArr.join('&');
|
|
109
|
+
const pos = str.indexOf('?');
|
|
109
110
|
if (pos !== -1) {
|
|
110
111
|
str += (pos === str.length - 1 ? '' : '&') + paramsStr;
|
|
111
112
|
} else {
|
|
@@ -116,9 +117,9 @@ var handGetReqParams = function handGetReqParams(obj) {
|
|
|
116
117
|
/**
|
|
117
118
|
* 提取字符串里面的数字
|
|
118
119
|
* */
|
|
119
|
-
|
|
120
|
+
const getStringInNumber = str => {
|
|
120
121
|
if (typeof str === 'number') return str;
|
|
121
|
-
|
|
122
|
+
const strHand = str.replace(/[^0-9$]/gi, '');
|
|
122
123
|
return Number(strHand);
|
|
123
124
|
};
|
|
124
125
|
/**
|
|
@@ -126,23 +127,23 @@ var getStringInNumber = function getStringInNumber(str) {
|
|
|
126
127
|
* @param key {string} 键值
|
|
127
128
|
* @param num {number} 过期天数
|
|
128
129
|
* */
|
|
129
|
-
|
|
130
|
+
const getLocalStorageSelectHead = (key, num) => {
|
|
130
131
|
//debugger
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
for (
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
const headJsonStr = window.localStorage.getItem('_paraui_table_head') || '{}';
|
|
133
|
+
const headJson = JSON.parse(headJsonStr);
|
|
134
|
+
const headJsonArr = Object.keys(headJson);
|
|
135
|
+
for (let i = 0, l = headJsonArr.length; i < l; i++) {
|
|
136
|
+
const keyStr = headJsonArr[i];
|
|
137
|
+
const item = headJson[i];
|
|
137
138
|
if (!item) continue;
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
const newDate = new Date().getTime(); // 当前时间
|
|
140
|
+
const endTime = item.storageTime + item.validity; // 过期时间
|
|
140
141
|
// 过期时间 小于 当前时间, 说明已经过期了, 删除当前表格列数据
|
|
141
142
|
if (endTime < newDate) {
|
|
142
143
|
delete headJson[keyStr];
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
|
-
|
|
146
|
+
const headJsonItem = headJson[key];
|
|
146
147
|
// 重置过期时间
|
|
147
148
|
if (headJsonItem) {
|
|
148
149
|
headJsonItem.storageTime = new Date().getTime();
|
|
@@ -155,9 +156,9 @@ var getLocalStorageSelectHead = function getLocalStorageSelectHead(key, num) {
|
|
|
155
156
|
* @param key {string} 键值
|
|
156
157
|
* @param val {HeadLocalStorageItem} 保存值
|
|
157
158
|
* */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
const setLocalStorageSelectHead = (key, val) => {
|
|
160
|
+
const headJsonStr = window.localStorage.getItem('_paraui_table_head') || '{}';
|
|
161
|
+
const headJson = JSON.parse(headJsonStr);
|
|
161
162
|
headJson[key] = val;
|
|
162
163
|
window.localStorage.setItem('_paraui_table_head', JSON.stringify(headJson));
|
|
163
164
|
};
|
|
@@ -166,8 +167,8 @@ var setLocalStorageSelectHead = function setLocalStorageSelectHead(key, val) {
|
|
|
166
167
|
* @param el 当前元素
|
|
167
168
|
* @param selector 查找元素class
|
|
168
169
|
*/
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
const closest = (el, selector) => {
|
|
171
|
+
const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
|
171
172
|
while (el) {
|
|
172
173
|
if (matchesSelector.call(el, selector)) {
|
|
173
174
|
break;
|
|
@@ -363,70 +364,50 @@ var zh = {
|
|
|
363
364
|
};
|
|
364
365
|
|
|
365
366
|
var localeJson = {
|
|
366
|
-
zh
|
|
367
|
-
en
|
|
367
|
+
zh,
|
|
368
|
+
en
|
|
368
369
|
};
|
|
369
370
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
headData =
|
|
373
|
-
sortTable
|
|
374
|
-
filter
|
|
375
|
-
expandable
|
|
376
|
-
check
|
|
377
|
-
radio
|
|
378
|
-
onRequestSort
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
checked = _useState4[0],
|
|
411
|
-
setChecked = _useState4[1]; // 选中
|
|
412
|
-
var _useState5 = useState(null),
|
|
413
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
414
|
-
anchorElColums = _useState6[0],
|
|
415
|
-
setAnchorElColums = _useState6[1]; // 显示列定位元素
|
|
416
|
-
var _useState7 = useState({}),
|
|
417
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
418
|
-
headDataJson = _useState8[0],
|
|
419
|
-
setHeadDataJson = _useState8[1]; // 显示列json
|
|
420
|
-
var _useState9 = useState({}),
|
|
421
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
422
|
-
filterHead = _useState10[0],
|
|
423
|
-
setFilterHead = _useState10[1]; // 过滤项当前表头数据
|
|
424
|
-
var _useState11 = useState({}),
|
|
425
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
426
|
-
selectFilterCom = _useState12[0],
|
|
427
|
-
setSelectFilterCom = _useState12[1]; // 过滤项当前选中值
|
|
428
|
-
var intl = useFormatMessage('Table', localeJson);
|
|
429
|
-
useEffect(function () {
|
|
371
|
+
const TableHead$1 = props => {
|
|
372
|
+
const {
|
|
373
|
+
headData = [],
|
|
374
|
+
sortTable,
|
|
375
|
+
filter,
|
|
376
|
+
expandable,
|
|
377
|
+
check,
|
|
378
|
+
radio,
|
|
379
|
+
onRequestSort,
|
|
380
|
+
orderFieldArr = [],
|
|
381
|
+
orderTypeArr = [],
|
|
382
|
+
selectAll,
|
|
383
|
+
selectStatus,
|
|
384
|
+
align,
|
|
385
|
+
showList = [],
|
|
386
|
+
changeShowList,
|
|
387
|
+
selectFilter,
|
|
388
|
+
changeFilter,
|
|
389
|
+
operate,
|
|
390
|
+
showColumns,
|
|
391
|
+
fixedTable,
|
|
392
|
+
fixedColumn,
|
|
393
|
+
posFixed,
|
|
394
|
+
beyondText,
|
|
395
|
+
lineWidth,
|
|
396
|
+
dragColumn,
|
|
397
|
+
dragRow,
|
|
398
|
+
changeColumnWidth,
|
|
399
|
+
headDataConfig,
|
|
400
|
+
getPopupContainer,
|
|
401
|
+
tipMaxWidth
|
|
402
|
+
} = props;
|
|
403
|
+
const [indeterminate, setIndeterminate] = useState(false); // 半选中
|
|
404
|
+
const [checked, setChecked] = useState(false); // 选中
|
|
405
|
+
const [anchorElColums, setAnchorElColums] = useState(null); // 显示列定位元素
|
|
406
|
+
const [headDataJson, setHeadDataJson] = useState({}); // 显示列json
|
|
407
|
+
const [filterHead, setFilterHead] = useState({}); // 过滤项当前表头数据
|
|
408
|
+
const [selectFilterCom, setSelectFilterCom] = useState({}); // 过滤项当前选中值
|
|
409
|
+
const intl = useFormatMessage('Table', localeJson);
|
|
410
|
+
useEffect(() => {
|
|
430
411
|
// 全选
|
|
431
412
|
if (selectStatus === 'all') {
|
|
432
413
|
setChecked(true);
|
|
@@ -443,17 +424,17 @@ var TableHead$1 = function TableHead(props) {
|
|
|
443
424
|
setIndeterminate(false);
|
|
444
425
|
}
|
|
445
426
|
}, [selectStatus]);
|
|
446
|
-
useEffect(
|
|
427
|
+
useEffect(() => {
|
|
447
428
|
if (headData) {
|
|
448
|
-
|
|
449
|
-
for (
|
|
450
|
-
|
|
429
|
+
const json = [];
|
|
430
|
+
for (let i = 0, l = headData.length; i < l; i++) {
|
|
431
|
+
const item = headData[i];
|
|
451
432
|
json[item.name] = item;
|
|
452
433
|
}
|
|
453
434
|
setHeadDataJson(json);
|
|
454
435
|
}
|
|
455
436
|
}, [headData]);
|
|
456
|
-
useEffect(
|
|
437
|
+
useEffect(() => {
|
|
457
438
|
if (selectFilter) setSelectFilterCom(DeepClone(selectFilter));
|
|
458
439
|
}, [selectFilter]);
|
|
459
440
|
/**
|
|
@@ -461,30 +442,28 @@ var TableHead$1 = function TableHead(props) {
|
|
|
461
442
|
* @param name 排序列
|
|
462
443
|
* @param event 当前排序元素
|
|
463
444
|
*/
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
if (onRequestSort) onRequestSort(event, name);
|
|
469
|
-
};
|
|
445
|
+
const createSortHandler = (name, item) => event => {
|
|
446
|
+
// 不存在排序,不触发事件
|
|
447
|
+
if (!(sortTable && item.name && item.sort !== false)) return;
|
|
448
|
+
if (onRequestSort) onRequestSort(event, name);
|
|
470
449
|
};
|
|
471
450
|
/**
|
|
472
451
|
* 全选 / 全不选
|
|
473
452
|
* @param event 操作元素
|
|
474
453
|
* @param bol 选中 / 不选中
|
|
475
454
|
*/
|
|
476
|
-
|
|
455
|
+
const onSelectAll = (event, bol) => {
|
|
477
456
|
if (selectAll) selectAll(event, bol);
|
|
478
457
|
};
|
|
479
458
|
/**
|
|
480
459
|
* 点击显示选择列
|
|
481
460
|
* @param event 点击元素
|
|
482
461
|
*/
|
|
483
|
-
|
|
462
|
+
const clickShowColums = event => {
|
|
484
463
|
setAnchorElColums(event.currentTarget);
|
|
485
464
|
};
|
|
486
465
|
// 点击隐藏选择列
|
|
487
|
-
|
|
466
|
+
const clickHideColums = bol => {
|
|
488
467
|
if (bol) return;
|
|
489
468
|
setAnchorElColums(null);
|
|
490
469
|
};
|
|
@@ -492,29 +471,27 @@ var TableHead$1 = function TableHead(props) {
|
|
|
492
471
|
* 点击显示列 列表
|
|
493
472
|
* @param item 详细
|
|
494
473
|
*/
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
arr1.push(headDataJson[_name]);
|
|
508
|
-
}
|
|
509
|
-
changeShowList && changeShowList(arr1, false, item);
|
|
510
|
-
} else {
|
|
511
|
-
headData.push(item);
|
|
512
|
-
changeShowList && changeShowList(headData, false, item);
|
|
474
|
+
const clickColumsList = item => () => {
|
|
475
|
+
if (item.disabledSelection) return;
|
|
476
|
+
const name = item.name;
|
|
477
|
+
const itemHead = headDataJson[name];
|
|
478
|
+
if (itemHead) {
|
|
479
|
+
// 取消勾选
|
|
480
|
+
delete headDataJson[name];
|
|
481
|
+
const arr = Object.keys(headDataJson);
|
|
482
|
+
const arr1 = [];
|
|
483
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
484
|
+
const name = arr[i];
|
|
485
|
+
arr1.push(headDataJson[name]);
|
|
513
486
|
}
|
|
514
|
-
|
|
487
|
+
changeShowList && changeShowList(arr1, false, item);
|
|
488
|
+
} else {
|
|
489
|
+
headData.push(item);
|
|
490
|
+
changeShowList && changeShowList(headData, false, item);
|
|
491
|
+
}
|
|
515
492
|
};
|
|
516
493
|
// 重置显示列
|
|
517
|
-
|
|
494
|
+
const resetShowList = () => {
|
|
518
495
|
changeShowList && changeShowList(headData, true);
|
|
519
496
|
};
|
|
520
497
|
/**
|
|
@@ -522,69 +499,63 @@ var TableHead$1 = function TableHead(props) {
|
|
|
522
499
|
* @param headCell 当前列信息
|
|
523
500
|
* @param event 元素
|
|
524
501
|
*/
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
setSelectFilterCom(Object.assign({}, selectFilter));
|
|
529
|
-
};
|
|
502
|
+
const clickShowFilter = headCell => event => {
|
|
503
|
+
setFilterHead(headCell);
|
|
504
|
+
setSelectFilterCom(Object.assign({}, selectFilter));
|
|
530
505
|
};
|
|
531
506
|
// 点击隐藏过滤
|
|
532
|
-
|
|
507
|
+
const clickHideFilter = bol => {
|
|
533
508
|
if (bol) return;
|
|
534
509
|
setFilterHead({});
|
|
535
510
|
setSelectFilterCom(Object.assign({}, selectFilter));
|
|
536
511
|
};
|
|
537
512
|
// 点击过滤
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
filterValue = [filterValue[num]];
|
|
556
|
-
}
|
|
513
|
+
const clickFilter = item => () => {
|
|
514
|
+
const name = filterHead.name;
|
|
515
|
+
let filterValue = DeepClone(selectFilterCom[name] || []);
|
|
516
|
+
const index = filterValue.indexOf(item.value);
|
|
517
|
+
if (index !== -1) {
|
|
518
|
+
// 勾选 -> 不勾选
|
|
519
|
+
filterValue.splice(index, 1);
|
|
520
|
+
} else {
|
|
521
|
+
// 不勾选 -> 勾选
|
|
522
|
+
filterValue.push(item.value);
|
|
523
|
+
}
|
|
524
|
+
const filterRadio = filterHead.filterRadio;
|
|
525
|
+
if (filterRadio) {
|
|
526
|
+
// 过滤单个
|
|
527
|
+
const num = filterValue.indexOf(item.value);
|
|
528
|
+
if (num !== -1) {
|
|
529
|
+
filterValue = [filterValue[num]];
|
|
557
530
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
};
|
|
531
|
+
}
|
|
532
|
+
selectFilterCom[name] = filterValue;
|
|
533
|
+
setSelectFilterCom(Object.assign({}, selectFilterCom));
|
|
561
534
|
};
|
|
562
535
|
/**
|
|
563
536
|
* 重置 / 确定过滤
|
|
564
537
|
* @param type {'reset' | 'confirm'} 重置 / 确定过滤
|
|
565
538
|
*/
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
};
|
|
539
|
+
const filterFunc = type => () => {
|
|
540
|
+
if (type === 'confirm') {
|
|
541
|
+
// 确定
|
|
542
|
+
changeFilter && changeFilter(Object.assign({}, selectFilterCom));
|
|
543
|
+
setFilterHead({});
|
|
544
|
+
} else {
|
|
545
|
+
// 重置
|
|
546
|
+
const json = DeepClone(selectFilterCom);
|
|
547
|
+
delete json[filterHead.name];
|
|
548
|
+
setSelectFilterCom(json);
|
|
549
|
+
changeFilter && changeFilter(Object.assign({}, json));
|
|
550
|
+
setFilterHead({});
|
|
551
|
+
}
|
|
581
552
|
};
|
|
582
553
|
/**
|
|
583
554
|
* 自定义过滤确定
|
|
584
555
|
* @param val {[name: string]: any[]}
|
|
585
556
|
* */
|
|
586
|
-
|
|
587
|
-
|
|
557
|
+
const filterCustomConfirm = function () {
|
|
558
|
+
let val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
588
559
|
changeFilter && changeFilter(Object.assign({}, val));
|
|
589
560
|
setFilterHead({});
|
|
590
561
|
};
|
|
@@ -592,12 +563,12 @@ var TableHead$1 = function TableHead(props) {
|
|
|
592
563
|
* 处理TableCell
|
|
593
564
|
* @param item 当前列信息
|
|
594
565
|
*/
|
|
595
|
-
|
|
596
|
-
|
|
566
|
+
const handCellClass = item => {
|
|
567
|
+
let str = 'table-header-box';
|
|
597
568
|
// 排序
|
|
598
569
|
if (sortTable && item.name && item.sort !== false) {
|
|
599
570
|
str += ' table-header-box-sort';
|
|
600
|
-
|
|
571
|
+
const index = orderFieldArr.indexOf(item.name);
|
|
601
572
|
if (index !== -1) {
|
|
602
573
|
// 升序
|
|
603
574
|
if (orderTypeArr[index] === 'asc') {
|
|
@@ -616,10 +587,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
616
587
|
return str;
|
|
617
588
|
};
|
|
618
589
|
// 复选框memo
|
|
619
|
-
|
|
590
|
+
const TableCheckMemo = useMemo(() => {
|
|
620
591
|
if (check) {
|
|
621
|
-
|
|
622
|
-
|
|
592
|
+
const handCls = () => {
|
|
593
|
+
let str = 'table-checkbox table-head-btn';
|
|
623
594
|
if (fixedColumn) {
|
|
624
595
|
str += ' table-fixed-dom-left';
|
|
625
596
|
// 左边没有定位,且没有单选,没有嵌套表格
|
|
@@ -647,10 +618,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
647
618
|
}
|
|
648
619
|
}, [check, indeterminate, checked, selectAll, posFixed, radio, expandable, fixedColumn]);
|
|
649
620
|
// 单选框memo
|
|
650
|
-
|
|
621
|
+
const TableRadioMemo = useMemo(() => {
|
|
651
622
|
if (radio) {
|
|
652
|
-
|
|
653
|
-
|
|
623
|
+
const handCls = () => {
|
|
624
|
+
let str = 'table-radio table-head-btn';
|
|
654
625
|
if (fixedColumn) {
|
|
655
626
|
str += ' table-fixed-dom-left';
|
|
656
627
|
// 左边没有定位,没有嵌套表格
|
|
@@ -672,10 +643,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
672
643
|
}
|
|
673
644
|
}, [radio, posFixed, expandable, fixedColumn]);
|
|
674
645
|
// 嵌套表格memo
|
|
675
|
-
|
|
646
|
+
const TableExpandableMemo = useMemo(() => {
|
|
676
647
|
if (expandable) {
|
|
677
|
-
|
|
678
|
-
|
|
648
|
+
const handCls = () => {
|
|
649
|
+
let str = 'table-expandable table-head-btn';
|
|
679
650
|
if (fixedColumn) {
|
|
680
651
|
str += ' table-fixed-dom-left';
|
|
681
652
|
// 左边没有定位,没有嵌套表格
|
|
@@ -697,21 +668,21 @@ var TableHead$1 = function TableHead(props) {
|
|
|
697
668
|
}
|
|
698
669
|
}, [expandable, posFixed, fixedColumn]);
|
|
699
670
|
// 过滤弹窗内容
|
|
700
|
-
|
|
701
|
-
|
|
671
|
+
const filterPopoverContent = () => {
|
|
672
|
+
const name = filterHead.name;
|
|
702
673
|
if (!name) return;
|
|
703
|
-
|
|
674
|
+
const filterValue = selectFilterCom[name] || [];
|
|
704
675
|
if (filterHead.filterRender) {
|
|
705
676
|
// 自定义渲染过滤
|
|
706
677
|
return filterHead.filterRender({
|
|
707
|
-
filterValue
|
|
678
|
+
filterValue,
|
|
708
679
|
selectFilter: selectFilterCom,
|
|
709
|
-
filterHead
|
|
680
|
+
filterHead,
|
|
710
681
|
setFilter: filterCustomConfirm
|
|
711
682
|
});
|
|
712
683
|
}
|
|
713
|
-
|
|
714
|
-
|
|
684
|
+
const arr = filterHead.enums || [];
|
|
685
|
+
let str = 'filter-select';
|
|
715
686
|
if (arr.length === 0) str += ' filter-select-none';
|
|
716
687
|
return jsx("div", Object.assign({
|
|
717
688
|
className: str
|
|
@@ -726,8 +697,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
726
697
|
children: [jsx("div", Object.assign({
|
|
727
698
|
className: "filter-select-box"
|
|
728
699
|
}, {
|
|
729
|
-
children: arr.map(
|
|
730
|
-
|
|
700
|
+
children: arr.map((item, index) => {
|
|
701
|
+
const checked = filterValue.indexOf(item.value) !== -1;
|
|
731
702
|
return jsxs("div", Object.assign({
|
|
732
703
|
onClick: clickFilter(item),
|
|
733
704
|
className: checked ? 'filter-select-item filter-select-item-select' : 'filter-select-item'
|
|
@@ -766,30 +737,28 @@ var TableHead$1 = function TableHead(props) {
|
|
|
766
737
|
}));
|
|
767
738
|
};
|
|
768
739
|
// 表格列拖拽放下
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
changeColumnWidth && changeColumnWidth(headCell, result);
|
|
772
|
-
};
|
|
740
|
+
const onDragDown = headCell => result => {
|
|
741
|
+
changeColumnWidth && changeColumnWidth(headCell, result);
|
|
773
742
|
};
|
|
774
743
|
// 获取宽度
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
744
|
+
const getWidth = item => {
|
|
745
|
+
let w = item.width || '';
|
|
746
|
+
const name = item.name || '';
|
|
747
|
+
const wDrag = headDataConfig[name] && headDataConfig[name].width;
|
|
779
748
|
if (wDrag) w = "".concat(wDrag, "px");
|
|
780
749
|
return w;
|
|
781
750
|
};
|
|
782
751
|
// 内容列memo
|
|
783
|
-
|
|
752
|
+
const TableContentMemo = useMemo(() => {
|
|
784
753
|
// 处理过滤的class
|
|
785
|
-
|
|
786
|
-
|
|
754
|
+
const handFilterClass = item => {
|
|
755
|
+
let str = 'table-header-filter';
|
|
787
756
|
if (filterHead.name === item.name) str += ' table-header-filter-show';
|
|
788
757
|
if (item.name && selectFilterCom[item.name] && selectFilterCom[item.name].length > 0) str += ' table-header-filter-select';
|
|
789
758
|
return str;
|
|
790
759
|
};
|
|
791
|
-
|
|
792
|
-
|
|
760
|
+
const handCls = item => {
|
|
761
|
+
let str = '';
|
|
793
762
|
if (item.className) str += item.className;
|
|
794
763
|
if (fixedColumn && item.fixed) {
|
|
795
764
|
str += " table-fixed-dom-".concat(item.fixed);
|
|
@@ -804,8 +773,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
804
773
|
}
|
|
805
774
|
return str;
|
|
806
775
|
};
|
|
807
|
-
|
|
808
|
-
|
|
776
|
+
const handStyle = item => {
|
|
777
|
+
const json = {
|
|
809
778
|
width: getWidth(item)
|
|
810
779
|
};
|
|
811
780
|
if (fixedColumn && item.fixed && item.width) {
|
|
@@ -819,13 +788,13 @@ var TableHead$1 = function TableHead(props) {
|
|
|
819
788
|
return Object.assign(Object.assign({}, json), item.style);
|
|
820
789
|
};
|
|
821
790
|
// 处理拖拽
|
|
822
|
-
|
|
791
|
+
const handDrag = item => {
|
|
823
792
|
if (item.name === 'table-serial-number') return false; // 序号不拖拽
|
|
824
793
|
if (dragColumn && item.drag !== false) return true;
|
|
825
794
|
return false;
|
|
826
795
|
};
|
|
827
|
-
return headData.map(
|
|
828
|
-
|
|
796
|
+
return headData.map((headCell, index) => {
|
|
797
|
+
let str = "".concat($prefixCls, "-filter-popover ").concat($prefixCls, "-scrollbar-small");
|
|
829
798
|
if (!headCell.filterRender) str += " ".concat($prefixCls, "-filter-popover-default");
|
|
830
799
|
return jsx(ThElement, Object.assign({
|
|
831
800
|
className: handCls(headCell),
|
|
@@ -845,9 +814,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
845
814
|
content: headCell.name !== undefined && filterHead.name === headCell.name && filterPopoverContent(),
|
|
846
815
|
onVisibleChange: clickHideFilter,
|
|
847
816
|
overlayClassName: str,
|
|
848
|
-
getPopupContainer: getPopupContainer ? getPopupContainer :
|
|
849
|
-
return document.body;
|
|
850
|
-
},
|
|
817
|
+
getPopupContainer: getPopupContainer ? getPopupContainer : () => document.body,
|
|
851
818
|
maxWidth: headCell.filterMaxWidth
|
|
852
819
|
}, {
|
|
853
820
|
children: jsxs("div", Object.assign({
|
|
@@ -892,10 +859,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
892
859
|
});
|
|
893
860
|
}, [headData, sortTable, filter, orderFieldArr, orderTypeArr, align, filterHead, selectFilterCom, beyondText, selectFilter, fixedColumn, lineWidth, dragColumn, changeColumnWidth, headDataConfig, getPopupContainer, tipMaxWidth]);
|
|
894
861
|
// 操作栏memo
|
|
895
|
-
|
|
862
|
+
const TableOperateMemo = useMemo(() => {
|
|
896
863
|
if (operate) {
|
|
897
|
-
|
|
898
|
-
|
|
864
|
+
const handCls = () => {
|
|
865
|
+
let str = 'table-operate';
|
|
899
866
|
if (operate.operateBtnRender) str += ' table-operate-small';
|
|
900
867
|
if (showColumns === false) str += ' table-operate-not-columns';
|
|
901
868
|
if (dragRow) str += ' table-operate-drag-row';
|
|
@@ -908,8 +875,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
908
875
|
}
|
|
909
876
|
return str;
|
|
910
877
|
};
|
|
911
|
-
|
|
912
|
-
|
|
878
|
+
const handStyle = () => {
|
|
879
|
+
const json = {
|
|
913
880
|
width: operate.width
|
|
914
881
|
};
|
|
915
882
|
if (fixedColumn) {
|
|
@@ -945,16 +912,16 @@ var TableHead$1 = function TableHead(props) {
|
|
|
945
912
|
}
|
|
946
913
|
}, [operate, align, posFixed, showColumns, posFixed, beyondText, fixedColumn, tipMaxWidth, dragRow]);
|
|
947
914
|
// 显示列弹窗内容
|
|
948
|
-
|
|
915
|
+
const showListContent = () => {
|
|
949
916
|
return jsxs("div", Object.assign({
|
|
950
917
|
className: "show-colums-select"
|
|
951
918
|
}, {
|
|
952
919
|
children: [jsx("div", Object.assign({
|
|
953
920
|
className: "show-colums-select-box"
|
|
954
921
|
}, {
|
|
955
|
-
children: showList.map(
|
|
956
|
-
|
|
957
|
-
|
|
922
|
+
children: showList.map((item, index) => {
|
|
923
|
+
const checked = Boolean(headDataJson[item.name]);
|
|
924
|
+
let str = 'show-colums-select-item';
|
|
958
925
|
if (checked) str += ' show-colums-select-item-select';
|
|
959
926
|
if (item.disabledSelection) str += ' show-colums-select-item-disabled';
|
|
960
927
|
return jsxs("div", Object.assign({
|
|
@@ -988,9 +955,9 @@ var TableHead$1 = function TableHead(props) {
|
|
|
988
955
|
}));
|
|
989
956
|
};
|
|
990
957
|
// 显示列memo
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
958
|
+
const TableShowList = useMemo(() => {
|
|
959
|
+
const handCls = () => {
|
|
960
|
+
let str = 'show-colums table-fixed-dom-right';
|
|
994
961
|
// 没有固定列参数 或者 没有操作栏且没有右侧固定列
|
|
995
962
|
if (!fixedColumn || !operate && !(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
996
963
|
str += ' table-fixed-dom-right-first';
|
|
@@ -1003,9 +970,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
1003
970
|
content: showListContent(),
|
|
1004
971
|
onVisibleChange: clickHideColums,
|
|
1005
972
|
overlayClassName: "".concat($prefixCls, "-table-show-colums-popover ").concat($prefixCls, "-scrollbar-small"),
|
|
1006
|
-
getPopupContainer: getPopupContainer ? getPopupContainer :
|
|
1007
|
-
return document.body;
|
|
1008
|
-
}
|
|
973
|
+
getPopupContainer: getPopupContainer ? getPopupContainer : () => document.body
|
|
1009
974
|
}, {
|
|
1010
975
|
children: jsx(ThElement, Object.assign({
|
|
1011
976
|
align: "center",
|
|
@@ -1022,10 +987,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
1022
987
|
}));
|
|
1023
988
|
}, [showColumns, posFixed, operate, anchorElColums, showList, headDataJson, getPopupContainer, tipMaxWidth]);
|
|
1024
989
|
// 拖动行
|
|
1025
|
-
|
|
990
|
+
const TbaleDragRow = useMemo(() => {
|
|
1026
991
|
if (!dragRow || operate || showColumns === 'inside') return null;
|
|
1027
|
-
|
|
1028
|
-
|
|
992
|
+
const handCls = () => {
|
|
993
|
+
let str = 'drag-row table-fixed-dom-right';
|
|
1029
994
|
// 没有固定列参数 或者 没有操作栏且没有右侧固定列
|
|
1030
995
|
if (!fixedColumn || !operate && !(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
1031
996
|
str += ' table-fixed-dom-right-first';
|
|
@@ -1039,8 +1004,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
1039
1004
|
});
|
|
1040
1005
|
}, [operate, showColumns, fixedColumn, posFixed, dragRow]);
|
|
1041
1006
|
// 处理class
|
|
1042
|
-
|
|
1043
|
-
|
|
1007
|
+
const handClass = () => {
|
|
1008
|
+
let str = 'table-head';
|
|
1044
1009
|
if (showColumns === 'inside') str += ' table-head-inside';
|
|
1045
1010
|
if (!fixedTable) str += ' table-head-scroll'; // 防止长度过长
|
|
1046
1011
|
// 没有 复选框,单选框,展开 按钮
|
|
@@ -1118,98 +1083,76 @@ var TdElement = function TdElement(props) {
|
|
|
1118
1083
|
}));
|
|
1119
1084
|
};
|
|
1120
1085
|
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
rowData =
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
onDragRow = props.onDragRow;
|
|
1180
|
-
var _useState = useState(0),
|
|
1181
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1182
|
-
expandableColSpan = _useState2[0],
|
|
1183
|
-
setExpandableColSpan = _useState2[1]; // 嵌套表格合并列数
|
|
1184
|
-
var _useState3 = useState({}),
|
|
1185
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1186
|
-
expandableRow = _useState4[0],
|
|
1187
|
-
setExpandableRow = _useState4[1]; // 当前哪行展开表格嵌套
|
|
1188
|
-
var _useState5 = useState(true),
|
|
1189
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
1190
|
-
showMoreBtn = _useState6[0],
|
|
1191
|
-
setShowMoreBtn = _useState6[1]; // 加载更多
|
|
1192
|
-
var _useState7 = useState({}),
|
|
1193
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
1194
|
-
disabledExpandJson = _useState8[0],
|
|
1195
|
-
setDisabledExpand = _useState8[1]; // 禁用加减部分嵌套
|
|
1196
|
-
var _useState9 = useState(false),
|
|
1197
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
1198
|
-
dragBol = _useState10[0],
|
|
1199
|
-
setDragBol = _useState10[1];
|
|
1200
|
-
var intl = useFormatMessage('Table', localeJson);
|
|
1086
|
+
const TableBody = props => {
|
|
1087
|
+
const {
|
|
1088
|
+
url,
|
|
1089
|
+
emptyProps,
|
|
1090
|
+
rowData = [],
|
|
1091
|
+
rowKey = 'key',
|
|
1092
|
+
check,
|
|
1093
|
+
radio,
|
|
1094
|
+
tableCell,
|
|
1095
|
+
expandable,
|
|
1096
|
+
headData = [],
|
|
1097
|
+
disabledJson = {},
|
|
1098
|
+
disabledArrStatus,
|
|
1099
|
+
checkJson = {},
|
|
1100
|
+
radioValue,
|
|
1101
|
+
selectCheck,
|
|
1102
|
+
selectRadio,
|
|
1103
|
+
align,
|
|
1104
|
+
operate,
|
|
1105
|
+
showColumns,
|
|
1106
|
+
fixedTable,
|
|
1107
|
+
fixedColumn,
|
|
1108
|
+
formatter,
|
|
1109
|
+
orderFieldArr = [],
|
|
1110
|
+
orderTypeArr = [],
|
|
1111
|
+
sortTable,
|
|
1112
|
+
loadState,
|
|
1113
|
+
loadMore,
|
|
1114
|
+
loadMoreRender,
|
|
1115
|
+
onClickMore,
|
|
1116
|
+
total,
|
|
1117
|
+
page,
|
|
1118
|
+
currentRowsPerPage,
|
|
1119
|
+
changePage,
|
|
1120
|
+
loadMoreUrl,
|
|
1121
|
+
expandMultiple = false,
|
|
1122
|
+
expandValue = [],
|
|
1123
|
+
disabledExpand = [],
|
|
1124
|
+
defaultExpandAllRows = false,
|
|
1125
|
+
onExpand,
|
|
1126
|
+
onRefresh,
|
|
1127
|
+
posFixed,
|
|
1128
|
+
beyondText,
|
|
1129
|
+
onClickRow,
|
|
1130
|
+
rowClassMapping,
|
|
1131
|
+
tipMaxWidth,
|
|
1132
|
+
lineHeight,
|
|
1133
|
+
dragRow,
|
|
1134
|
+
onDragRow,
|
|
1135
|
+
virtualIndex,
|
|
1136
|
+
virtual
|
|
1137
|
+
} = props;
|
|
1138
|
+
const [expandableColSpan, setExpandableColSpan] = useState(0); // 嵌套表格合并列数
|
|
1139
|
+
const [expandableRow, setExpandableRow] = useState({}); // 当前哪行展开表格嵌套
|
|
1140
|
+
const [showMoreBtn, setShowMoreBtn] = useState(true); // 加载更多
|
|
1141
|
+
const [disabledExpandJson, setDisabledExpand] = useState({}); // 禁用加减部分嵌套
|
|
1142
|
+
const [dragBol, setDragBol] = useState(false);
|
|
1143
|
+
const intl = useFormatMessage('Table', localeJson);
|
|
1201
1144
|
// 默认是否展开所有
|
|
1202
|
-
useEffect(
|
|
1145
|
+
useEffect(() => {
|
|
1203
1146
|
if (!defaultExpandAllRows) {
|
|
1204
1147
|
setExpandableRow({});
|
|
1205
1148
|
return;
|
|
1206
1149
|
}
|
|
1207
|
-
|
|
1208
|
-
for (
|
|
1209
|
-
|
|
1210
|
-
|
|
1150
|
+
const json = {};
|
|
1151
|
+
for (let i = 0, l = rowData.length; i < l; i++) {
|
|
1152
|
+
const item = rowData[i] || {};
|
|
1153
|
+
const id = item[rowKey];
|
|
1211
1154
|
json[id] = {
|
|
1212
|
-
id
|
|
1155
|
+
id,
|
|
1213
1156
|
status: 'develop'
|
|
1214
1157
|
};
|
|
1215
1158
|
}
|
|
@@ -1217,41 +1160,41 @@ var TableBody = function TableBody(props) {
|
|
|
1217
1160
|
}, [defaultExpandAllRows, rowData, rowKey]);
|
|
1218
1161
|
// 监听展开表格
|
|
1219
1162
|
// 如果直接写expandMultiple, expandValue会死循环
|
|
1220
|
-
useEffect(
|
|
1163
|
+
useEffect(() => {
|
|
1221
1164
|
if (props.expandValue === undefined) return;
|
|
1222
|
-
|
|
1223
|
-
|
|
1165
|
+
const json = {};
|
|
1166
|
+
let expandValueHand = expandValue;
|
|
1224
1167
|
// 只展开一个,去第一个值
|
|
1225
1168
|
if (!expandMultiple && expandValue.length > 0) {
|
|
1226
1169
|
expandValueHand = [expandValue[0]];
|
|
1227
1170
|
}
|
|
1228
|
-
for (
|
|
1229
|
-
|
|
1171
|
+
for (let i = 0, l = expandValueHand.length; i < l; i++) {
|
|
1172
|
+
const id = expandValueHand[i];
|
|
1230
1173
|
json[id] = {
|
|
1231
|
-
id
|
|
1174
|
+
id,
|
|
1232
1175
|
status: 'develop'
|
|
1233
1176
|
};
|
|
1234
1177
|
}
|
|
1235
1178
|
setExpandableRow(json);
|
|
1236
1179
|
}, [props.expandMultiple, props.expandValue, rowData]);
|
|
1237
1180
|
// 监听禁用嵌套 props.disabledExpand 防止死循环
|
|
1238
|
-
useEffect(
|
|
1239
|
-
|
|
1240
|
-
for (
|
|
1241
|
-
|
|
1181
|
+
useEffect(() => {
|
|
1182
|
+
const json = {};
|
|
1183
|
+
for (let i = 0, l = disabledExpand.length; i < l; i++) {
|
|
1184
|
+
const id = disabledExpand[i];
|
|
1242
1185
|
json[id] = true;
|
|
1243
1186
|
}
|
|
1244
1187
|
setDisabledExpand(json);
|
|
1245
1188
|
}, [props.disabledExpand]);
|
|
1246
|
-
useEffect(
|
|
1189
|
+
useEffect(() => {
|
|
1247
1190
|
if (loadMoreUrl) {
|
|
1248
|
-
|
|
1191
|
+
const bol = Number(total) > Number(page) * Number(currentRowsPerPage);
|
|
1249
1192
|
setShowMoreBtn(bol);
|
|
1250
1193
|
}
|
|
1251
1194
|
}, [loadMoreUrl, total, page, currentRowsPerPage]);
|
|
1252
1195
|
// 处理嵌套表格合并列数
|
|
1253
|
-
useEffect(
|
|
1254
|
-
|
|
1196
|
+
useEffect(() => {
|
|
1197
|
+
let num = headData.length;
|
|
1255
1198
|
if (expandable) num += 1;
|
|
1256
1199
|
if (check) num += 1;
|
|
1257
1200
|
if (radio) num += 1;
|
|
@@ -1260,55 +1203,55 @@ var TableBody = function TableBody(props) {
|
|
|
1260
1203
|
setExpandableColSpan(num);
|
|
1261
1204
|
}, [headData, expandable, check, radio]);
|
|
1262
1205
|
// 展开/收起嵌套表格
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
status: status
|
|
1272
|
-
};
|
|
1273
|
-
if (expandMultiple) {
|
|
1274
|
-
// 展开多个
|
|
1275
|
-
expandableRow[id] = expandItem;
|
|
1276
|
-
setExpandableRow(Object.assign({}, expandableRow));
|
|
1277
|
-
} else {
|
|
1278
|
-
// 展开一个
|
|
1279
|
-
setExpandableRow(_defineProperty({}, id, expandItem));
|
|
1280
|
-
}
|
|
1281
|
-
onExpand && onExpand(row, status);
|
|
1282
|
-
event.stopPropagation();
|
|
1206
|
+
const handClickNestTable = row => event => {
|
|
1207
|
+
const id = row[rowKey];
|
|
1208
|
+
let expandItem = expandableRow[id] || {};
|
|
1209
|
+
let status = 'develop';
|
|
1210
|
+
if (expandItem.status === 'develop') status = 'retract';
|
|
1211
|
+
expandItem = {
|
|
1212
|
+
id,
|
|
1213
|
+
status
|
|
1283
1214
|
};
|
|
1215
|
+
if (expandMultiple) {
|
|
1216
|
+
// 展开多个
|
|
1217
|
+
expandableRow[id] = expandItem;
|
|
1218
|
+
setExpandableRow(Object.assign({}, expandableRow));
|
|
1219
|
+
} else {
|
|
1220
|
+
// 展开一个
|
|
1221
|
+
setExpandableRow({
|
|
1222
|
+
[id]: expandItem
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
onExpand && onExpand(row, status);
|
|
1226
|
+
event.stopPropagation();
|
|
1284
1227
|
};
|
|
1285
1228
|
// 处理class
|
|
1286
|
-
|
|
1287
|
-
|
|
1229
|
+
const handClass = () => {
|
|
1230
|
+
let str = 'table-body';
|
|
1288
1231
|
if (!fixedTable) str += ' table-body-scroll';
|
|
1289
1232
|
// 没有 复选框,单选框,展开 按钮
|
|
1290
1233
|
if (!check && !radio && !expandable) str += ' table-body-no-btn';
|
|
1291
1234
|
return str;
|
|
1292
1235
|
};
|
|
1293
1236
|
// 处理嵌套表格class
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1237
|
+
const handExpandClass = row => {
|
|
1238
|
+
const id = row[rowKey];
|
|
1239
|
+
const expandItem = expandableRow[id] || {};
|
|
1240
|
+
let str = 'retract';
|
|
1298
1241
|
if (expandItem.status === 'develop') {
|
|
1299
1242
|
str = 'expand';
|
|
1300
1243
|
}
|
|
1301
1244
|
return str;
|
|
1302
1245
|
};
|
|
1303
1246
|
// 点击加载更多
|
|
1304
|
-
|
|
1247
|
+
const clickMore = () => {
|
|
1305
1248
|
if (loadMoreUrl) changePage && changePage();
|
|
1306
1249
|
onClickMore && onClickMore();
|
|
1307
1250
|
};
|
|
1308
1251
|
// 暂无数据memo
|
|
1309
|
-
|
|
1252
|
+
const NodataMemo = useMemo(() => {
|
|
1310
1253
|
// 处理刷新按钮
|
|
1311
|
-
|
|
1254
|
+
const handRefreshBtn = () => {
|
|
1312
1255
|
if ((emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.showRefresh) !== undefined) {
|
|
1313
1256
|
return emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.showRefresh;
|
|
1314
1257
|
}
|
|
@@ -1318,7 +1261,7 @@ var TableBody = function TableBody(props) {
|
|
|
1318
1261
|
return false;
|
|
1319
1262
|
};
|
|
1320
1263
|
// 处理非首页非空状态
|
|
1321
|
-
|
|
1264
|
+
const handleDescription = () => {
|
|
1322
1265
|
if (emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.description) return emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.description;
|
|
1323
1266
|
if (Number(page) > 1) {
|
|
1324
1267
|
return jsxs("div", Object.assign({
|
|
@@ -1336,7 +1279,7 @@ var TableBody = function TableBody(props) {
|
|
|
1336
1279
|
children: jsx(Button, Object.assign({
|
|
1337
1280
|
variant: "text",
|
|
1338
1281
|
size: "small",
|
|
1339
|
-
onClick:
|
|
1282
|
+
onClick: () => {
|
|
1340
1283
|
changePage && changePage(Number(page) - 1);
|
|
1341
1284
|
}
|
|
1342
1285
|
}, {
|
|
@@ -1349,8 +1292,8 @@ var TableBody = function TableBody(props) {
|
|
|
1349
1292
|
}
|
|
1350
1293
|
};
|
|
1351
1294
|
// 处理className
|
|
1352
|
-
|
|
1353
|
-
|
|
1295
|
+
const handClassNoData = () => {
|
|
1296
|
+
let str = 'table-no-data';
|
|
1354
1297
|
if (emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.size) str += " table-no-data-".concat(emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.size);
|
|
1355
1298
|
return str;
|
|
1356
1299
|
};
|
|
@@ -1364,24 +1307,24 @@ var TableBody = function TableBody(props) {
|
|
|
1364
1307
|
children: jsx(Empty, Object.assign({}, emptyProps, {
|
|
1365
1308
|
description: handleDescription(),
|
|
1366
1309
|
showRefresh: handRefreshBtn(),
|
|
1367
|
-
onRefresh:
|
|
1310
|
+
onRefresh: event => {
|
|
1368
1311
|
if (emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.onRefresh) {
|
|
1369
1312
|
emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.onRefresh(event);
|
|
1370
1313
|
return;
|
|
1371
1314
|
}
|
|
1372
|
-
|
|
1315
|
+
onRefresh && onRefresh();
|
|
1373
1316
|
}
|
|
1374
1317
|
}))
|
|
1375
1318
|
}))
|
|
1376
1319
|
}));
|
|
1377
|
-
}, [expandableColSpan, emptyProps, url,
|
|
1320
|
+
}, [expandableColSpan, emptyProps, url, onRefresh, page, changePage]);
|
|
1378
1321
|
// 复选框useCallback
|
|
1379
|
-
|
|
1322
|
+
const TableCheckCallback = useCallback(row => {
|
|
1380
1323
|
if (check) {
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1324
|
+
const handId = row[rowKey];
|
|
1325
|
+
const disabledHand = Boolean(disabledJson[handId]);
|
|
1326
|
+
let checkHand = checkJson[handId] || false;
|
|
1327
|
+
let showCheck = true;
|
|
1385
1328
|
if (disabledHand && disabledArrStatus) {
|
|
1386
1329
|
// 选中
|
|
1387
1330
|
if (disabledArrStatus[handId] === true) {
|
|
@@ -1396,8 +1339,8 @@ var TableBody = function TableBody(props) {
|
|
|
1396
1339
|
showCheck = false;
|
|
1397
1340
|
}
|
|
1398
1341
|
}
|
|
1399
|
-
|
|
1400
|
-
|
|
1342
|
+
const handCls = () => {
|
|
1343
|
+
let str = 'table-checkbox table-body-btn';
|
|
1401
1344
|
if (fixedColumn) {
|
|
1402
1345
|
str += ' table-fixed-dom-left';
|
|
1403
1346
|
// 左边没有定位,且没有单选,没有嵌套表格
|
|
@@ -1414,7 +1357,7 @@ var TableBody = function TableBody(props) {
|
|
|
1414
1357
|
children: showCheck && jsx(Checkbox, {
|
|
1415
1358
|
disabled: disabledHand,
|
|
1416
1359
|
checked: checkHand,
|
|
1417
|
-
onChange:
|
|
1360
|
+
onChange: (event, bol) => {
|
|
1418
1361
|
event.stopPropagation();
|
|
1419
1362
|
selectCheck && selectCheck(event, bol, row[rowKey]);
|
|
1420
1363
|
}
|
|
@@ -1423,12 +1366,12 @@ var TableBody = function TableBody(props) {
|
|
|
1423
1366
|
}
|
|
1424
1367
|
}, [check, disabledJson, rowKey, checkJson, selectCheck, disabledArrStatus, posFixed, expandable, radio, fixedColumn]);
|
|
1425
1368
|
// 单选框useCallback
|
|
1426
|
-
|
|
1369
|
+
const TableRadioCallback = useCallback(row => {
|
|
1427
1370
|
if (radio) {
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1371
|
+
const handId = row[rowKey];
|
|
1372
|
+
const disabledHand = Boolean(disabledJson[handId]);
|
|
1373
|
+
let checkHand = radioValue === row[rowKey];
|
|
1374
|
+
let showRadio = true;
|
|
1432
1375
|
if (disabledHand && disabledArrStatus) {
|
|
1433
1376
|
// 选中
|
|
1434
1377
|
if (disabledArrStatus[handId] === true) {
|
|
@@ -1443,8 +1386,8 @@ var TableBody = function TableBody(props) {
|
|
|
1443
1386
|
showRadio = false;
|
|
1444
1387
|
}
|
|
1445
1388
|
}
|
|
1446
|
-
|
|
1447
|
-
|
|
1389
|
+
const handCls = () => {
|
|
1390
|
+
let str = 'table-radio table-body-btn';
|
|
1448
1391
|
if (fixedColumn) {
|
|
1449
1392
|
str += ' table-fixed-dom-left';
|
|
1450
1393
|
// 左边没有定位,没有嵌套表格
|
|
@@ -1461,7 +1404,7 @@ var TableBody = function TableBody(props) {
|
|
|
1461
1404
|
children: showRadio && jsx(Radio, {
|
|
1462
1405
|
disabled: disabledHand,
|
|
1463
1406
|
checked: checkHand,
|
|
1464
|
-
onChange:
|
|
1407
|
+
onChange: event => {
|
|
1465
1408
|
event.stopPropagation();
|
|
1466
1409
|
selectRadio && selectRadio(event, row[rowKey]);
|
|
1467
1410
|
}
|
|
@@ -1470,13 +1413,13 @@ var TableBody = function TableBody(props) {
|
|
|
1470
1413
|
}
|
|
1471
1414
|
}, [radio, disabledJson, radioValue, rowKey, selectRadio, disabledArrStatus, expandable, posFixed, fixedColumn]);
|
|
1472
1415
|
// 嵌套加减useCallback
|
|
1473
|
-
|
|
1416
|
+
const TableExpandableMemo = useCallback(row => {
|
|
1474
1417
|
if (!expandable) return null;
|
|
1475
|
-
|
|
1418
|
+
const expandableDemo = expandable(row);
|
|
1476
1419
|
// 禁用一行表格展开 或者 展开表格返回值为false,返回空列
|
|
1477
1420
|
if (disabledExpandJson[row[rowKey]] || expandableDemo === false) return jsx(TdElement, {});
|
|
1478
|
-
|
|
1479
|
-
|
|
1421
|
+
const handCls = () => {
|
|
1422
|
+
let str = 'table-expandable table-body-btn';
|
|
1480
1423
|
if (fixedColumn) {
|
|
1481
1424
|
str += ' table-fixed-dom-left';
|
|
1482
1425
|
// 左边没有定位,没有嵌套表格
|
|
@@ -1497,17 +1440,17 @@ var TableBody = function TableBody(props) {
|
|
|
1497
1440
|
}));
|
|
1498
1441
|
}, [expandable, expandableRow, rowKey, disabledExpandJson, onExpand, fixedColumn]);
|
|
1499
1442
|
// 表格一行内容useCallback
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
orderFieldArr
|
|
1503
|
-
orderTypeArr
|
|
1443
|
+
const TableContentUseCallback = useCallback((row, rowIndex) => {
|
|
1444
|
+
const params = {
|
|
1445
|
+
orderFieldArr,
|
|
1446
|
+
orderTypeArr
|
|
1504
1447
|
};
|
|
1505
|
-
|
|
1506
|
-
|
|
1448
|
+
const handContentClass = item => {
|
|
1449
|
+
let str = 'table-content-columms';
|
|
1507
1450
|
if (item.className) str += " ".concat(item.className);
|
|
1508
1451
|
// 排序
|
|
1509
1452
|
if (sortTable && item.name && item.sort !== false) {
|
|
1510
|
-
|
|
1453
|
+
const index = orderFieldArr.indexOf(item.name);
|
|
1511
1454
|
if (index !== -1) {
|
|
1512
1455
|
// 升序
|
|
1513
1456
|
if (orderTypeArr[index] === 'asc') {
|
|
@@ -1532,8 +1475,8 @@ var TableBody = function TableBody(props) {
|
|
|
1532
1475
|
}
|
|
1533
1476
|
return str;
|
|
1534
1477
|
};
|
|
1535
|
-
|
|
1536
|
-
|
|
1478
|
+
const handStyle = item => {
|
|
1479
|
+
const json = {};
|
|
1537
1480
|
if (fixedColumn && item.fixed && item.width) {
|
|
1538
1481
|
if (item.fixed === 'left') {
|
|
1539
1482
|
json.left = "".concat(item.paraui_left_width, "px");
|
|
@@ -1544,12 +1487,12 @@ var TableBody = function TableBody(props) {
|
|
|
1544
1487
|
}
|
|
1545
1488
|
return json;
|
|
1546
1489
|
};
|
|
1547
|
-
return tableCell ? tableCell(row, params) : headData.map(
|
|
1548
|
-
|
|
1549
|
-
|
|
1490
|
+
return tableCell ? tableCell(row, params) : headData.map((item, index) => {
|
|
1491
|
+
let text = row[item.name];
|
|
1492
|
+
let colSpan = 1;
|
|
1550
1493
|
if (item.render) text = item.render(row, item, row[item.name], index, rowIndex);
|
|
1551
1494
|
if (formatter) text = formatter(row, item, row[item.name], index, rowIndex);
|
|
1552
|
-
|
|
1495
|
+
const itemStyle = handStyle(item);
|
|
1553
1496
|
// 存在显示列,最后一列占两格
|
|
1554
1497
|
if (showColumns === 'inside' && !operate && index === headData.length - 1 && !dragRow) {
|
|
1555
1498
|
colSpan = 2;
|
|
@@ -1573,25 +1516,25 @@ var TableBody = function TableBody(props) {
|
|
|
1573
1516
|
});
|
|
1574
1517
|
}, [tableCell, headData, align, formatter, orderFieldArr, orderTypeArr, sortTable, showColumns, operate, beyondText, fixedColumn, tipMaxWidth, dragRow]);
|
|
1575
1518
|
// 操作栏useCallback
|
|
1576
|
-
|
|
1519
|
+
const TableOperateUseCallback = useCallback((row, rowIndex) => {
|
|
1577
1520
|
if (operate || dragRow) {
|
|
1578
|
-
|
|
1521
|
+
let colSpan = 1;
|
|
1579
1522
|
if (showColumns === 'inside' && operate) colSpan = 2;
|
|
1580
|
-
|
|
1523
|
+
const handOperate = () => {
|
|
1581
1524
|
if (operate === null || operate === void 0 ? void 0 : operate.render) return operate.render(row);
|
|
1582
1525
|
if (operate === null || operate === void 0 ? void 0 : operate.operateBtnRender) {
|
|
1583
|
-
|
|
1526
|
+
const operateConfig = operate.operateBtnRender(row, rowIndex);
|
|
1584
1527
|
return jsx(OperateBtn, Object.assign({}, operateConfig));
|
|
1585
1528
|
}
|
|
1586
1529
|
};
|
|
1587
|
-
|
|
1588
|
-
|
|
1530
|
+
const handStyle = () => {
|
|
1531
|
+
const json = {
|
|
1589
1532
|
right: '0'
|
|
1590
1533
|
};
|
|
1591
1534
|
return json;
|
|
1592
1535
|
};
|
|
1593
|
-
|
|
1594
|
-
|
|
1536
|
+
const handCls = () => {
|
|
1537
|
+
let str = 'table-operate';
|
|
1595
1538
|
if (!operate) str += ' table-operate-center';
|
|
1596
1539
|
if (fixedColumn) {
|
|
1597
1540
|
str += ' table-fixed-dom-right';
|
|
@@ -1632,11 +1575,11 @@ var TableBody = function TableBody(props) {
|
|
|
1632
1575
|
}
|
|
1633
1576
|
}, [operate, align, showColumns, posFixed, fixedColumn, dragRow, onDragRow, dragBol]);
|
|
1634
1577
|
// 嵌套表格useCallback
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1578
|
+
const TableExpandableContentUseCallback = useCallback(row => {
|
|
1579
|
+
const id = row[rowKey];
|
|
1580
|
+
const expandItem = expandableRow[id] || {};
|
|
1638
1581
|
if (expandable && expandItem.status === 'develop') {
|
|
1639
|
-
|
|
1582
|
+
const expandableDemo = expandable(row);
|
|
1640
1583
|
if (expandableDemo === false) return null; // 展开表格返回值为false,不展示这一行
|
|
1641
1584
|
return jsx(TrElement, Object.assign({
|
|
1642
1585
|
className: "table-body-expand-row"
|
|
@@ -1651,7 +1594,7 @@ var TableBody = function TableBody(props) {
|
|
|
1651
1594
|
}
|
|
1652
1595
|
}, [expandable, expandableRow, expandableColSpan, rowKey]);
|
|
1653
1596
|
// 加载更多
|
|
1654
|
-
|
|
1597
|
+
const MoreMemo = useMemo(() => {
|
|
1655
1598
|
if (!loadMore || !showMoreBtn) return null;
|
|
1656
1599
|
return jsx(TrElement, Object.assign({
|
|
1657
1600
|
className: "more-table-row",
|
|
@@ -1674,20 +1617,25 @@ var TableBody = function TableBody(props) {
|
|
|
1674
1617
|
}))
|
|
1675
1618
|
}));
|
|
1676
1619
|
}, [expandableColSpan, loadMore, loadMoreRender, onClickMore, showMoreBtn, changePage, loadMoreUrl, lineHeight]);
|
|
1677
|
-
|
|
1620
|
+
const TableBodySubjectContentMemo = useMemo(() => {
|
|
1621
|
+
let rowDataCom = rowData;
|
|
1622
|
+
if (virtual) {
|
|
1623
|
+
rowDataCom = rowDataCom.slice(virtualIndex[0], virtualIndex[1]);
|
|
1624
|
+
}
|
|
1678
1625
|
return jsx(Fragment, {
|
|
1679
|
-
children:
|
|
1680
|
-
|
|
1626
|
+
children: rowDataCom.map((row, idx) => {
|
|
1627
|
+
let str = 'table-body-row';
|
|
1681
1628
|
if (rowClassMapping && rowClassMapping[row[rowKey]]) {
|
|
1682
1629
|
str += " ".concat(rowClassMapping[row[rowKey]]);
|
|
1683
1630
|
}
|
|
1631
|
+
const index = idx + virtualIndex[0];
|
|
1684
1632
|
return jsxs(Fragment$1, {
|
|
1685
1633
|
children: [jsxs(TrElement, Object.assign({
|
|
1686
1634
|
className: str,
|
|
1687
1635
|
style: {
|
|
1688
1636
|
height: "".concat(lineHeight, "px")
|
|
1689
1637
|
},
|
|
1690
|
-
onClick:
|
|
1638
|
+
onClick: e => {
|
|
1691
1639
|
onClickRow && onClickRow(row, e);
|
|
1692
1640
|
}
|
|
1693
1641
|
}, {
|
|
@@ -1696,79 +1644,85 @@ var TableBody = function TableBody(props) {
|
|
|
1696
1644
|
}, index);
|
|
1697
1645
|
})
|
|
1698
1646
|
});
|
|
1699
|
-
}, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, disabledExpandJson, onExpand, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow, dragBol]);
|
|
1647
|
+
}, [rowData, rowKey, disabledJson, checkJson, radio, radioValue, expandable, expandableRow, tableCell, headData, align, operate, expandableColSpan, selectCheck, selectRadio, disabledExpandJson, onExpand, disabledArrStatus, showColumns, onClickRow, rowClassMapping, tipMaxWidth, lineHeight, dragRow, onDragRow, dragBol, virtualIndex, virtual]);
|
|
1700
1648
|
// 内容memo
|
|
1701
|
-
|
|
1649
|
+
const TableBodyContentMemo = useMemo(() => {
|
|
1702
1650
|
return jsxs(Fragment$1, {
|
|
1703
|
-
children: [TableBodySubjectContentMemo, MoreMemo
|
|
1651
|
+
children: [TableBodySubjectContentMemo, MoreMemo, virtual && jsx(TrElement, {
|
|
1652
|
+
className: 'virtual-scroll-height'
|
|
1653
|
+
})]
|
|
1704
1654
|
});
|
|
1705
|
-
}, [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, dragRow, onDragRow, dragBol]);
|
|
1655
|
+
}, [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, dragRow, onDragRow, dragBol, virtualIndex, virtual]);
|
|
1706
1656
|
// 处理内容
|
|
1707
|
-
|
|
1657
|
+
const handContent = () => {
|
|
1708
1658
|
// 无数据,且不再请求,显示暂无数据
|
|
1709
1659
|
if (rowData.length === 0 && !loadState) return NodataMemo;
|
|
1710
1660
|
return TableBodyContentMemo;
|
|
1711
1661
|
};
|
|
1712
|
-
|
|
1713
|
-
|
|
1662
|
+
const handleRowData = () => {
|
|
1663
|
+
const arr = [];
|
|
1714
1664
|
if (dragRow) {
|
|
1715
|
-
rowData.forEach(
|
|
1716
|
-
|
|
1665
|
+
rowData.forEach(item => {
|
|
1666
|
+
const obj = {};
|
|
1717
1667
|
obj[rowKey] = item[rowKey];
|
|
1718
1668
|
arr.push(obj);
|
|
1719
1669
|
});
|
|
1720
1670
|
}
|
|
1721
1671
|
return arr;
|
|
1722
1672
|
};
|
|
1723
|
-
|
|
1673
|
+
const onChoose = () => {
|
|
1724
1674
|
setDragBol(true);
|
|
1725
1675
|
};
|
|
1726
|
-
|
|
1676
|
+
const onDragRowCom = evt => {
|
|
1727
1677
|
setDragBol(false);
|
|
1728
1678
|
onDragRow && onDragRow(evt);
|
|
1729
1679
|
};
|
|
1680
|
+
const handleStyle = () => {
|
|
1681
|
+
const obj = {};
|
|
1682
|
+
if (virtual) {
|
|
1683
|
+
obj.height = rowData.length * lineHeight + 'px';
|
|
1684
|
+
obj.position = 'relative';
|
|
1685
|
+
obj.top = virtualIndex[0] * lineHeight + 'px';
|
|
1686
|
+
}
|
|
1687
|
+
return obj;
|
|
1688
|
+
};
|
|
1730
1689
|
return jsx(TableBodyElement, Object.assign({
|
|
1731
1690
|
className: handClass(),
|
|
1732
1691
|
drag: dragRow,
|
|
1733
1692
|
handle: '.drag-row-btn',
|
|
1734
1693
|
list: handleRowData(),
|
|
1735
1694
|
onDrag: onDragRowCom,
|
|
1736
|
-
onChoose: onChoose
|
|
1695
|
+
onChoose: onChoose,
|
|
1696
|
+
style: handleStyle()
|
|
1737
1697
|
}, {
|
|
1738
1698
|
children: handContent()
|
|
1739
1699
|
}));
|
|
1740
1700
|
};
|
|
1741
1701
|
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
checkNumber =
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
setIndeterminate = _useState2[1]; // 半选中
|
|
1767
|
-
var _useState3 = useState(false),
|
|
1768
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1769
|
-
checked = _useState4[0],
|
|
1770
|
-
setChecked = _useState4[1]; // 选中
|
|
1771
|
-
useEffect(function () {
|
|
1702
|
+
const TableHead = props => {
|
|
1703
|
+
const {
|
|
1704
|
+
paginationType,
|
|
1705
|
+
flippingArrow,
|
|
1706
|
+
autoPagination,
|
|
1707
|
+
total,
|
|
1708
|
+
page,
|
|
1709
|
+
rowsPerPage,
|
|
1710
|
+
currentRowsPerPage,
|
|
1711
|
+
changePage,
|
|
1712
|
+
changeRowsPerPage,
|
|
1713
|
+
refreshInside,
|
|
1714
|
+
checkCount,
|
|
1715
|
+
onRefresh,
|
|
1716
|
+
selectAll,
|
|
1717
|
+
selectStatus,
|
|
1718
|
+
checkNumber = 0,
|
|
1719
|
+
currentPageTotal = 0,
|
|
1720
|
+
resizePaginationLine
|
|
1721
|
+
} = props;
|
|
1722
|
+
const intl = useFormatMessage('Table', localeJson);
|
|
1723
|
+
const [indeterminate, setIndeterminate] = useState(false); // 半选中
|
|
1724
|
+
const [checked, setChecked] = useState(false); // 选中
|
|
1725
|
+
useEffect(() => {
|
|
1772
1726
|
// 全选
|
|
1773
1727
|
if (selectStatus === 'all') {
|
|
1774
1728
|
setChecked(true);
|
|
@@ -1790,23 +1744,23 @@ var TableHead = function TableHead(props) {
|
|
|
1790
1744
|
* @param event 操作元素
|
|
1791
1745
|
* @param bol 选中 / 不选中
|
|
1792
1746
|
*/
|
|
1793
|
-
|
|
1747
|
+
const onSelectAll = (event, bol) => {
|
|
1794
1748
|
if (selectAll) selectAll(event, bol);
|
|
1795
1749
|
};
|
|
1796
1750
|
// 改变页面
|
|
1797
|
-
|
|
1751
|
+
const changePageCom = num => {
|
|
1798
1752
|
changePage && changePage(num);
|
|
1799
1753
|
};
|
|
1800
1754
|
// 改变每页显示条数
|
|
1801
|
-
|
|
1755
|
+
const changeRowsPerPageCom = num => {
|
|
1802
1756
|
changeRowsPerPage && changeRowsPerPage(num);
|
|
1803
1757
|
};
|
|
1804
1758
|
// 刷新
|
|
1805
|
-
|
|
1759
|
+
const clickRefresh = () => {
|
|
1806
1760
|
onRefresh && onRefresh();
|
|
1807
1761
|
};
|
|
1808
1762
|
// 处理分页右侧
|
|
1809
|
-
|
|
1763
|
+
const handlePaginationRight = () => {
|
|
1810
1764
|
if (!checkCount) return null;
|
|
1811
1765
|
return jsxs("div", Object.assign({
|
|
1812
1766
|
className: 'table-pagination-right'
|
|
@@ -1829,8 +1783,8 @@ var TableHead = function TableHead(props) {
|
|
|
1829
1783
|
}));
|
|
1830
1784
|
};
|
|
1831
1785
|
// 处理样式
|
|
1832
|
-
|
|
1833
|
-
|
|
1786
|
+
const handleClass = () => {
|
|
1787
|
+
const str = 'table-pagination';
|
|
1834
1788
|
return str;
|
|
1835
1789
|
};
|
|
1836
1790
|
return jsxs("div", Object.assign({
|
|
@@ -1848,9 +1802,7 @@ var TableHead = function TableHead(props) {
|
|
|
1848
1802
|
currentRowsPerPage: currentRowsPerPage,
|
|
1849
1803
|
changePage: changePageCom,
|
|
1850
1804
|
changeRowsPerPage: changeRowsPerPageCom,
|
|
1851
|
-
getPopupContainer:
|
|
1852
|
-
return document.body;
|
|
1853
|
-
},
|
|
1805
|
+
getPopupContainer: () => document.body,
|
|
1854
1806
|
resizeLine: resizePaginationLine
|
|
1855
1807
|
}), refreshInside && jsx(Button.IconButton, Object.assign({
|
|
1856
1808
|
className: 'refresh-btn',
|
|
@@ -1865,14 +1817,16 @@ var TableHead = function TableHead(props) {
|
|
|
1865
1817
|
var css_248z$2 = ".table-container {\n overflow-x: auto;\n}";
|
|
1866
1818
|
styleInject(css_248z$2);
|
|
1867
1819
|
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1820
|
+
const TableContainer = props => {
|
|
1821
|
+
const {
|
|
1822
|
+
cRef,
|
|
1823
|
+
className,
|
|
1824
|
+
style,
|
|
1825
|
+
children
|
|
1826
|
+
} = props,
|
|
1873
1827
|
otherProps = __rest(props, ["cRef", "className", "style", "children"]);
|
|
1874
|
-
|
|
1875
|
-
|
|
1828
|
+
const handClass = () => {
|
|
1829
|
+
let str = 'table-container';
|
|
1876
1830
|
if (className) str += " ".concat(className);
|
|
1877
1831
|
return str;
|
|
1878
1832
|
};
|
|
@@ -1888,27 +1842,31 @@ var TableContainer = function TableContainer(props) {
|
|
|
1888
1842
|
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}";
|
|
1889
1843
|
styleInject(css_248z$1);
|
|
1890
1844
|
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1845
|
+
const TableElement = props => {
|
|
1846
|
+
const {
|
|
1847
|
+
className,
|
|
1848
|
+
style,
|
|
1849
|
+
fixedColumn,
|
|
1850
|
+
children,
|
|
1851
|
+
cRef
|
|
1852
|
+
} = props,
|
|
1853
|
+
otherProps = __rest(props, ["className", "style", "fixedColumn", "children", "cRef"]);
|
|
1854
|
+
const handClass = () => {
|
|
1855
|
+
let str = 'table-element';
|
|
1899
1856
|
if (fixedColumn) str += ' table-element-fixed-column';
|
|
1900
1857
|
if (className) str += " ".concat(className);
|
|
1901
1858
|
return str;
|
|
1902
1859
|
};
|
|
1903
1860
|
return jsx("table", Object.assign({
|
|
1904
1861
|
className: handClass(),
|
|
1905
|
-
style: style
|
|
1862
|
+
style: style,
|
|
1863
|
+
ref: cRef
|
|
1906
1864
|
}, otherProps, {
|
|
1907
1865
|
children: children
|
|
1908
1866
|
}));
|
|
1909
1867
|
};
|
|
1910
1868
|
|
|
1911
|
-
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 .drag-row {\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.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 td.table-operate > .table-operate-box {\n display: flex;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-btn-line {\n display: inline-block;\n width: 1px;\n height: 12px;\n background-color: rgb(213, 224, 250);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn {\n cursor: all-scroll;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn svg {\n font-size: 18px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center {\n padding-right: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center > .table-operate-box {\n justify-content: center;\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(233, 239, 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}";
|
|
1869
|
+
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-virtual > .table-contain {\n margin-right: 8px;\n}\n.paraui-v4-table.paraui-v4-virtual > .table-contain::-webkit-scrollbar {\n width: 0;\n}\n.paraui-v4-table.paraui-v4-virtual.paraui-v4-table-pagination .paraui-v4-scroll-bar {\n height: calc(100% - 36px);\n}\n.paraui-v4-table.paraui-v4-virtual.table-scroll-left .paraui-v4-scroll-bar, .paraui-v4-table.paraui-v4-virtual.table-scroll-right .paraui-v4-scroll-bar, .paraui-v4-table.paraui-v4-virtual.table-scroll-middle .paraui-v4-scroll-bar {\n padding-bottom: 8px;\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 .drag-row {\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.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 td.table-operate > .table-operate-box {\n display: flex;\n align-items: center;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-btn-line {\n display: inline-block;\n width: 1px;\n height: 12px;\n background-color: rgb(213, 224, 250);\n margin: 0 10px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn {\n cursor: all-scroll;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate > .table-operate-box .drag-row-btn svg {\n font-size: 18px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center {\n padding-right: 8px;\n}\n.paraui-v4-table > .table-contain > table > .table-body tr td.table-operate.table-operate-center > .table-operate-box {\n justify-content: center;\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(233, 239, 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}";
|
|
1912
1870
|
styleInject(css_248z);
|
|
1913
1871
|
|
|
1914
1872
|
const Table = propsInit => {
|
|
@@ -1989,7 +1947,8 @@ const Table = propsInit => {
|
|
|
1989
1947
|
refreshInside = props.url ? true : false,
|
|
1990
1948
|
checkCount = props.check ? true : false,
|
|
1991
1949
|
onDragRow,
|
|
1992
|
-
resizePaginationLine
|
|
1950
|
+
resizePaginationLine,
|
|
1951
|
+
virtual = false
|
|
1993
1952
|
} = props;
|
|
1994
1953
|
const intl = useFormatMessage('Table', localeJson);
|
|
1995
1954
|
const dayNum = props.expirationTime ? props.expirationTime === 0 ? 100000000 : props.expirationTime : 7; // 过期天数
|
|
@@ -2017,8 +1976,13 @@ const Table = propsInit => {
|
|
|
2017
1976
|
const [tableMinWidth, setTableMinWidth] = useState(0); // 表格最小width
|
|
2018
1977
|
const [posFixed, setPosFixed] = useState({}); // 固定位置
|
|
2019
1978
|
const [headDataConfig, setHeadDataConfig] = useState({}); // 表头配置
|
|
1979
|
+
const [virtualCom, setVirtualCom] = useState(false);
|
|
1980
|
+
const [virtualIndex, setVirtualIndex] = useState([0, 0]);
|
|
1981
|
+
const [scrollTop, setScrollTop] = useState(0);
|
|
1982
|
+
useState(0);
|
|
2020
1983
|
const containerRef = useRef(); // 表格内容高度
|
|
2021
1984
|
const tableRef = useRef(); // 表格
|
|
1985
|
+
const tableEleRef = useRef(); // 表格元素
|
|
2022
1986
|
const constData = useRef({
|
|
2023
1987
|
page: props.page !== undefined ? props.page : 1,
|
|
2024
1988
|
headDataConfig: {}
|
|
@@ -2067,13 +2031,7 @@ const Table = propsInit => {
|
|
|
2067
2031
|
handSize(size);
|
|
2068
2032
|
} else {
|
|
2069
2033
|
if (containerRef && containerRef.current) {
|
|
2070
|
-
|
|
2071
|
-
if (props.loadMore) height -= lineHeight;
|
|
2072
|
-
let num = Math.floor(height / lineHeight);
|
|
2073
|
-
/*// 取余大于0.5,加一条
|
|
2074
|
-
const numRemainder = height % lineHeight / lineHeight;
|
|
2075
|
-
if (numRemainder > 0.5) num += 1;*/
|
|
2076
|
-
const columnsNUmber = num < 1 ? size : num;
|
|
2034
|
+
const columnsNUmber = getVisibleWinNum();
|
|
2077
2035
|
if (sizeArr.indexOf(columnsNUmber) === -1) {
|
|
2078
2036
|
sizeArr.unshift(columnsNUmber);
|
|
2079
2037
|
// 数组排序
|
|
@@ -2262,12 +2220,27 @@ const Table = propsInit => {
|
|
|
2262
2220
|
}
|
|
2263
2221
|
}
|
|
2264
2222
|
}, [checkJson, rowData, disabledJson]);
|
|
2223
|
+
// 计算表格虚拟滚动
|
|
2224
|
+
useEffect(() => {
|
|
2225
|
+
handleVirtualizedIndex();
|
|
2226
|
+
}, [virtual, rowData, expandable]);
|
|
2265
2227
|
// 表格更新计算是否有滚动条
|
|
2266
2228
|
useEffect(() => {
|
|
2267
2229
|
tableBoxScroll({
|
|
2268
2230
|
target: containerRef.current
|
|
2269
2231
|
});
|
|
2270
2232
|
});
|
|
2233
|
+
// 可视化窗口显示条数 / 第一次显示条数
|
|
2234
|
+
const getVisibleWinNum = () => {
|
|
2235
|
+
let height = containerRef.current.clientHeight - 48;
|
|
2236
|
+
if (props.loadMore) height -= lineHeight;
|
|
2237
|
+
let num = Math.floor(height / lineHeight);
|
|
2238
|
+
/*// 取余大于0.5,加一条
|
|
2239
|
+
const numRemainder = height % lineHeight / lineHeight;
|
|
2240
|
+
if (numRemainder > 0.5) num += 1;*/
|
|
2241
|
+
const columnsNUmber = num < 1 ? size : num;
|
|
2242
|
+
return columnsNUmber;
|
|
2243
|
+
};
|
|
2271
2244
|
/** 设置size */
|
|
2272
2245
|
const handSize = num => {
|
|
2273
2246
|
constData.current.size = num;
|
|
@@ -3074,9 +3047,11 @@ const Table = propsInit => {
|
|
|
3074
3047
|
tipMaxWidth: tipMaxWidth,
|
|
3075
3048
|
lineHeight: lineHeight,
|
|
3076
3049
|
dragRow: dragRow,
|
|
3077
|
-
onDragRow: onDragRowCom
|
|
3050
|
+
onDragRow: onDragRowCom,
|
|
3051
|
+
virtualIndex: virtualIndex,
|
|
3052
|
+
virtual: virtualCom
|
|
3078
3053
|
});
|
|
3079
|
-
}, [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, dragRow, onDragRow]);
|
|
3054
|
+
}, [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, dragRow, onDragRow, virtualIndex, virtual, virtualCom]);
|
|
3080
3055
|
// 表格分页memo
|
|
3081
3056
|
const TablePaginationMemo = useMemo(() => {
|
|
3082
3057
|
if (constData.current.page === null || constData.current.size === null || loadMore) return;
|
|
@@ -3137,15 +3112,61 @@ const Table = propsInit => {
|
|
|
3137
3112
|
if (expandable) str += " ".concat($prefixCls, "-table-expandable");
|
|
3138
3113
|
if (rowData.length === 0) str += " ".concat($prefixCls, "-table-no-data");
|
|
3139
3114
|
if (loadState) str += " ".concat($prefixCls, "-table-load");
|
|
3115
|
+
if (virtualCom) str += " ".concat($prefixCls, "-virtual");
|
|
3140
3116
|
if (className) str += " ".concat(className);
|
|
3141
3117
|
return str;
|
|
3142
3118
|
};
|
|
3143
3119
|
// 改变屏幕大小
|
|
3144
3120
|
const changeResize = () => {
|
|
3121
|
+
handleVirtualizedIndex();
|
|
3145
3122
|
tableBoxScroll({
|
|
3146
3123
|
target: containerRef.current
|
|
3147
3124
|
});
|
|
3148
3125
|
};
|
|
3126
|
+
// 计算虚拟列表滚动索引
|
|
3127
|
+
const handleVirtualizedIndex = () => {
|
|
3128
|
+
// 可视窗口显示条数
|
|
3129
|
+
const visibleWinNum = getVisibleWinNum();
|
|
3130
|
+
// 索引差量 上下10条
|
|
3131
|
+
const indexDiff = 10;
|
|
3132
|
+
// 每页显示条数 > 可视窗口显示条数 + 2倍索引差量 + 开启条数 开启虚拟滚动
|
|
3133
|
+
if (virtual && !expandable && Number(sizeCom) > visibleWinNum + 2 * indexDiff) {
|
|
3134
|
+
setVirtualCom(true);
|
|
3135
|
+
// 最大滚动距离 超出说明到底部,定制向下滚动
|
|
3136
|
+
const maxScroll = tableEleRef.current.clientHeight - containerRef.current.clientHeight;
|
|
3137
|
+
if (containerRef.current.scrollTop >= maxScroll) {
|
|
3138
|
+
// 滚动到底部
|
|
3139
|
+
containerRef.current.scrollTop = maxScroll;
|
|
3140
|
+
setScrollTop(maxScroll);
|
|
3141
|
+
}
|
|
3142
|
+
setScrollTop(containerRef.current.scrollTop);
|
|
3143
|
+
const scrollDom = containerRef.current;
|
|
3144
|
+
// 上索引
|
|
3145
|
+
const topIndex = Math.floor(scrollDom.scrollTop / lineHeight);
|
|
3146
|
+
// 下索引
|
|
3147
|
+
const bottomIndex = topIndex + visibleWinNum + indexDiff;
|
|
3148
|
+
setVirtualIndex([topIndex, bottomIndex]);
|
|
3149
|
+
} else {
|
|
3150
|
+
setVirtualIndex([0, 0]);
|
|
3151
|
+
setVirtualCom(false); // 不显示虚拟滚动条
|
|
3152
|
+
}
|
|
3153
|
+
};
|
|
3154
|
+
const handleVirtualScroll = () => {
|
|
3155
|
+
if (!virtualCom) return null;
|
|
3156
|
+
return jsx(ScrollBar, {
|
|
3157
|
+
style: {
|
|
3158
|
+
position: 'absolute',
|
|
3159
|
+
top: 0,
|
|
3160
|
+
right: 0,
|
|
3161
|
+
zIndex: 100
|
|
3162
|
+
},
|
|
3163
|
+
scrollTotalLength: tableEleRef.current.clientHeight - containerRef.current.clientHeight,
|
|
3164
|
+
scrollLength: scrollTop,
|
|
3165
|
+
onScroll: scrollH => {
|
|
3166
|
+
containerRef.current.scrollTop = scrollH;
|
|
3167
|
+
}
|
|
3168
|
+
});
|
|
3169
|
+
};
|
|
3149
3170
|
return jsxs("div", Object.assign({
|
|
3150
3171
|
className: handClass(),
|
|
3151
3172
|
style: style,
|
|
@@ -3154,9 +3175,13 @@ const Table = propsInit => {
|
|
|
3154
3175
|
children: [jsx(TableContainer, Object.assign({
|
|
3155
3176
|
className: "table-contain",
|
|
3156
3177
|
cRef: containerRef,
|
|
3157
|
-
onScroll:
|
|
3178
|
+
onScroll: e => {
|
|
3179
|
+
handleVirtualizedIndex();
|
|
3180
|
+
tableBoxScroll(e);
|
|
3181
|
+
}
|
|
3158
3182
|
}, {
|
|
3159
3183
|
children: jsxs(TableElement, Object.assign({
|
|
3184
|
+
cRef: tableEleRef,
|
|
3160
3185
|
fixedColumn: fixedColumn,
|
|
3161
3186
|
style: {
|
|
3162
3187
|
minWidth: "".concat(tableMinWidth, "px")
|
|
@@ -3164,7 +3189,7 @@ const Table = propsInit => {
|
|
|
3164
3189
|
}, {
|
|
3165
3190
|
children: [TableHeadMemo, TableBodyMemo]
|
|
3166
3191
|
}))
|
|
3167
|
-
})), loadState && jsx(Loading, {}), TablePaginationMemo]
|
|
3192
|
+
})), handleVirtualScroll(), loadState && jsx(Loading, {}), TablePaginationMemo]
|
|
3168
3193
|
}));
|
|
3169
3194
|
};
|
|
3170
3195
|
|