@para-ui/core 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.js +180 -68
- package/AutoBox/protal.d.ts +17 -0
- package/AutoTips/index.js +4 -3
- package/Breadcrumbs/index.js +10 -7
- package/Button/index.js +15 -14
- package/ButtonGroup/index.js +3 -2
- package/Carousel/index.js +7 -5
- package/Cascader/index.d.ts +3 -1
- package/Cascader/index.js +13 -5
- package/Checkbox/index.js +27 -8
- package/CheckboxGroup/index.d.ts +2 -5
- package/CheckboxGroup/index.js +13 -10
- package/Collapse/index.js +11 -10
- package/CollapseBox/index.js +7 -6
- package/ComboSelect/index.js +161 -67
- package/ComboSelect/interface.d.ts +10 -9
- package/Container/index.js +24 -23
- package/DatePicker/index.js +12 -17
- package/DatePicker/util.d.ts +0 -1
- package/Desktop/index.js +6 -5
- package/Drawer/index.js +10 -9
- package/Dropdown/index.js +59 -6
- package/Empty/index.js +7 -6
- package/Form/index.js +6 -5
- package/FormItem/compoments/formFile/index.d.ts +16 -16
- package/FormItem/index.d.ts +19 -19
- package/FormItem/index.js +3 -2
- package/FunctionModal/index.js +3 -2
- package/GlobalContext/constant.d.ts +8 -0
- package/Help/index.js +3 -2
- package/HelperText/index.d.ts +9 -5
- package/HelperText/index.js +9 -4
- package/InputLang/index.d.ts +2 -5
- package/InputLang/index.js +13 -7
- package/InputNumber/index.d.ts +2 -5
- package/InputNumber/index.js +15 -12
- package/Label/index.d.ts +2 -0
- package/Label/index.js +12 -8
- package/Loading/index.js +5 -4
- package/Menu/index.js +18 -17
- package/Message/index.js +5 -4
- package/Modal/index.js +28 -26
- package/MultiBox/index.d.ts +2 -5
- package/MultiBox/index.js +13 -6
- package/Notification/index.js +3 -2
- package/OperateBtn/index.js +15 -12
- package/PageHeader/index.js +18 -18
- package/Pagination/index.js +10 -4
- package/ParauiProvider/index.js +1 -1
- package/PopConfirm/index.js +3 -2
- package/Popover/index.js +7 -4
- package/Progress/index.d.ts +2 -0
- package/Progress/index.js +13 -9
- package/Querying/index.js +6 -5
- package/README.md +30 -0
- package/Radio/index.js +22 -8
- package/RadioGroup/index.d.ts +2 -5
- package/RadioGroup/index.js +10 -7
- package/Search/index.js +13 -8
- package/Select/index.d.ts +2 -5
- package/Select/index.js +23 -20
- package/SelectInput/index.js +3 -2
- package/Selector/index.js +189 -81
- package/Selector/interface.d.ts +17 -7
- package/Selector/lang/en_US.d.ts +1 -0
- package/Selector/lang/zh_CN.d.ts +1 -0
- package/SelectorPicker/index.d.ts +2 -5
- package/SelectorPicker/index.js +20 -17
- package/SingleBox/index.d.ts +2 -5
- package/SingleBox/index.js +11 -6
- package/Slider/index.d.ts +4 -4
- package/Slider/index.js +9 -4
- package/Split/index.js +8 -7
- package/Stepper/index.js +7 -3
- package/Switch/index.js +10 -12
- package/Table/index.js +528 -300
- package/Table/interface.d.ts +45 -1
- package/Table/tableElement/index.d.ts +2 -2
- package/Table/util.d.ts +13 -1
- package/Tabs/index.js +7 -6
- package/Tag/index.js +12 -14
- package/TextField/index.d.ts +2 -5
- package/TextField/index.js +20 -18
- package/TimePicker/index.js +1 -0
- package/Timeline/index.js +13 -12
- package/Title/index.d.ts +30 -0
- package/Title/index.js +49 -0
- package/ToggleButton/index.js +13 -13
- package/Tooltip/index.js +59 -12
- package/Tooltip/interface.d.ts +2 -0
- package/Transfer/index.d.ts +6 -2
- package/Transfer/index.js +74 -37
- package/Transfer/lang/en_US.d.ts +2 -0
- package/Transfer/lang/zh_CN.d.ts +2 -0
- package/Tree/index.js +3 -2
- package/Tree/utils/tools.d.ts +0 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/ImgCrop/constants.d.ts +1 -1
- package/Upload/ImgCrop/interface.d.ts +5 -0
- package/Upload/index.js +56 -45
- package/_verture/constant-bf34e6fa.js +11 -0
- package/_verture/{index-abfdd262.js → index-3136f653.js} +63 -31
- package/_verture/{index-5bb4b5d7.js → index-77832168.js} +30 -17
- package/_verture/{modalContext-59669f93.js → modalContext-f1a611ab.js} +0 -0
- package/index.d.ts +2 -0
- package/index.js +7 -5
- package/package.json +2 -1
package/Table/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { r as regenerator } from '../_verture/index-342379c6.js';
|
|
|
5
5
|
import { _ as __rest, a as __awaiter } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { useState, useEffect, useMemo, useCallback, Fragment as Fragment$1, useRef } from 'react';
|
|
8
|
-
import { Get, Post, DeepClone, ArrayToObject, Cancel } from '@paraview/lib';
|
|
8
|
+
import { Get, Post, DeepClone, GetBrowserClass, ArrayToObject, Cancel } from '@paraview/lib';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
10
|
import { Popover } from '../Popover/index.js';
|
|
11
11
|
import { Checkbox } from '../Checkbox/index.js';
|
|
@@ -16,6 +16,7 @@ import SolidArrowUp from '@para-ui/icons/UpTriangleF';
|
|
|
16
16
|
import SolidArrowDown from '@para-ui/icons/DownTriangleF';
|
|
17
17
|
import Panel from '@para-ui/icons/Panel';
|
|
18
18
|
import { u as useFormatMessage } from '../_verture/useFormatMessage-ac9d6acf.js';
|
|
19
|
+
import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
19
20
|
import { _ as _defineProperty } from '../_verture/defineProperty-0590dc61.js';
|
|
20
21
|
import { Radio } from '../Radio/index.js';
|
|
21
22
|
import Empty from '../Empty/index.js';
|
|
@@ -23,6 +24,7 @@ import OperateBtn from '../OperateBtn/index.js';
|
|
|
23
24
|
import Down from '@para-ui/icons/Down';
|
|
24
25
|
import { Pagination } from '../Pagination/index.js';
|
|
25
26
|
import { Loading } from '../Loading/index.js';
|
|
27
|
+
import { u as useGlobalProps } from '../_verture/useGlobalProps-af9a2af6.js';
|
|
26
28
|
import '../Tooltip/index.js';
|
|
27
29
|
import 'rc-tooltip';
|
|
28
30
|
import 'rc-tooltip/lib/placements';
|
|
@@ -35,7 +37,6 @@ import '@para-ui/icons/Forbid';
|
|
|
35
37
|
import '../Dropdown/index.js';
|
|
36
38
|
import 'rc-dropdown';
|
|
37
39
|
import '@para-ui/core/GlobalContext';
|
|
38
|
-
import '../_verture/useGlobalProps-af9a2af6.js';
|
|
39
40
|
import '@para-ui/icons/More';
|
|
40
41
|
import 'rc-pagination';
|
|
41
42
|
import '@para-ui/icons/DoubleLeft';
|
|
@@ -124,8 +125,55 @@ var getStringInNumber = function getStringInNumber(str) {
|
|
|
124
125
|
var strHand = str.replace(/[^0-9$]/ig, '');
|
|
125
126
|
return Number(strHand);
|
|
126
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* 获取选择列localStorage
|
|
130
|
+
* @param key {string} 键值
|
|
131
|
+
* @param num {number} 过期天数
|
|
132
|
+
* */
|
|
133
|
+
|
|
134
|
+
var getLocalStorageSelectHead = function getLocalStorageSelectHead(key, num) {
|
|
135
|
+
//debugger
|
|
136
|
+
var headJsonStr = window.localStorage.getItem('_paraui_table_head') || '{}';
|
|
137
|
+
var headJson = JSON.parse(headJsonStr);
|
|
138
|
+
var headJsonArr = Object.keys(headJson);
|
|
139
|
+
|
|
140
|
+
for (var i = 0, l = headJsonArr.length; i < l; i++) {
|
|
141
|
+
var keyStr = headJsonArr[i];
|
|
142
|
+
var item = headJson[i];
|
|
143
|
+
if (!item) continue;
|
|
144
|
+
var newDate = new Date().getTime(); // 当前时间
|
|
145
|
+
|
|
146
|
+
var endTime = item.storageTime + item.validity; // 过期时间
|
|
147
|
+
// 过期时间 小于 当前时间, 说明已经过期了, 删除当前表格列数据
|
|
148
|
+
|
|
149
|
+
if (endTime < newDate) {
|
|
150
|
+
delete headJson[keyStr];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
var headJsonItem = headJson[key]; // 重置过期时间
|
|
155
|
+
|
|
156
|
+
if (headJsonItem) {
|
|
157
|
+
headJsonItem.storageTime = new Date().getTime();
|
|
158
|
+
headJsonItem.validity = num * (60 * 60 * 24);
|
|
159
|
+
}
|
|
127
160
|
|
|
128
|
-
|
|
161
|
+
return headJsonItem || {};
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* 设置选择列localStorage
|
|
165
|
+
* @param key {string} 键值
|
|
166
|
+
* @param val {HeadLocalStorageItem} 保存值
|
|
167
|
+
* */
|
|
168
|
+
|
|
169
|
+
var setLocalStorageSelectHead = function setLocalStorageSelectHead(key, val) {
|
|
170
|
+
var headJsonStr = window.localStorage.getItem('_paraui_table_head') || '{}';
|
|
171
|
+
var headJson = JSON.parse(headJsonStr);
|
|
172
|
+
headJson[key] = val;
|
|
173
|
+
window.localStorage.setItem('_paraui_table_head', JSON.stringify(headJson));
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
var css_248z$7 = ".table-head-element {\n display: table-header-group;\n}";
|
|
129
177
|
styleInject(css_248z$7);
|
|
130
178
|
|
|
131
179
|
var TableHeadElement = function TableHeadElement(props) {
|
|
@@ -135,7 +183,7 @@ var TableHeadElement = function TableHeadElement(props) {
|
|
|
135
183
|
otherProps = __rest(props, ["className", "style", "children"]);
|
|
136
184
|
|
|
137
185
|
var handClass = function handClass() {
|
|
138
|
-
var str = '
|
|
186
|
+
var str = 'table-head-element';
|
|
139
187
|
if (className) str += ' ' + className;
|
|
140
188
|
return str;
|
|
141
189
|
};
|
|
@@ -148,7 +196,7 @@ var TableHeadElement = function TableHeadElement(props) {
|
|
|
148
196
|
}));
|
|
149
197
|
};
|
|
150
198
|
|
|
151
|
-
var css_248z$6 = ".
|
|
199
|
+
var css_248z$6 = ".tr-element {\n display: table-row;\n outline: 0;\n vertical-align: middle;\n}";
|
|
152
200
|
styleInject(css_248z$6);
|
|
153
201
|
|
|
154
202
|
var TrElement = function TrElement(props) {
|
|
@@ -158,7 +206,7 @@ var TrElement = function TrElement(props) {
|
|
|
158
206
|
otherProps = __rest(props, ["className", "style", "children"]);
|
|
159
207
|
|
|
160
208
|
var handClass = function handClass() {
|
|
161
|
-
var str = '
|
|
209
|
+
var str = 'tr-element';
|
|
162
210
|
if (className) str += ' ' + className;
|
|
163
211
|
return str;
|
|
164
212
|
};
|
|
@@ -171,7 +219,7 @@ var TrElement = function TrElement(props) {
|
|
|
171
219
|
}));
|
|
172
220
|
};
|
|
173
221
|
|
|
174
|
-
var css_248z$5 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.
|
|
222
|
+
var css_248z$5 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.th-element {\n letter-spacing: 0.01071em;\n line-height: 1.43;\n padding: 0;\n font-weight: 700;\n font-size: 14px;\n background-color: rgb(248, 249, 251);\n border-bottom: 1px solid rgba(171, 176, 185, 0.12);\n height: 100%;\n}\n.th-element:first-child {\n border-top-left-radius: 4px;\n}\n.th-element:last-child {\n border-top-right-radius: 4px;\n}\n.th-element:hover {\n background-color: rgb(237, 241, 249);\n}\n.th-element.table-operate.table-operate-small {\n width: 112px;\n}\n.th-element.table-operate.table-operate-small > .table-header-box {\n width: 112px;\n}";
|
|
175
223
|
styleInject(css_248z$5);
|
|
176
224
|
|
|
177
225
|
var ThElement = function ThElement(props) {
|
|
@@ -181,7 +229,7 @@ var ThElement = function ThElement(props) {
|
|
|
181
229
|
otherProps = __rest(props, ["className", "style", "children"]);
|
|
182
230
|
|
|
183
231
|
var handClass = function handClass() {
|
|
184
|
-
var str = '
|
|
232
|
+
var str = 'th-element';
|
|
185
233
|
if (className) str += ' ' + className;
|
|
186
234
|
return str;
|
|
187
235
|
};
|
|
@@ -235,6 +283,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
235
283
|
operate = props.operate,
|
|
236
284
|
showColumns = props.showColumns,
|
|
237
285
|
fixedTable = props.fixedTable,
|
|
286
|
+
fixedColumn = props.fixedColumn,
|
|
238
287
|
posFixed = props.posFixed,
|
|
239
288
|
beyondText = props.beyondText;
|
|
240
289
|
|
|
@@ -490,10 +539,14 @@ var TableHead$1 = function TableHead(props) {
|
|
|
490
539
|
var TableCheckMemo = useMemo(function () {
|
|
491
540
|
if (check) {
|
|
492
541
|
var handCls = function handCls() {
|
|
493
|
-
var str = 'table-checkbox table-head-btn
|
|
542
|
+
var str = 'table-checkbox table-head-btn';
|
|
494
543
|
|
|
495
|
-
if (
|
|
496
|
-
str += '
|
|
544
|
+
if (fixedColumn) {
|
|
545
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,且没有单选,没有嵌套表格
|
|
546
|
+
|
|
547
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol) && !radio && !expandable) {
|
|
548
|
+
str += ' table-fixed-dom-left-last';
|
|
549
|
+
}
|
|
497
550
|
}
|
|
498
551
|
|
|
499
552
|
return str;
|
|
@@ -504,7 +557,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
504
557
|
className: handCls()
|
|
505
558
|
}, {
|
|
506
559
|
children: jsx("div", Object.assign({
|
|
507
|
-
className:
|
|
560
|
+
className: "table-header-box"
|
|
508
561
|
}, {
|
|
509
562
|
children: jsx(Checkbox, {
|
|
510
563
|
indeterminate: indeterminate,
|
|
@@ -514,45 +567,61 @@ var TableHead$1 = function TableHead(props) {
|
|
|
514
567
|
}))
|
|
515
568
|
}));
|
|
516
569
|
}
|
|
517
|
-
}, [check, indeterminate, checked, selectAll, posFixed, radio, expandable]); // 单选框memo
|
|
570
|
+
}, [check, indeterminate, checked, selectAll, posFixed, radio, expandable, fixedColumn]); // 单选框memo
|
|
518
571
|
|
|
519
572
|
var TableRadioMemo = useMemo(function () {
|
|
520
573
|
if (radio) {
|
|
521
574
|
var handCls = function handCls() {
|
|
522
|
-
var str = 'table-radio table-head-btn
|
|
575
|
+
var str = 'table-radio table-head-btn';
|
|
523
576
|
|
|
524
|
-
if (
|
|
525
|
-
str += '
|
|
577
|
+
if (fixedColumn) {
|
|
578
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,没有嵌套表格
|
|
579
|
+
|
|
580
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol) && !expandable) {
|
|
581
|
+
str += ' table-fixed-dom-left-last';
|
|
582
|
+
}
|
|
526
583
|
}
|
|
527
584
|
|
|
528
585
|
return str;
|
|
529
586
|
};
|
|
530
587
|
|
|
531
|
-
return jsx(ThElement, {
|
|
588
|
+
return jsx(ThElement, Object.assign({
|
|
532
589
|
align: "center",
|
|
533
590
|
className: handCls()
|
|
534
|
-
}
|
|
591
|
+
}, {
|
|
592
|
+
children: jsx("div", {
|
|
593
|
+
className: "table-header-box"
|
|
594
|
+
})
|
|
595
|
+
}));
|
|
535
596
|
}
|
|
536
|
-
}, [radio, posFixed, expandable]); // 嵌套表格memo
|
|
597
|
+
}, [radio, posFixed, expandable, fixedColumn]); // 嵌套表格memo
|
|
537
598
|
|
|
538
599
|
var TableExpandableMemo = useMemo(function () {
|
|
539
600
|
if (expandable) {
|
|
540
601
|
var handCls = function handCls() {
|
|
541
|
-
var str = 'table-expandable table-head-btn
|
|
602
|
+
var str = 'table-expandable table-head-btn';
|
|
542
603
|
|
|
543
|
-
if (
|
|
544
|
-
str += '
|
|
604
|
+
if (fixedColumn) {
|
|
605
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,没有嵌套表格
|
|
606
|
+
|
|
607
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol)) {
|
|
608
|
+
str += ' table-fixed-dom-left-last';
|
|
609
|
+
}
|
|
545
610
|
}
|
|
546
611
|
|
|
547
612
|
return str;
|
|
548
613
|
};
|
|
549
614
|
|
|
550
|
-
return jsx(ThElement, {
|
|
615
|
+
return jsx(ThElement, Object.assign({
|
|
551
616
|
align: "center",
|
|
552
617
|
className: handCls()
|
|
553
|
-
}
|
|
618
|
+
}, {
|
|
619
|
+
children: jsx("div", {
|
|
620
|
+
className: "table-header-box"
|
|
621
|
+
})
|
|
622
|
+
}));
|
|
554
623
|
}
|
|
555
|
-
}, [expandable, posFixed]); // 过滤弹窗内容
|
|
624
|
+
}, [expandable, posFixed, fixedColumn]); // 过滤弹窗内容
|
|
556
625
|
|
|
557
626
|
var filterPopoverContent = function filterPopoverContent() {
|
|
558
627
|
return jsxs("div", Object.assign({
|
|
@@ -615,17 +684,18 @@ var TableHead$1 = function TableHead(props) {
|
|
|
615
684
|
|
|
616
685
|
var handCls = function handCls(item) {
|
|
617
686
|
var str = '';
|
|
687
|
+
if (item.className) str += item.className;
|
|
618
688
|
|
|
619
|
-
if (item.fixed) {
|
|
620
|
-
str = '
|
|
689
|
+
if (fixedColumn && item.fixed) {
|
|
690
|
+
str = 'table-fixed-dom-' + item.fixed; // 固定左边,判断是否是最后一个
|
|
621
691
|
|
|
622
692
|
if (item.fixed === 'left' && item.paraui_fixed_left_last) {
|
|
623
|
-
str += '
|
|
693
|
+
str += ' table-fixed-dom-left-last';
|
|
624
694
|
} // 固定右边,判断是否是第一个
|
|
625
695
|
|
|
626
696
|
|
|
627
697
|
if (item.fixed === 'right' && item.paraui_fixed_right_first) {
|
|
628
|
-
str += '
|
|
698
|
+
str += ' table-fixed-dom-right-first';
|
|
629
699
|
}
|
|
630
700
|
}
|
|
631
701
|
|
|
@@ -637,7 +707,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
637
707
|
width: item.width
|
|
638
708
|
};
|
|
639
709
|
|
|
640
|
-
if (item.fixed && item.width) {
|
|
710
|
+
if (fixedColumn && item.fixed && item.width) {
|
|
641
711
|
if (item.fixed === 'left') {
|
|
642
712
|
json.left = item.paraui_left_width + 'px';
|
|
643
713
|
}
|
|
@@ -657,13 +727,15 @@ var TableHead$1 = function TableHead(props) {
|
|
|
657
727
|
visible: filterHead.name === item.name,
|
|
658
728
|
content: filterPopoverContent(),
|
|
659
729
|
onVisibleChange: clickHideFilter,
|
|
660
|
-
overlayClassName:
|
|
730
|
+
overlayClassName: "".concat($prefixCls, "-filter-popover ").concat($prefixCls, "-scrollbar-small")
|
|
661
731
|
}, {
|
|
662
|
-
children: jsx("
|
|
732
|
+
children: jsx("div", Object.assign({
|
|
663
733
|
className: handFilterClass(item),
|
|
664
734
|
onClick: clickShowFilter(item)
|
|
665
735
|
}, {
|
|
666
|
-
children: jsx(
|
|
736
|
+
children: jsx("span", {
|
|
737
|
+
children: jsx(Screen, {})
|
|
738
|
+
})
|
|
667
739
|
}))
|
|
668
740
|
}));
|
|
669
741
|
};
|
|
@@ -677,11 +749,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
677
749
|
children: jsxs("div", Object.assign({
|
|
678
750
|
className: handCellClass(headCell)
|
|
679
751
|
}, {
|
|
680
|
-
children: [
|
|
681
|
-
className: "table-header-title"
|
|
682
|
-
onClick: createSortHandler(headCell.name, headCell)
|
|
752
|
+
children: [jsx("div", Object.assign({
|
|
753
|
+
className: "table-header-title"
|
|
683
754
|
}, {
|
|
684
|
-
children:
|
|
755
|
+
children: jsx("span", Object.assign({
|
|
685
756
|
className: "table-header-title-label"
|
|
686
757
|
}, {
|
|
687
758
|
children: jsx(AutoTips, Object.assign({
|
|
@@ -689,29 +760,37 @@ var TableHead$1 = function TableHead(props) {
|
|
|
689
760
|
}, {
|
|
690
761
|
children: headCell.label
|
|
691
762
|
}))
|
|
692
|
-
}))
|
|
693
|
-
|
|
763
|
+
}))
|
|
764
|
+
})), filter && headCell.name && headCell.filter && handFilterPopover(headCell), sortTable && headCell.name && headCell.sort !== false && jsx("div", Object.assign({
|
|
765
|
+
className: "table-sort-svg"
|
|
766
|
+
}, {
|
|
767
|
+
children: jsxs("span", Object.assign({
|
|
768
|
+
onClick: createSortHandler(headCell.name, headCell)
|
|
694
769
|
}, {
|
|
695
770
|
children: [jsx(SolidArrowUp, {
|
|
696
771
|
className: "up-svg"
|
|
697
772
|
}), jsx(SolidArrowDown, {
|
|
698
773
|
className: "down-svg"
|
|
699
774
|
})]
|
|
700
|
-
}))
|
|
701
|
-
}))
|
|
775
|
+
}))
|
|
776
|
+
}))]
|
|
702
777
|
}))
|
|
703
778
|
}), headCell.name || index);
|
|
704
779
|
});
|
|
705
|
-
}, [headData, sortTable, filter, orderFieldArr, orderTypeArr, align, filterHead, selectFilterCom, beyondText, selectFilter]); // 操作栏memo
|
|
780
|
+
}, [headData, sortTable, filter, orderFieldArr, orderTypeArr, align, filterHead, selectFilterCom, beyondText, selectFilter, fixedColumn]); // 操作栏memo
|
|
706
781
|
|
|
707
782
|
var TableOperateMemo = useMemo(function () {
|
|
708
783
|
if (operate) {
|
|
709
784
|
var handCls = function handCls() {
|
|
710
|
-
var str = 'table-operate
|
|
785
|
+
var str = 'table-operate';
|
|
711
786
|
if (operate.operateBtnRender) str += ' table-operate-small';
|
|
712
787
|
|
|
713
|
-
if (
|
|
714
|
-
str += '
|
|
788
|
+
if (fixedColumn) {
|
|
789
|
+
str += ' table-fixed-dom-right'; // 存在显示列,且没有右侧固定列
|
|
790
|
+
|
|
791
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
792
|
+
str += ' table-fixed-dom-right-first';
|
|
793
|
+
}
|
|
715
794
|
}
|
|
716
795
|
|
|
717
796
|
return str;
|
|
@@ -719,9 +798,13 @@ var TableHead$1 = function TableHead(props) {
|
|
|
719
798
|
|
|
720
799
|
var handStyle = function handStyle() {
|
|
721
800
|
var json = {
|
|
722
|
-
width: operate.width
|
|
723
|
-
right: showColumns === "inside" ? '56px' : '0px'
|
|
801
|
+
width: operate.width
|
|
724
802
|
};
|
|
803
|
+
|
|
804
|
+
if (fixedColumn) {
|
|
805
|
+
json.right = showColumns === "inside" ? '56px' : '0px';
|
|
806
|
+
}
|
|
807
|
+
|
|
725
808
|
return Object.assign(Object.assign({}, json), operate.style);
|
|
726
809
|
};
|
|
727
810
|
|
|
@@ -749,7 +832,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
749
832
|
}))
|
|
750
833
|
}));
|
|
751
834
|
}
|
|
752
|
-
}, [operate, align, posFixed, showColumns, posFixed, beyondText]); // 显示列弹窗内容
|
|
835
|
+
}, [operate, align, posFixed, showColumns, posFixed, beyondText, fixedColumn]); // 显示列弹窗内容
|
|
753
836
|
|
|
754
837
|
var showListContent = function showListContent() {
|
|
755
838
|
return jsxs("div", Object.assign({
|
|
@@ -791,10 +874,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
791
874
|
|
|
792
875
|
var TableShowList = useMemo(function () {
|
|
793
876
|
var handCls = function handCls() {
|
|
794
|
-
var str = 'show-colums
|
|
877
|
+
var str = 'show-colums table-fixed-dom-right'; // 没有固定列参数 或者 没有操作栏且没有右侧固定列
|
|
795
878
|
|
|
796
|
-
if (!operate && !(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
797
|
-
str += '
|
|
879
|
+
if (!fixedColumn || !operate && !(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
880
|
+
str += ' table-fixed-dom-right-first';
|
|
798
881
|
}
|
|
799
882
|
|
|
800
883
|
return str;
|
|
@@ -805,7 +888,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
805
888
|
visible: Boolean(anchorElColums),
|
|
806
889
|
content: showListContent(),
|
|
807
890
|
onVisibleChange: clickHideColums,
|
|
808
|
-
overlayClassName:
|
|
891
|
+
overlayClassName: "".concat($prefixCls, "-table-show-colums-popover ").concat($prefixCls, "-scrollbar-small")
|
|
809
892
|
}, {
|
|
810
893
|
children: jsx(ThElement, Object.assign({
|
|
811
894
|
align: "center",
|
|
@@ -813,7 +896,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
813
896
|
onClick: clickShowColums
|
|
814
897
|
}, {
|
|
815
898
|
children: jsx("div", Object.assign({
|
|
816
|
-
className:
|
|
899
|
+
className: "table-header-box"
|
|
817
900
|
}, {
|
|
818
901
|
children: jsx(Panel, {})
|
|
819
902
|
}))
|
|
@@ -824,7 +907,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
824
907
|
var handClass = function handClass() {
|
|
825
908
|
var str = 'table-head';
|
|
826
909
|
if (showColumns === 'inside') str += ' table-head-inside';
|
|
827
|
-
if (!fixedTable) str += ' table-head-scroll'; //
|
|
910
|
+
if (!fixedTable) str += ' table-head-scroll'; // 防止长度过长
|
|
911
|
+
// 没有 复选框,单选框,展开 按钮
|
|
828
912
|
|
|
829
913
|
if (!check && !radio && !expandable) str += ' table-head-no-btn';
|
|
830
914
|
return str;
|
|
@@ -839,7 +923,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
839
923
|
}));
|
|
840
924
|
};
|
|
841
925
|
|
|
842
|
-
var css_248z$4 = ".
|
|
926
|
+
var css_248z$4 = ".table-body-element {\n display: table-row-group;\n}";
|
|
843
927
|
styleInject(css_248z$4);
|
|
844
928
|
|
|
845
929
|
var TableBodyElement = function TableBodyElement(props) {
|
|
@@ -849,7 +933,7 @@ var TableBodyElement = function TableBodyElement(props) {
|
|
|
849
933
|
otherProps = __rest(props, ["className", "style", "children"]);
|
|
850
934
|
|
|
851
935
|
var handClass = function handClass() {
|
|
852
|
-
var str = '
|
|
936
|
+
var str = 'table-body-element';
|
|
853
937
|
if (className) str += ' ' + className;
|
|
854
938
|
return str;
|
|
855
939
|
};
|
|
@@ -862,7 +946,7 @@ var TableBodyElement = function TableBodyElement(props) {
|
|
|
862
946
|
}));
|
|
863
947
|
};
|
|
864
948
|
|
|
865
|
-
var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.
|
|
949
|
+
var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.td-element {\n letter-spacing: 0.01071em;\n padding: 0 8px;\n font-weight: 400;\n font-size: 14px;\n white-space: nowrap;\n border: 0;\n line-height: 1.43;\n}\n.td-element.table-operate {\n /* position: sticky;\n right: 0;*/\n}";
|
|
866
950
|
styleInject(css_248z$3);
|
|
867
951
|
|
|
868
952
|
var TdElement = function TdElement(props) {
|
|
@@ -872,7 +956,7 @@ var TdElement = function TdElement(props) {
|
|
|
872
956
|
otherProps = __rest(props, ["className", "style", "children"]);
|
|
873
957
|
|
|
874
958
|
var handClass = function handClass() {
|
|
875
|
-
var str = '
|
|
959
|
+
var str = 'td-element';
|
|
876
960
|
if (className) str += ' ' + className;
|
|
877
961
|
return str;
|
|
878
962
|
};
|
|
@@ -910,6 +994,7 @@ var TableBody = function TableBody(props) {
|
|
|
910
994
|
operate = props.operate,
|
|
911
995
|
showColumns = props.showColumns,
|
|
912
996
|
fixedTable = props.fixedTable,
|
|
997
|
+
fixedColumn = props.fixedColumn,
|
|
913
998
|
formatter = props.formatter,
|
|
914
999
|
_props$orderFieldArr = props.orderFieldArr,
|
|
915
1000
|
orderFieldArr = _props$orderFieldArr === void 0 ? [] : _props$orderFieldArr,
|
|
@@ -1152,10 +1237,14 @@ var TableBody = function TableBody(props) {
|
|
|
1152
1237
|
}
|
|
1153
1238
|
|
|
1154
1239
|
var handCls = function handCls() {
|
|
1155
|
-
var str = 'table-checkbox table-body-btn
|
|
1240
|
+
var str = 'table-checkbox table-body-btn';
|
|
1156
1241
|
|
|
1157
|
-
if (
|
|
1158
|
-
str += '
|
|
1242
|
+
if (fixedColumn) {
|
|
1243
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,且没有单选,没有嵌套表格
|
|
1244
|
+
|
|
1245
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol) && !radio && !expandable) {
|
|
1246
|
+
str += ' table-fixed-dom-left-last';
|
|
1247
|
+
}
|
|
1159
1248
|
}
|
|
1160
1249
|
|
|
1161
1250
|
return str;
|
|
@@ -1174,7 +1263,7 @@ var TableBody = function TableBody(props) {
|
|
|
1174
1263
|
})
|
|
1175
1264
|
}));
|
|
1176
1265
|
}
|
|
1177
|
-
}, [check, disabledJson, rowKey, checkJson, selectCheck, disabledArrStatus, posFixed, expandable, radio]); // 单选框useCallback
|
|
1266
|
+
}, [check, disabledJson, rowKey, checkJson, selectCheck, disabledArrStatus, posFixed, expandable, radio, fixedColumn]); // 单选框useCallback
|
|
1178
1267
|
|
|
1179
1268
|
var TableRadioCallback = useCallback(function (row) {
|
|
1180
1269
|
if (radio) {
|
|
@@ -1201,10 +1290,14 @@ var TableBody = function TableBody(props) {
|
|
|
1201
1290
|
}
|
|
1202
1291
|
|
|
1203
1292
|
var handCls = function handCls() {
|
|
1204
|
-
var str = 'table-radio table-body-btn
|
|
1293
|
+
var str = 'table-radio table-body-btn';
|
|
1294
|
+
|
|
1295
|
+
if (fixedColumn) {
|
|
1296
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,没有嵌套表格
|
|
1205
1297
|
|
|
1206
|
-
|
|
1207
|
-
|
|
1298
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol) && !expandable) {
|
|
1299
|
+
str += ' table-fixed-dom-left-last';
|
|
1300
|
+
}
|
|
1208
1301
|
}
|
|
1209
1302
|
|
|
1210
1303
|
return str;
|
|
@@ -1223,7 +1316,7 @@ var TableBody = function TableBody(props) {
|
|
|
1223
1316
|
})
|
|
1224
1317
|
}));
|
|
1225
1318
|
}
|
|
1226
|
-
}, [radio, disabledJson, radioValue, rowKey, selectRadio, disabledArrStatus, expandable, posFixed]); // 嵌套加减useCallback
|
|
1319
|
+
}, [radio, disabledJson, radioValue, rowKey, selectRadio, disabledArrStatus, expandable, posFixed, fixedColumn]); // 嵌套加减useCallback
|
|
1227
1320
|
|
|
1228
1321
|
var TableExpandableMemo = useCallback(function (row) {
|
|
1229
1322
|
if (!expandable) return null;
|
|
@@ -1232,10 +1325,14 @@ var TableBody = function TableBody(props) {
|
|
|
1232
1325
|
if (disabledExpandJson[row[rowKey]] || expandableDemo === false) return jsx(TdElement, {});
|
|
1233
1326
|
|
|
1234
1327
|
var handCls = function handCls() {
|
|
1235
|
-
var str = 'table-expandable table-body-btn
|
|
1328
|
+
var str = 'table-expandable table-body-btn';
|
|
1329
|
+
|
|
1330
|
+
if (fixedColumn) {
|
|
1331
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,没有嵌套表格
|
|
1236
1332
|
|
|
1237
|
-
|
|
1238
|
-
|
|
1333
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol)) {
|
|
1334
|
+
str += ' table-fixed-dom-left-last';
|
|
1335
|
+
}
|
|
1239
1336
|
}
|
|
1240
1337
|
|
|
1241
1338
|
return str;
|
|
@@ -1250,7 +1347,7 @@ var TableBody = function TableBody(props) {
|
|
|
1250
1347
|
onClick: handClickNestTable(row)
|
|
1251
1348
|
})
|
|
1252
1349
|
}));
|
|
1253
|
-
}, [expandable, expandableRow, rowKey, disabledExpandJson, onExpand]); // 表格一行内容useCallback
|
|
1350
|
+
}, [expandable, expandableRow, rowKey, disabledExpandJson, onExpand, fixedColumn]); // 表格一行内容useCallback
|
|
1254
1351
|
|
|
1255
1352
|
var TableContentUseCallback = useCallback(function (row) {
|
|
1256
1353
|
var params = {
|
|
@@ -1259,7 +1356,8 @@ var TableBody = function TableBody(props) {
|
|
|
1259
1356
|
};
|
|
1260
1357
|
|
|
1261
1358
|
var handContentClass = function handContentClass(item) {
|
|
1262
|
-
var str = 'table-content-columms';
|
|
1359
|
+
var str = 'table-content-columms';
|
|
1360
|
+
if (item.className) str += ' ' + item.className; // 排序
|
|
1263
1361
|
|
|
1264
1362
|
if (sortTable && item.name && item.sort !== false) {
|
|
1265
1363
|
var index = orderFieldArr.indexOf(item.name);
|
|
@@ -1277,16 +1375,16 @@ var TableBody = function TableBody(props) {
|
|
|
1277
1375
|
}
|
|
1278
1376
|
}
|
|
1279
1377
|
|
|
1280
|
-
if (item.fixed) {
|
|
1281
|
-
str = '
|
|
1378
|
+
if (item.fixed && fixedColumn) {
|
|
1379
|
+
str = 'table-fixed-dom-' + item.fixed; // 固定左边,判断是否是最后一个
|
|
1282
1380
|
|
|
1283
1381
|
if (item.fixed === 'left' && item.paraui_fixed_left_last) {
|
|
1284
|
-
str += '
|
|
1382
|
+
str += ' table-fixed-dom-left-last';
|
|
1285
1383
|
} // 固定右边,判断是否是第一个
|
|
1286
1384
|
|
|
1287
1385
|
|
|
1288
1386
|
if (item.fixed === 'right' && item.paraui_fixed_right_first) {
|
|
1289
|
-
str += '
|
|
1387
|
+
str += ' table-fixed-dom-right-first';
|
|
1290
1388
|
}
|
|
1291
1389
|
}
|
|
1292
1390
|
|
|
@@ -1296,7 +1394,7 @@ var TableBody = function TableBody(props) {
|
|
|
1296
1394
|
var handStyle = function handStyle(item) {
|
|
1297
1395
|
var json = {};
|
|
1298
1396
|
|
|
1299
|
-
if (item.fixed && item.width) {
|
|
1397
|
+
if (fixedColumn && item.fixed && item.width) {
|
|
1300
1398
|
if (item.fixed === 'left') {
|
|
1301
1399
|
json.left = item.paraui_left_width + 'px';
|
|
1302
1400
|
}
|
|
@@ -1312,7 +1410,7 @@ var TableBody = function TableBody(props) {
|
|
|
1312
1410
|
return tableCell ? tableCell(row, params) : headData.map(function (item, index) {
|
|
1313
1411
|
var text = row[item.name];
|
|
1314
1412
|
var colSpan = 1;
|
|
1315
|
-
if (item.render) text = item.render(row);
|
|
1413
|
+
if (item.render) text = item.render(row, item, row[item.name], index);
|
|
1316
1414
|
if (formatter) text = formatter(row, item, row[item.name], index); // 存在显示列,最后一列占两格
|
|
1317
1415
|
|
|
1318
1416
|
if (showColumns === 'inside' && !operate && index === headData.length - 1) {
|
|
@@ -1332,7 +1430,7 @@ var TableBody = function TableBody(props) {
|
|
|
1332
1430
|
}))
|
|
1333
1431
|
}), item.name || index);
|
|
1334
1432
|
});
|
|
1335
|
-
}, [tableCell, headData, align, formatter, orderFieldArr, orderTypeArr, sortTable, showColumns, operate, beyondText]); // 操作栏useCallback
|
|
1433
|
+
}, [tableCell, headData, align, formatter, orderFieldArr, orderTypeArr, sortTable, showColumns, operate, beyondText, fixedColumn]); // 操作栏useCallback
|
|
1336
1434
|
|
|
1337
1435
|
var TableOperateUseCallback = useCallback(function (row) {
|
|
1338
1436
|
if (operate) {
|
|
@@ -1356,10 +1454,14 @@ var TableBody = function TableBody(props) {
|
|
|
1356
1454
|
};
|
|
1357
1455
|
|
|
1358
1456
|
var handCls = function handCls() {
|
|
1359
|
-
var str = 'table-operate
|
|
1457
|
+
var str = 'table-operate';
|
|
1458
|
+
|
|
1459
|
+
if (fixedColumn) {
|
|
1460
|
+
str += ' table-fixed-dom-right';
|
|
1360
1461
|
|
|
1361
|
-
|
|
1362
|
-
|
|
1462
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
1463
|
+
str += ' table-fixed-dom-right-first';
|
|
1464
|
+
}
|
|
1363
1465
|
}
|
|
1364
1466
|
|
|
1365
1467
|
return str;
|
|
@@ -1374,7 +1476,7 @@ var TableBody = function TableBody(props) {
|
|
|
1374
1476
|
children: handOperate()
|
|
1375
1477
|
}));
|
|
1376
1478
|
}
|
|
1377
|
-
}, [operate, align, showColumns, posFixed]); // 嵌套表格useCallback
|
|
1479
|
+
}, [operate, align, showColumns, posFixed, fixedColumn]); // 嵌套表格useCallback
|
|
1378
1480
|
|
|
1379
1481
|
var TableExpandableContentUseCallback = useCallback(function (row) {
|
|
1380
1482
|
var id = row[rowKey];
|
|
@@ -1468,7 +1570,7 @@ var TableHead = function TableHead(props) {
|
|
|
1468
1570
|
};
|
|
1469
1571
|
|
|
1470
1572
|
return jsx("div", Object.assign({
|
|
1471
|
-
className: 'table-pagination
|
|
1573
|
+
className: 'table-pagination'
|
|
1472
1574
|
}, {
|
|
1473
1575
|
children: jsx(Pagination, {
|
|
1474
1576
|
type: paginationType,
|
|
@@ -1483,7 +1585,7 @@ var TableHead = function TableHead(props) {
|
|
|
1483
1585
|
}));
|
|
1484
1586
|
};
|
|
1485
1587
|
|
|
1486
|
-
var css_248z$2 = ".
|
|
1588
|
+
var css_248z$2 = ".table-container {\n overflow-x: auto;\n}";
|
|
1487
1589
|
styleInject(css_248z$2);
|
|
1488
1590
|
|
|
1489
1591
|
var TableContainer = function TableContainer(props) {
|
|
@@ -1494,7 +1596,7 @@ var TableContainer = function TableContainer(props) {
|
|
|
1494
1596
|
otherProps = __rest(props, ["cRef", "className", "style", "children"]);
|
|
1495
1597
|
|
|
1496
1598
|
var handClass = function handClass() {
|
|
1497
|
-
var str = '
|
|
1599
|
+
var str = 'table-container';
|
|
1498
1600
|
if (className) str += ' ' + className;
|
|
1499
1601
|
return str;
|
|
1500
1602
|
};
|
|
@@ -1508,19 +1610,19 @@ var TableContainer = function TableContainer(props) {
|
|
|
1508
1610
|
}));
|
|
1509
1611
|
};
|
|
1510
1612
|
|
|
1511
|
-
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.
|
|
1613
|
+
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\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 rgba(0, 0, 0, 0.1);\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 rgba(0, 0, 0, 0.1);\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 rgba(0, 0, 0, 0.1);\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 rgba(0, 0, 0, 0.1);\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 rgba(0, 0, 0, 0.1);\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 rgba(0, 0, 0, 0.1);\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 rgba(0, 0, 0, 0.1);\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 rgba(0, 0, 0, 0.1);\n}";
|
|
1512
1614
|
styleInject(css_248z$1);
|
|
1513
1615
|
|
|
1514
1616
|
var TableElement = function TableElement(props) {
|
|
1515
1617
|
var className = props.className,
|
|
1516
1618
|
style = props.style,
|
|
1517
|
-
|
|
1619
|
+
fixedColumn = props.fixedColumn,
|
|
1518
1620
|
children = props.children,
|
|
1519
|
-
otherProps = __rest(props, ["className", "style", "
|
|
1621
|
+
otherProps = __rest(props, ["className", "style", "fixedColumn", "children"]);
|
|
1520
1622
|
|
|
1521
1623
|
var handClass = function handClass() {
|
|
1522
|
-
var str = '
|
|
1523
|
-
if (
|
|
1624
|
+
var str = 'table-element';
|
|
1625
|
+
if (fixedColumn) str += ' table-element-fixed-column';
|
|
1524
1626
|
if (className) str += ' ' + className;
|
|
1525
1627
|
return str;
|
|
1526
1628
|
};
|
|
@@ -1533,10 +1635,19 @@ var TableElement = function TableElement(props) {
|
|
|
1533
1635
|
}));
|
|
1534
1636
|
};
|
|
1535
1637
|
|
|
1536
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-table {\n width: 100%;\n height: 100%;\n display: inline-block;\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}\n.paraui-table.paraui-table-no-data > .paraui-table-container > table {\n height: 100%;\n}\n.paraui-table.paraui-table-load.paraui-table-no-data > .paraui-table-container > table {\n height: auto;\n}\n.paraui-table.paraui-table-radio.paraui-table-check .table-radio {\n left: 48px;\n}\n.paraui-table.paraui-table-expandable.paraui-table-check .table-expandable {\n left: 48px;\n}\n.paraui-table.paraui-table-expandable.paraui-table-check.paraui-table-radio .table-expandable {\n left: 80px;\n}\n.paraui-table > .table-contain {\n height: 100%;\n position: relative;\n}\n.paraui-table > .table-contain > table {\n height: auto;\n}\n.paraui-table > .table-contain > table .table-checkbox {\n left: 0;\n}\n.paraui-table > .table-contain > table .table-checkbox > label {\n vertical-align: middle;\n}\n.paraui-table > .table-contain > table .table-checkbox .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-table > .table-contain > table .table-radio {\n left: 0;\n}\n.paraui-table > .table-contain > table .table-radio > label {\n vertical-align: middle;\n}\n.paraui-table > .table-contain > table .table-radio .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-table > .table-contain > table .table-expandable {\n left: 0;\n}\n.paraui-table > .table-contain > table .table-expandable > svg {\n vertical-align: middle;\n}\n.paraui-table > .table-contain > table > .table-head {\n width: 100%;\n white-space: nowrap;\n}\n.paraui-table > .table-contain > table > .table-head > tr th {\n height: 50px;\n}\n.paraui-table > .table-contain > table > .table-head.table-head-scroll tr th {\n max-width: 240px;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box {\n height: 49px;\n line-height: 49px;\n position: relative;\n padding: 0 8px;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-title {\n height: 100%;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-title > span {\n height: 100%;\n display: inline-block;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-header-title-label {\n width: 100%;\n color: rgba(46, 55, 67, 0.7);\n font-weight: 700;\n font-size: 14px;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-sort-svg {\n line-height: 0;\n width: 12px;\n margin-left: 5px;\n white-space: pre-wrap;\n vertical-align: top;\n height: inherit;\n padding-top: 15px;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-sort-svg > svg {\n font-size: 12px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-sort-svg > .up-svg {\n position: relative;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-sort-svg > .down-svg {\n position: relative;\n top: -5px;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-filter {\n position: absolute;\n right: 0;\n top: 0;\n cursor: pointer;\n width: 28px;\n text-align: left;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-show {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-show > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-filter:hover {\n background-color: rgb(227, 234, 247);\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-filter:hover > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > svg {\n font-size: 14px;\n color: rgba(46, 55, 67, 0.7);\n margin-left: 7px;\n position: relative;\n top: 2px;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort {\n cursor: pointer;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort > .table-header-title > .table-header-title-label {\n max-width: calc(100% - 18px);\n width: auto;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box.table-header-box-filter > .table-header-title {\n margin-right: 18px;\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-asc > .table-header-title > .table-sort-svg > .up-svg {\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-desc > .table-header-title > .table-sort-svg > .down-svg {\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-head .show-colums {\n width: 56px;\n cursor: pointer;\n border-left: 1px solid rgba(171, 176, 185, 0.12);\n right: 0;\n}\n.paraui-table > .table-contain > table > .table-head .show-colums .table-header-box {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.paraui-table > .table-contain > table > .table-head .show-colums .table-header-box > svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-table > .table-contain > table > .table-head .show-colums .table-header-box:hover > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-head.table-head-no-btn tr th:first-child .table-header-box {\n padding-left: 16px;\n}\n.paraui-table > .table-contain > table > .table-head .table-head-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-table > .table-contain > table > .table-head .table-head-btn:first-child {\n width: 48px;\n}\n.paraui-table > .table-contain > table > .table-body {\n width: 100%;\n}\n.paraui-table > .table-contain > table > .table-body.table-body-scroll tr td {\n max-width: 240px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-table > .table-contain > table > .table-body tr {\n height: 56px;\n}\n.paraui-table > .table-contain > table > .table-body tr td {\n background-color: white;\n}\n.paraui-table > .table-contain > table > .table-body tr:nth-of-type(2n) td {\n background-color: rgb(249, 250, 251);\n}\n.paraui-table > .table-contain > table > .table-body tr:hover td {\n background-color: rgb(237, 241, 249);\n}\n.paraui-table > .table-contain > table > .table-body tr .table-expandable > svg {\n transition: all 0.3s;\n cursor: pointer;\n font-size: 16px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-table > .table-contain > table > .table-body tr .table-expandable > svg:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-body tr .table-expandable > .expand {\n transform: rotate(180deg);\n color: rgb(54, 102, 214);\n}\n.paraui-table > .table-contain > table > .table-body .more-table-row {\n cursor: pointer;\n}\n.paraui-table > .table-contain > table > .table-body .more-table-row .more-btn {\n color: rgb(54, 102, 214);\n font-size: 14px;\n}\n.paraui-table > .table-contain > table > .table-body.table-body-no-btn tr td:first-child {\n padding-left: 16px;\n}\n.paraui-table > .table-contain > table > .table-body.table-body-no-btn > .table-no-data > td:first-child {\n padding: 0;\n}\n.paraui-table > .table-contain > table > .table-body .table-body-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-table > .table-contain > table > .table-body .table-body-btn:first-child {\n width: 48px;\n}\n.paraui-table > .table-contain > table > .table-body > .table-no-data {\n height: calc(100% - 50px);\n}\n.paraui-table > .table-contain > table > .table-body > .table-no-data:hover td {\n background-color: white;\n}\n.paraui-table > .table-contain > table > .table-body > .table-no-data > td {\n padding: 56px 0 0 0;\n}\n.paraui-table > .paraui-table-pagination {\n width: 100%;\n height: 60px;\n padding-right: 10px;\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n}\n.paraui-table.table-pagination > .table-contain {\n height: calc(100% - 60px);\n}\n.paraui-table.table-pagination.table-load-more > .table-contain {\n height: 100%;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content {\n width: 200px;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box {\n padding-top: 8px;\n max-height: 224px;\n overflow-y: auto;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item {\n height: 36px;\n line-height: 36px;\n cursor: pointer;\n display: flex;\n padding: 0 4px;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > label {\n width: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > span {\n color: rgb(46, 55, 67);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 32px);\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover > span {\n color: rgb(54, 102, 214);\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover > label .paraui-checkbox-box-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-select > span {\n color: rgb(54, 102, 214);\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-select > label .paraui-checkbox-box-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-footer {\n height: 45px;\n border-top: 1px solid rgba(171, 176, 185, 0.2);\n text-align: center;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-footer > button {\n width: 100%;\n height: 100%;\n border: 0;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-footer > button > span {\n font-size: 14px;\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-footer > button > span > span {\n margin-right: 5px;\n color: rgb(46, 55, 67);\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-footer > button > span > span svg {\n font-size: 14px;\n color: rgb(46, 55, 67);\n}\n.paraui-table-show-colums-popover > .paraui-popover-content .show-colums-select > .show-colums-select-footer > button:hover > span > span svg {\n color: rgb(54, 102, 214);\n}\n\n.paraui-filter-popover > .paraui-popover-content {\n width: 200px;\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box {\n padding-top: 8px;\n max-height: 224px;\n overflow-y: auto;\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box > .filter-select-item {\n height: 36px;\n line-height: 36px;\n cursor: pointer;\n display: flex;\n padding: 0 4px;\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box > .filter-select-item > label {\n width: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box > .filter-select-item > span {\n color: rgb(46, 55, 67);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 32px);\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box > .filter-select-item:hover > span {\n color: rgb(54, 102, 214);\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box > .filter-select-item:hover > label .rc-checkbox-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box > .filter-select-item.filter-select-item-select > span {\n color: rgb(54, 102, 214);\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-box > .filter-select-item.filter-select-item-select > label .rc-checkbox-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-footer {\n height: 45px;\n border-top: 1px solid rgba(171, 176, 185, 0.2);\n text-align: center;\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-footer > button {\n width: 50%;\n height: 100%;\n border: 0;\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-footer > button > span {\n font-size: 14px;\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-footer > button > span > span {\n margin-right: 5px;\n color: rgb(46, 55, 67);\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-footer > button > span > span svg {\n font-size: 14px;\n color: rgb(46, 55, 67);\n}\n.paraui-filter-popover > .paraui-popover-content .filter-select > .filter-select-footer > button:hover > span > span svg {\n color: rgb(54, 102, 214);\n}";
|
|
1638
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-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}\n.paraui-v3-table.paraui-v3-table-fixed-table > .table-contain > table {\n table-layout: fixed;\n}\n.paraui-v3-table.paraui-v3-table-fixed-cloumn > .table-contain > table .table-checkbox {\n left: 0;\n}\n.paraui-v3-table.paraui-v3-table-fixed-cloumn > .table-contain > table .table-radio {\n left: 0;\n}\n.paraui-v3-table.paraui-v3-table-fixed-cloumn > .table-contain > table .table-expandable {\n left: 0;\n}\n.paraui-v3-table.paraui-v3-table-fixed-cloumn.paraui-v3-table-radio.paraui-v3-table-check .table-radio {\n left: 48px;\n}\n.paraui-v3-table.paraui-v3-table-fixed-cloumn.paraui-v3-table-expandable.paraui-v3-table-check .table-expandable {\n left: 48px;\n}\n.paraui-v3-table.paraui-v3-table-fixed-cloumn.paraui-v3-table-expandable.paraui-v3-table-check.paraui-v3-table-radio .table-expandable {\n left: 80px;\n}\n.paraui-v3-table.paraui-v3-table-no-data > .table-container > table {\n height: 100%;\n}\n.paraui-v3-table.paraui-v3-table-load.paraui-v3-table-no-data > .table-container > table {\n height: auto;\n}\n.paraui-v3-table.paraui-v3-table-pagination > .table-contain {\n height: calc(100% - 60px);\n}\n.paraui-v3-table.paraui-v3-table-pagination.table-load-more > .table-contain {\n height: 100%;\n}\n.paraui-v3-table.paraui-v3-table-load-more.paraui-v3-table-pagination > .table-contain {\n height: 100%;\n}\n.paraui-v3-table > .table-contain {\n height: 100%;\n position: relative;\n}\n.paraui-v3-table > .table-contain > table {\n height: auto;\n}\n.paraui-v3-table > .table-contain > table .table-checkbox > label {\n vertical-align: middle;\n}\n.paraui-v3-table > .table-contain > table .table-checkbox .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v3-table > .table-contain > table .table-radio > label {\n vertical-align: middle;\n}\n.paraui-v3-table > .table-contain > table .table-radio .table-header-box {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v3-table > .table-contain > table .table-expandable > svg {\n vertical-align: middle;\n}\n.paraui-v3-table > .table-contain > table > .table-head {\n width: 100%;\n white-space: nowrap;\n}\n.paraui-v3-table > .table-contain > table > .table-head > tr th {\n height: 50px;\n}\n.paraui-v3-table > .table-contain > table > .table-head.table-head-scroll tr th {\n max-width: 240px;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box {\n height: 49px;\n line-height: 49px;\n position: relative;\n padding: 0 8px;\n display: flex;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-header-title {\n max-width: 100%;\n padding-right: 8px;\n display: flex;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-header-title > .table-header-title-label {\n width: 100%;\n color: rgba(46, 55, 67, 0.7);\n font-weight: 700;\n font-size: 14px;\n}\n.paraui-v3-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-v3-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-v3-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover {\n background-color: rgb(227, 234, 247);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span:hover > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > svg {\n font-size: 12px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .up-svg {\n position: relative;\n top: 2px;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-sort-svg > span > .down-svg {\n position: relative;\n top: -3px;\n}\n.paraui-v3-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-v3-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-v3-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover {\n background-color: rgb(227, 234, 247);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span:hover > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-header-filter > span > svg {\n font-size: 14px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-show > span > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box > .table-header-filter.table-header-filter-select > span > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-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(235, 96, 84);\n content: \"\";\n right: 3px;\n top: 2px;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort > .table-header-title {\n max-width: calc(100% - 20px);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box.table-header-box-filter > .table-header-title {\n max-width: calc(100% - 20px);\n}\n.paraui-v3-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-v3-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-asc > .table-sort-svg > span > .up-svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-header-box.table-header-box-sort-desc > .table-sort-svg > span > .down-svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-head .show-colums {\n width: 56px;\n cursor: pointer;\n border-left: 1px solid rgba(171, 176, 185, 0.12);\n right: 0;\n}\n.paraui-v3-table > .table-contain > table > .table-head .show-colums .table-header-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 55px;\n}\n.paraui-v3-table > .table-contain > table > .table-head .show-colums .table-header-box > svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-table > .table-contain > table > .table-head .show-colums .table-header-box:hover > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-head.table-head-no-btn tr th:first-child .table-header-box {\n padding-left: 16px;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-head-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-head-btn > .table-header-box {\n width: 32px;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-head-btn:first-child {\n width: 48px;\n}\n.paraui-v3-table > .table-contain > table > .table-head .table-head-btn:first-child > .table-header-box {\n width: 48px;\n}\n.paraui-v3-table > .table-contain > table > .table-body {\n width: 100%;\n}\n.paraui-v3-table > .table-contain > table > .table-body.table-body-scroll tr td {\n max-width: 240px;\n}\n.paraui-v3-table > .table-contain > table > .table-body tr {\n height: 56px;\n}\n.paraui-v3-table > .table-contain > table > .table-body tr td {\n background-color: white;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-table > .table-contain > table > .table-body tr:nth-of-type(2n) td {\n background-color: rgb(249, 250, 251);\n}\n.paraui-v3-table > .table-contain > table > .table-body tr:hover td {\n background-color: rgb(237, 241, 249);\n}\n.paraui-v3-table > .table-contain > table > .table-body tr .table-expandable > svg {\n transition: all 0.3s;\n cursor: pointer;\n font-size: 16px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-table > .table-contain > table > .table-body tr .table-expandable > svg:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-body tr .table-expandable > .expand {\n transform: rotate(180deg);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table > .table-contain > table > .table-body .more-table-row {\n cursor: pointer;\n}\n.paraui-v3-table > .table-contain > table > .table-body .more-table-row .more-btn {\n color: rgb(54, 102, 214);\n font-size: 14px;\n}\n.paraui-v3-table > .table-contain > table > .table-body .more-table-row > .td-element {\n bottom: 0;\n background: white;\n box-shadow: 4px -4px 8px 0px rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-table > .table-contain > table > .table-body.table-body-no-btn tr td:first-child {\n padding-left: 16px;\n}\n.paraui-v3-table > .table-contain > table > .table-body.table-body-no-btn > .table-no-data > td:first-child {\n padding: 0;\n}\n.paraui-v3-table > .table-contain > table > .table-body .table-body-btn {\n width: 32px;\n padding: 0;\n}\n.paraui-v3-table > .table-contain > table > .table-body .table-body-btn:first-child {\n width: 48px;\n}\n.paraui-v3-table > .table-contain > table > .table-body > .table-no-data {\n height: calc(100% - 50px);\n}\n.paraui-v3-table > .table-contain > table > .table-body > .table-no-data:hover td {\n background-color: white;\n}\n.paraui-v3-table > .table-contain > table > .table-body > .table-no-data > td {\n padding: 56px 0 0 0;\n}\n.paraui-v3-table > .table-pagination {\n width: 100%;\n height: 60px;\n padding-right: 10px;\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n}\n\n.paraui-v3-table-show-colums-popover > .component-popover-content {\n width: 200px;\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box {\n padding-top: 8px;\n max-height: 224px;\n overflow-y: auto;\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item {\n height: 36px;\n line-height: 36px;\n cursor: pointer;\n display: flex;\n padding: 0 4px;\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > label {\n width: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item > span {\n color: rgb(46, 55, 67);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 32px);\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover > span {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item:hover > label .checkbox-box-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-select > span {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-box > .show-colums-select-item.show-colums-select-item-select > label .checkbox-box-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer {\n height: 45px;\n border-top: 1px solid rgba(171, 176, 185, 0.2);\n text-align: center;\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button {\n width: 100%;\n height: 100%;\n border: 0;\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button > span {\n font-size: 14px;\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button > span > span {\n margin-right: 5px;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button > span > span svg {\n font-size: 14px;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-table-show-colums-popover > .component-popover-content .show-colums-select > .show-colums-select-footer > button:hover > span > span svg {\n color: rgb(54, 102, 214);\n}\n\n.paraui-v3-filter-popover > .component-popover-content {\n width: 200px;\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box {\n padding-top: 8px;\n max-height: 224px;\n overflow-y: auto;\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item {\n height: 36px;\n line-height: 36px;\n cursor: pointer;\n display: flex;\n padding: 0 4px;\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > label {\n width: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item > span {\n color: rgb(46, 55, 67);\n font-size: 14px;\n display: inline-block;\n width: calc(100% - 32px);\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item:hover > span {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item:hover > label .checkbox-box-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item.filter-select-item-select > span {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-box > .filter-select-item.filter-select-item-select > label .checkbox-box-inner {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-footer {\n height: 45px;\n border-top: 1px solid rgba(171, 176, 185, 0.2);\n text-align: center;\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button {\n width: 50%;\n height: 100%;\n border: 0;\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button > span {\n font-size: 14px;\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button > span > span {\n margin-right: 5px;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button > span > span svg {\n font-size: 14px;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-filter-popover > .component-popover-content .filter-select > .filter-select-footer > button:hover > span > span svg {\n color: rgb(54, 102, 214);\n}";
|
|
1537
1639
|
styleInject(css_248z);
|
|
1538
1640
|
|
|
1539
|
-
var Table = function Table(
|
|
1641
|
+
var Table = function Table(propsInit) {
|
|
1642
|
+
var props = useGlobalProps(propsInit, 'Table'); // 判断浏览器
|
|
1643
|
+
|
|
1644
|
+
var Browser = GetBrowserClass();
|
|
1645
|
+
|
|
1646
|
+
if (Browser === 'ie') {
|
|
1647
|
+
// IE浏览器没有固定列
|
|
1648
|
+
props.fixedColumn = false;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1540
1651
|
var url = props.url,
|
|
1541
1652
|
ctx = props.ctx,
|
|
1542
1653
|
emptyProps = props.emptyProps,
|
|
@@ -1589,6 +1700,8 @@ var Table = function Table(props) {
|
|
|
1589
1700
|
showColumns = _props$showColumns === void 0 ? 'inside' : _props$showColumns,
|
|
1590
1701
|
_props$fixedTable = props.fixedTable,
|
|
1591
1702
|
fixedTable = _props$fixedTable === void 0 ? true : _props$fixedTable,
|
|
1703
|
+
_props$fixedColumn = props.fixedColumn,
|
|
1704
|
+
fixedColumn = _props$fixedColumn === void 0 ? true : _props$fixedColumn,
|
|
1592
1705
|
formatter = props.formatter,
|
|
1593
1706
|
_props$lineHeight = props.lineHeight,
|
|
1594
1707
|
lineHeight = _props$lineHeight === void 0 ? 56 : _props$lineHeight,
|
|
@@ -1612,8 +1725,9 @@ var Table = function Table(props) {
|
|
|
1612
1725
|
_props$beyondText = props.beyondText,
|
|
1613
1726
|
beyondText = _props$beyondText === void 0 ? true : _props$beyondText,
|
|
1614
1727
|
loading = props.loading;
|
|
1728
|
+
var dayNum = props.expirationTime ? props.expirationTime : 7; // 过期天数
|
|
1615
1729
|
|
|
1616
|
-
var _useState = useState(
|
|
1730
|
+
var _useState = useState(props.page !== undefined ? props.page : 1),
|
|
1617
1731
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1618
1732
|
pageCom = _useState2[0],
|
|
1619
1733
|
setPageCom = _useState2[1]; // 页数
|
|
@@ -1621,160 +1735,159 @@ var Table = function Table(props) {
|
|
|
1621
1735
|
|
|
1622
1736
|
var _useState3 = useState(null),
|
|
1623
1737
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1624
|
-
|
|
1625
|
-
|
|
1738
|
+
sizeCom = _useState4[0],
|
|
1739
|
+
setSizeCom = _useState4[1]; // 每页条数
|
|
1626
1740
|
|
|
1627
1741
|
|
|
1628
|
-
var _useState5 = useState(
|
|
1742
|
+
var _useState5 = useState(sizeArr),
|
|
1629
1743
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1630
|
-
|
|
1631
|
-
|
|
1744
|
+
sizeArrCom = _useState6[0],
|
|
1745
|
+
setSizeArrCom = _useState6[1]; // 每页条数数组
|
|
1632
1746
|
|
|
1633
1747
|
|
|
1634
|
-
var _useState7 = useState(
|
|
1748
|
+
var _useState7 = useState(0),
|
|
1635
1749
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1636
|
-
|
|
1637
|
-
|
|
1750
|
+
total = _useState8[0],
|
|
1751
|
+
setTotal = _useState8[1]; // 总数
|
|
1638
1752
|
|
|
1639
1753
|
|
|
1640
|
-
var _useState9 = useState(
|
|
1754
|
+
var _useState9 = useState([]),
|
|
1641
1755
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
1642
|
-
|
|
1643
|
-
|
|
1756
|
+
rowData = _useState10[0],
|
|
1757
|
+
setRowData = _useState10[1]; // 当前页数据
|
|
1644
1758
|
|
|
1645
1759
|
|
|
1646
|
-
var _useState11 = useState(
|
|
1760
|
+
var _useState11 = useState({}),
|
|
1647
1761
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
1648
|
-
|
|
1649
|
-
|
|
1762
|
+
rowDataJson = _useState12[0],
|
|
1763
|
+
setRowDataJson = _useState12[1]; // 当前页数据对象
|
|
1650
1764
|
|
|
1651
1765
|
|
|
1652
1766
|
var _useState13 = useState({}),
|
|
1653
1767
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
1654
|
-
|
|
1655
|
-
|
|
1768
|
+
totalDataJson = _useState14[0],
|
|
1769
|
+
setTotalDataJson = _useState14[1]; // 数据总数对象--用来分页记录数据的
|
|
1656
1770
|
|
|
1657
1771
|
|
|
1658
|
-
var _useState15 = useState(
|
|
1772
|
+
var _useState15 = useState([]),
|
|
1659
1773
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
1660
|
-
|
|
1661
|
-
|
|
1774
|
+
orderTypeArr = _useState16[0],
|
|
1775
|
+
setOrderTypeArr = _useState16[1]; // 排序类型
|
|
1662
1776
|
|
|
1663
1777
|
|
|
1664
1778
|
var _useState17 = useState([]),
|
|
1665
1779
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
1666
|
-
|
|
1667
|
-
|
|
1780
|
+
orderFieldArr = _useState18[0],
|
|
1781
|
+
setOrderFieldArr = _useState18[1]; // 排序字段
|
|
1668
1782
|
|
|
1669
1783
|
|
|
1670
|
-
var _useState19 = useState(
|
|
1784
|
+
var _useState19 = useState('not'),
|
|
1671
1785
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
1672
|
-
|
|
1673
|
-
|
|
1786
|
+
headSelectStatus = _useState20[0],
|
|
1787
|
+
setHeadSelectStatus = _useState20[1]; // 表格头复选框状态
|
|
1674
1788
|
|
|
1675
1789
|
|
|
1676
|
-
var _useState21 = useState(
|
|
1790
|
+
var _useState21 = useState({}),
|
|
1677
1791
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
1678
|
-
|
|
1679
|
-
|
|
1792
|
+
checkJson = _useState22[0],
|
|
1793
|
+
setCheckJson = _useState22[1]; // 多选 选中的数据
|
|
1680
1794
|
|
|
1681
1795
|
|
|
1682
|
-
var _useState23 = useState(
|
|
1796
|
+
var _useState23 = useState(),
|
|
1683
1797
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
1684
|
-
|
|
1685
|
-
|
|
1798
|
+
radioValue = _useState24[0],
|
|
1799
|
+
setRadioValue = _useState24[1]; // 单选 选中的数据
|
|
1686
1800
|
|
|
1687
1801
|
|
|
1688
|
-
var _useState25 = useState(),
|
|
1802
|
+
var _useState25 = useState({}),
|
|
1689
1803
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
1690
|
-
|
|
1691
|
-
|
|
1804
|
+
disabledJson = _useState26[0],
|
|
1805
|
+
setDisabledJson = _useState26[1]; // 禁用对象
|
|
1692
1806
|
|
|
1693
1807
|
|
|
1694
1808
|
var _useState27 = useState({}),
|
|
1695
1809
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
1696
|
-
|
|
1697
|
-
|
|
1810
|
+
originalHead = _useState28[0],
|
|
1811
|
+
setOriginalHead = _useState28[1]; // 接口原数据表头json
|
|
1698
1812
|
|
|
1699
1813
|
|
|
1700
|
-
var _useState29 = useState(
|
|
1814
|
+
var _useState29 = useState([]),
|
|
1701
1815
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
1702
|
-
|
|
1703
|
-
|
|
1816
|
+
showHeadList = _useState30[0],
|
|
1817
|
+
setShowHeadList = _useState30[1]; // 显示列下拉值 所有头部的配置
|
|
1704
1818
|
|
|
1705
1819
|
|
|
1706
1820
|
var _useState31 = useState([]),
|
|
1707
1821
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
1708
|
-
|
|
1709
|
-
|
|
1822
|
+
headDataCom = _useState32[0],
|
|
1823
|
+
setHeadDataCom = _useState32[1]; // 表格当前显示列 集合本地数据
|
|
1710
1824
|
|
|
1711
1825
|
|
|
1712
|
-
var _useState33 = useState(
|
|
1826
|
+
var _useState33 = useState({}),
|
|
1713
1827
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
1714
|
-
|
|
1715
|
-
|
|
1828
|
+
selectFilterCom = _useState34[0],
|
|
1829
|
+
setSelectFilterCom = _useState34[1]; // 过滤值
|
|
1716
1830
|
|
|
1717
1831
|
|
|
1718
|
-
var _useState35 = useState(
|
|
1832
|
+
var _useState35 = useState(true),
|
|
1719
1833
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
1720
|
-
|
|
1721
|
-
|
|
1834
|
+
loadState = _useState36[0],
|
|
1835
|
+
setLoadState = _useState36[1]; // 加载进度条状态
|
|
1722
1836
|
|
|
1723
1837
|
|
|
1724
|
-
var _useState37 = useState(
|
|
1838
|
+
var _useState37 = useState(false),
|
|
1725
1839
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1840
|
+
loadMoreUrl = _useState38[0],
|
|
1841
|
+
setLoadMoreUrl = _useState38[1];
|
|
1729
1842
|
|
|
1730
|
-
var _useState39 = useState(
|
|
1731
|
-
_useState40 = _slicedToArray(_useState39,
|
|
1732
|
-
|
|
1733
|
-
setLoadMoreUrl = _useState40[1];
|
|
1843
|
+
var _useState39 = useState(Math.random().toString()),
|
|
1844
|
+
_useState40 = _slicedToArray(_useState39, 1),
|
|
1845
|
+
reqId = _useState40[0];
|
|
1734
1846
|
|
|
1735
|
-
var _useState41 = useState(
|
|
1736
|
-
_useState42 = _slicedToArray(_useState41,
|
|
1737
|
-
|
|
1847
|
+
var _useState41 = useState(),
|
|
1848
|
+
_useState42 = _slicedToArray(_useState41, 2),
|
|
1849
|
+
refreshCom = _useState42[0],
|
|
1850
|
+
setRefreshCom = _useState42[1];
|
|
1738
1851
|
|
|
1739
|
-
var _useState43 = useState(),
|
|
1852
|
+
var _useState43 = useState(0),
|
|
1740
1853
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
var _useState45 = useState(0),
|
|
1745
|
-
_useState46 = _slicedToArray(_useState45, 2),
|
|
1746
|
-
tableMinWidth = _useState46[0],
|
|
1747
|
-
setTableMinWidth = _useState46[1]; // 表格最小width
|
|
1854
|
+
tableMinWidth = _useState44[0],
|
|
1855
|
+
setTableMinWidth = _useState44[1]; // 表格最小width
|
|
1748
1856
|
|
|
1749
1857
|
|
|
1750
|
-
var
|
|
1751
|
-
|
|
1752
|
-
posFixed =
|
|
1753
|
-
setPosFixed =
|
|
1858
|
+
var _useState45 = useState({}),
|
|
1859
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
1860
|
+
posFixed = _useState46[0],
|
|
1861
|
+
setPosFixed = _useState46[1];
|
|
1754
1862
|
|
|
1755
1863
|
var containerRef = useRef(); // 表格内容高度
|
|
1756
1864
|
|
|
1757
1865
|
var tableRef = useRef(); // 表格
|
|
1758
1866
|
|
|
1759
|
-
var
|
|
1760
|
-
|
|
1761
|
-
|
|
1867
|
+
var constData = useRef({
|
|
1868
|
+
page: props.page !== undefined ? props.page : 1
|
|
1869
|
+
}); // 存储常量
|
|
1762
1870
|
|
|
1871
|
+
constData.current.loadMoreUrl = loadMore && url; // 用来判断加载更多请求是否放在表格里面
|
|
1763
1872
|
|
|
1764
|
-
constData.
|
|
1765
|
-
|
|
1873
|
+
constData.current.search = search;
|
|
1874
|
+
constData.current.url = url;
|
|
1875
|
+
constData.current.orderTypeArr = orderTypeArr;
|
|
1876
|
+
constData.current.orderFieldArr = orderFieldArr;
|
|
1877
|
+
constData.current.selectFilterCom = selectFilterCom;
|
|
1878
|
+
constData.current.data = data;
|
|
1766
1879
|
useEffect(function () {
|
|
1767
1880
|
window.addEventListener('resize', changeResize);
|
|
1768
1881
|
return function () {
|
|
1769
|
-
clearTimeout(constData.reqTimer);
|
|
1770
|
-
clearTimeout(constData.loadingTimer);
|
|
1882
|
+
clearTimeout(constData.current.reqTimer);
|
|
1883
|
+
clearTimeout(constData.current.loadingTimer);
|
|
1771
1884
|
window.removeEventListener('resize', changeResize);
|
|
1772
1885
|
};
|
|
1773
1886
|
}, []);
|
|
1774
1887
|
useEffect(function () {
|
|
1775
1888
|
if (loading !== undefined) {
|
|
1776
|
-
clearTimeout(constData.loadingTimer);
|
|
1777
|
-
constData.loadingTimer = setTimeout(function () {
|
|
1889
|
+
clearTimeout(constData.current.loadingTimer);
|
|
1890
|
+
constData.current.loadingTimer = setTimeout(function () {
|
|
1778
1891
|
setLoadState(loading);
|
|
1779
1892
|
}, 50);
|
|
1780
1893
|
}
|
|
@@ -1784,18 +1897,16 @@ var Table = function Table(props) {
|
|
|
1784
1897
|
}, [loadMore, url]); // 监听page
|
|
1785
1898
|
|
|
1786
1899
|
useEffect(function () {
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
setPagePagination(pageCom);
|
|
1792
|
-
}, [pageCom]); // 自动计算表格一页展示条数
|
|
1900
|
+
if (props.page !== undefined) {
|
|
1901
|
+
handPage(props.page);
|
|
1902
|
+
}
|
|
1903
|
+
}, [page]); // 自动计算表格一页展示条数
|
|
1793
1904
|
|
|
1794
1905
|
useEffect(function () {
|
|
1795
|
-
if (!autoSize) return
|
|
1906
|
+
if (!autoSize) return handSize(size);
|
|
1796
1907
|
|
|
1797
1908
|
if (props.size) {
|
|
1798
|
-
|
|
1909
|
+
handSize(size);
|
|
1799
1910
|
} else {
|
|
1800
1911
|
if (containerRef && containerRef.current) {
|
|
1801
1912
|
var height = containerRef.current.clientHeight - 50;
|
|
@@ -1812,37 +1923,14 @@ var Table = function Table(props) {
|
|
|
1812
1923
|
setSizeArrCom(sizeArr);
|
|
1813
1924
|
}
|
|
1814
1925
|
|
|
1815
|
-
|
|
1926
|
+
handSize(columnsNUmber);
|
|
1816
1927
|
}
|
|
1817
1928
|
}
|
|
1818
1929
|
}, [size, autoSize]); // 处理表格头部
|
|
1819
1930
|
|
|
1820
1931
|
useEffect(function () {
|
|
1821
1932
|
if (props.headData !== undefined) {
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
var headArr = []; // 显示列列表
|
|
1825
|
-
|
|
1826
|
-
var json = {};
|
|
1827
|
-
|
|
1828
|
-
for (var i = 0, l = headData.length; i < l; i++) {
|
|
1829
|
-
var item = headData[i];
|
|
1830
|
-
if (typeof item.width === 'number') item.width += 'px';
|
|
1831
|
-
item.orderNum = i;
|
|
1832
|
-
if (showColumns === false) item.selected = true; // 如果不显示选择列,全部显示
|
|
1833
|
-
|
|
1834
|
-
if (item.selected) {
|
|
1835
|
-
headShowArr.push(item);
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
headArr.push(item);
|
|
1839
|
-
json[item.name] = item;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
handHeadDataCom(headShowArr);
|
|
1843
|
-
setHeadDataCom(headShowArr);
|
|
1844
|
-
setShowHeadList(headArr);
|
|
1845
|
-
constData.headDataJson = json;
|
|
1933
|
+
handInitHead(headData, false);
|
|
1846
1934
|
}
|
|
1847
1935
|
}, [headData]); // 设置总数对象
|
|
1848
1936
|
|
|
@@ -1850,29 +1938,31 @@ var Table = function Table(props) {
|
|
|
1850
1938
|
if (data) {
|
|
1851
1939
|
var handTotalDataJson = ArrayToObject(rowKey, data);
|
|
1852
1940
|
setTotalDataJson(handTotalDataJson);
|
|
1941
|
+
constData.current.data = data;
|
|
1942
|
+
setRefreshCom(Math.random());
|
|
1853
1943
|
}
|
|
1854
1944
|
}, [data]);
|
|
1855
1945
|
useEffect(function () {
|
|
1856
1946
|
// 第一次初始化不设置
|
|
1857
|
-
if (!constData.initReq) return;
|
|
1858
|
-
|
|
1859
|
-
constData.historyData = [];
|
|
1947
|
+
if (!constData.current.initReq) return;
|
|
1948
|
+
handPage(1);
|
|
1949
|
+
constData.current.historyData = [];
|
|
1860
1950
|
}, [search, url]); // 表格数据获取赋值
|
|
1861
1951
|
|
|
1862
1952
|
useEffect(function () {
|
|
1863
|
-
clearTimeout(constData.reqTimer);
|
|
1864
|
-
if (url) Cancel(reqId);
|
|
1865
|
-
constData.reqTimer = setTimeout(function () {
|
|
1866
|
-
constData.initReq = true;
|
|
1953
|
+
clearTimeout(constData.current.reqTimer);
|
|
1954
|
+
if (constData.current.url) Cancel(reqId);
|
|
1955
|
+
constData.current.reqTimer = setTimeout(function () {
|
|
1956
|
+
constData.current.initReq = true;
|
|
1867
1957
|
|
|
1868
|
-
if (url) {
|
|
1958
|
+
if (constData.current.url) {
|
|
1869
1959
|
// 提交参数
|
|
1870
1960
|
var postBody = {};
|
|
1871
1961
|
|
|
1872
1962
|
if (pagination) {
|
|
1873
|
-
if (
|
|
1874
|
-
postBody.size =
|
|
1875
|
-
postBody.page =
|
|
1963
|
+
if (constData.current.page === null || constData.current.size === null) return;
|
|
1964
|
+
postBody.size = constData.current.size;
|
|
1965
|
+
postBody.page = constData.current.page;
|
|
1876
1966
|
}
|
|
1877
1967
|
|
|
1878
1968
|
if (orderFieldArr.length > 0) {
|
|
@@ -1889,14 +1979,14 @@ var Table = function Table(props) {
|
|
|
1889
1979
|
postBody.filter = handFilterReq();
|
|
1890
1980
|
}
|
|
1891
1981
|
|
|
1892
|
-
if (search) {
|
|
1893
|
-
if (_typeof(search) === 'object') {
|
|
1894
|
-
postBody = Object.assign(Object.assign({}, postBody), search);
|
|
1982
|
+
if (constData.current.search) {
|
|
1983
|
+
if (_typeof(constData.current.search) === 'object') {
|
|
1984
|
+
postBody = Object.assign(Object.assign({}, postBody), constData.current.search);
|
|
1895
1985
|
}
|
|
1896
1986
|
}
|
|
1897
1987
|
|
|
1898
1988
|
var obj = {
|
|
1899
|
-
url: url,
|
|
1989
|
+
url: constData.current.url,
|
|
1900
1990
|
ctx: ctx,
|
|
1901
1991
|
method: method,
|
|
1902
1992
|
data: postBody
|
|
@@ -1930,19 +2020,19 @@ var Table = function Table(props) {
|
|
|
1930
2020
|
}
|
|
1931
2021
|
}
|
|
1932
2022
|
|
|
1933
|
-
if (data) {
|
|
2023
|
+
if (constData.current.data) {
|
|
1934
2024
|
var dataT = [];
|
|
1935
2025
|
|
|
1936
|
-
if (data instanceof Array) {
|
|
1937
|
-
dataT = data;
|
|
2026
|
+
if (constData.current.data instanceof Array) {
|
|
2027
|
+
dataT = constData.current.data;
|
|
1938
2028
|
} else {
|
|
1939
|
-
dataT = data.list;
|
|
2029
|
+
dataT = constData.current.data.list;
|
|
1940
2030
|
}
|
|
1941
2031
|
|
|
1942
2032
|
if (pagination) {
|
|
1943
|
-
if (
|
|
2033
|
+
if (constData.current.page === null || constData.current.size === null) return; // 分页
|
|
1944
2034
|
|
|
1945
|
-
var sliceData = dataT.slice((
|
|
2035
|
+
var sliceData = dataT.slice((constData.current.page - 1) * constData.current.size, (constData.current.page - 1) * constData.current.size + constData.current.size);
|
|
1946
2036
|
setNowPageData(sliceData);
|
|
1947
2037
|
setTotal(dataT.length);
|
|
1948
2038
|
} else {
|
|
@@ -1953,7 +2043,7 @@ var Table = function Table(props) {
|
|
|
1953
2043
|
if (props.loading === undefined) setLoadState(false);
|
|
1954
2044
|
}
|
|
1955
2045
|
}, 50);
|
|
1956
|
-
}, [
|
|
2046
|
+
}, [refresh, refreshCom]); // 单选赋值默认值
|
|
1957
2047
|
|
|
1958
2048
|
useEffect(function () {
|
|
1959
2049
|
if (radioDefaultValue !== undefined && radioDefaultValue !== radioValue) {
|
|
@@ -2034,7 +2124,139 @@ var Table = function Table(props) {
|
|
|
2034
2124
|
tableBoxScroll({
|
|
2035
2125
|
target: containerRef.current
|
|
2036
2126
|
});
|
|
2037
|
-
});
|
|
2127
|
+
});
|
|
2128
|
+
/** 设置size */
|
|
2129
|
+
|
|
2130
|
+
var handSize = function handSize(num) {
|
|
2131
|
+
constData.current.size = num;
|
|
2132
|
+
setSizeCom(num);
|
|
2133
|
+
setRefreshCom(Math.random());
|
|
2134
|
+
};
|
|
2135
|
+
/** 本地显示列key */
|
|
2136
|
+
|
|
2137
|
+
|
|
2138
|
+
var getTableHeadKey = function getTableHeadKey() {
|
|
2139
|
+
// 自定义key
|
|
2140
|
+
if (props.tableKey) {
|
|
2141
|
+
return props.tableKey;
|
|
2142
|
+
} // 本地数据
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
if (props.data) {
|
|
2146
|
+
return window.location.origin + window.location.pathname + window.location.hash;
|
|
2147
|
+
} // url
|
|
2148
|
+
|
|
2149
|
+
|
|
2150
|
+
if (props.url) {
|
|
2151
|
+
return props.url + '_' + (props.method || 'Get');
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
return '';
|
|
2155
|
+
};
|
|
2156
|
+
/** 获取储存的表头列 */
|
|
2157
|
+
|
|
2158
|
+
|
|
2159
|
+
var getLocalStorageHeadCom = function getLocalStorageHeadCom() {
|
|
2160
|
+
if (props.rememberColumns === false) return {};
|
|
2161
|
+
var json = getLocalStorageSelectHead(getTableHeadKey(), dayNum);
|
|
2162
|
+
return json;
|
|
2163
|
+
};
|
|
2164
|
+
/** 设置本地表格列 */
|
|
2165
|
+
|
|
2166
|
+
|
|
2167
|
+
var setLocalStorageHeadCom = function setLocalStorageHeadCom(headArr) {
|
|
2168
|
+
if (props.rememberColumns === false) return;
|
|
2169
|
+
var selectHeadJson = ArrayToObject('name', headArr);
|
|
2170
|
+
var json = {
|
|
2171
|
+
headName: {},
|
|
2172
|
+
storageTime: new Date().getTime(),
|
|
2173
|
+
validity: dayNum * (60 * 60 * 24)
|
|
2174
|
+
};
|
|
2175
|
+
|
|
2176
|
+
for (var i = 0, l = showHeadList.length; i < l; i++) {
|
|
2177
|
+
var item = showHeadList[i];
|
|
2178
|
+
var name = item.name || '';
|
|
2179
|
+
json.headName[name] = false;
|
|
2180
|
+
|
|
2181
|
+
if (selectHeadJson[name]) {
|
|
2182
|
+
json.headName[name] = true;
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
setLocalStorageSelectHead(getTableHeadKey(), json);
|
|
2187
|
+
};
|
|
2188
|
+
/**
|
|
2189
|
+
* 处理表格列是否显示
|
|
2190
|
+
* @param item {HeadDataProps} 当前列
|
|
2191
|
+
* @param showHeadArr {HeadDataProps[]} 显示列与本地数据集合
|
|
2192
|
+
* @param localHead {HeadLocalStorageItem} 本地显示列数据
|
|
2193
|
+
* */
|
|
2194
|
+
|
|
2195
|
+
|
|
2196
|
+
var handHeadShow = function handHeadShow(item, showHeadArr, localHead) {
|
|
2197
|
+
if (showColumns === false) {
|
|
2198
|
+
// 如果不显示选择列,全部显示
|
|
2199
|
+
showHeadArr.push(item);
|
|
2200
|
+
return;
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
if (props.rememberColumns === false) {
|
|
2204
|
+
// 不记住列
|
|
2205
|
+
if (item.selected) showHeadArr.push(item);
|
|
2206
|
+
} else {
|
|
2207
|
+
// 记住列
|
|
2208
|
+
var nameSelectJson = localHead.headName || {};
|
|
2209
|
+
var name = item.name || '';
|
|
2210
|
+
var nameSelect = nameSelectJson[name];
|
|
2211
|
+
|
|
2212
|
+
if (nameSelect !== undefined) {
|
|
2213
|
+
// 存在本地选择列里面,选中添加到显示列
|
|
2214
|
+
if (nameSelect) showHeadArr.push(item);
|
|
2215
|
+
} else {
|
|
2216
|
+
// 不存在本地选择列里面,当前选中,则添加进去
|
|
2217
|
+
if (item.selected) showHeadArr.push(item);
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
};
|
|
2221
|
+
/**
|
|
2222
|
+
* 初始化设置表头
|
|
2223
|
+
* @param arr {(HeadDataProps | HeadDataReqProps)[]} 表头数据
|
|
2224
|
+
* @param bol {boolean} true请求表头
|
|
2225
|
+
* */
|
|
2226
|
+
|
|
2227
|
+
|
|
2228
|
+
var handInitHead = function handInitHead(arr, bol) {
|
|
2229
|
+
var headShowArr = []; // 表格显示列
|
|
2230
|
+
|
|
2231
|
+
var headArr = []; // 显示列列表
|
|
2232
|
+
|
|
2233
|
+
var json = {};
|
|
2234
|
+
var localHead = getLocalStorageHeadCom();
|
|
2235
|
+
|
|
2236
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
2237
|
+
var item = arr[i];
|
|
2238
|
+
if (typeof item.width === 'number') item.width += 'px';
|
|
2239
|
+
if (!bol) item.orderNum = i;
|
|
2240
|
+
handHeadShow(item, headShowArr, localHead);
|
|
2241
|
+
headArr.push(item);
|
|
2242
|
+
json[item.name] = item;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
if (bol) {
|
|
2246
|
+
headShowArr.sort(function (a, b) {
|
|
2247
|
+
return Number(a.orderNum) - Number(b.orderNum);
|
|
2248
|
+
});
|
|
2249
|
+
headArr.sort(function (a, b) {
|
|
2250
|
+
return Number(a.orderNum) - Number(b.orderNum);
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
handHeadDataCom(headShowArr);
|
|
2255
|
+
setHeadDataCom(headShowArr);
|
|
2256
|
+
setShowHeadList(headArr);
|
|
2257
|
+
constData.current.headDataJson = json;
|
|
2258
|
+
}; // 计算左边的差量
|
|
2259
|
+
|
|
2038
2260
|
|
|
2039
2261
|
var handLeftWidth = function handLeftWidth() {
|
|
2040
2262
|
var leftNum = 0; // 复选
|
|
@@ -2188,7 +2410,7 @@ var Table = function Table(props) {
|
|
|
2188
2410
|
var handFilterReq = function handFilterReq() {
|
|
2189
2411
|
var json = {};
|
|
2190
2412
|
var arr = Object.keys(selectFilterCom);
|
|
2191
|
-
var headDataJson = constData.headDataJson || {};
|
|
2413
|
+
var headDataJson = constData.current.headDataJson || {};
|
|
2192
2414
|
|
|
2193
2415
|
for (var i = 0, l = arr.length; i < l; i++) {
|
|
2194
2416
|
var name = arr[i];
|
|
@@ -2279,41 +2501,22 @@ var Table = function Table(props) {
|
|
|
2279
2501
|
if (str !== JSON.stringify(originalHead)) {
|
|
2280
2502
|
setOriginalHead(data.columns);
|
|
2281
2503
|
var arr = Object.keys(data.columns);
|
|
2282
|
-
var
|
|
2283
|
-
|
|
2284
|
-
var headArr = []; // 显示列列表
|
|
2285
|
-
|
|
2286
|
-
var json = {};
|
|
2504
|
+
var headDataArr = []; // 表头数据
|
|
2287
2505
|
|
|
2288
2506
|
for (var i = 0, l = arr.length; i < l; i++) {
|
|
2289
2507
|
var key = arr[i];
|
|
2290
2508
|
var item = data.columns[key];
|
|
2291
|
-
item.label = item.displayName;
|
|
2292
2509
|
item.name = key;
|
|
2510
|
+
item.label = item.displayName;
|
|
2293
2511
|
item.filter = item.filterFlag;
|
|
2294
2512
|
item.filterRadio = item.filterRadioFlag;
|
|
2295
2513
|
item.sort = item.orderFlag;
|
|
2296
2514
|
item.selected = item.selectedFlag;
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
// 当前显示字段
|
|
2300
|
-
headShowArr.push(item);
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
headArr.push(item);
|
|
2304
|
-
json[item.name] = item;
|
|
2515
|
+
item.width = item.width;
|
|
2516
|
+
headDataArr.push(item);
|
|
2305
2517
|
}
|
|
2306
2518
|
|
|
2307
|
-
|
|
2308
|
-
return a.orderNum - b.orderNum;
|
|
2309
|
-
});
|
|
2310
|
-
headArr.sort(function (a, b) {
|
|
2311
|
-
return a.orderNum - b.orderNum;
|
|
2312
|
-
});
|
|
2313
|
-
handHeadDataCom(headShowArr);
|
|
2314
|
-
setHeadDataCom(headShowArr);
|
|
2315
|
-
setShowHeadList(headArr);
|
|
2316
|
-
constData.headDataJson = json;
|
|
2519
|
+
handInitHead(headDataArr, true);
|
|
2317
2520
|
}
|
|
2318
2521
|
}
|
|
2319
2522
|
|
|
@@ -2321,7 +2524,11 @@ var Table = function Table(props) {
|
|
|
2321
2524
|
// 分页 data是对象
|
|
2322
2525
|
setNowPageData(data.list || []);
|
|
2323
2526
|
setTotal(data.total);
|
|
2324
|
-
|
|
2527
|
+
|
|
2528
|
+
if (data.page !== undefined && data.page !== null) {
|
|
2529
|
+
constData.current.page = Number(data.page);
|
|
2530
|
+
setPageCom(Number(data.page));
|
|
2531
|
+
}
|
|
2325
2532
|
} else {
|
|
2326
2533
|
var handData1 = [];
|
|
2327
2534
|
|
|
@@ -2342,8 +2549,8 @@ var Table = function Table(props) {
|
|
|
2342
2549
|
|
|
2343
2550
|
var setNowPageData = function setNowPageData(nowPageData) {
|
|
2344
2551
|
// 加载更多请求放在里面
|
|
2345
|
-
if (constData.loadMoreUrl) {
|
|
2346
|
-
var historyData = constData.historyData || [];
|
|
2552
|
+
if (constData.current.loadMoreUrl) {
|
|
2553
|
+
var historyData = constData.current.historyData || [];
|
|
2347
2554
|
|
|
2348
2555
|
if (historyData.length > 0) {
|
|
2349
2556
|
nowPageData = [].concat(_toConsumableArray(historyData), _toConsumableArray(nowPageData));
|
|
@@ -2351,7 +2558,7 @@ var Table = function Table(props) {
|
|
|
2351
2558
|
}
|
|
2352
2559
|
|
|
2353
2560
|
var handDataJson = ArrayToObject(rowKey, nowPageData);
|
|
2354
|
-
constData.historyData = nowPageData;
|
|
2561
|
+
constData.current.historyData = nowPageData;
|
|
2355
2562
|
setRowDataJson(handDataJson);
|
|
2356
2563
|
setRowData(nowPageData); // 设置总数对象
|
|
2357
2564
|
|
|
@@ -2359,6 +2566,16 @@ var Table = function Table(props) {
|
|
|
2359
2566
|
setTotalDataJson(Object.assign(Object.assign({}, totalDataJson), handDataJson));
|
|
2360
2567
|
}
|
|
2361
2568
|
};
|
|
2569
|
+
/**
|
|
2570
|
+
* 处理page
|
|
2571
|
+
* */
|
|
2572
|
+
|
|
2573
|
+
|
|
2574
|
+
var handPage = function handPage(num) {
|
|
2575
|
+
constData.current.page = num;
|
|
2576
|
+
setPageCom(num);
|
|
2577
|
+
setRefreshCom(Math.random());
|
|
2578
|
+
};
|
|
2362
2579
|
/**
|
|
2363
2580
|
* 改变页数
|
|
2364
2581
|
* @param num {number | undefined} 页数
|
|
@@ -2366,7 +2583,7 @@ var Table = function Table(props) {
|
|
|
2366
2583
|
|
|
2367
2584
|
|
|
2368
2585
|
var changePage = function changePage(num) {
|
|
2369
|
-
if (num !== undefined)
|
|
2586
|
+
if (num !== undefined) handPage(num);
|
|
2370
2587
|
clearCheckValue();
|
|
2371
2588
|
};
|
|
2372
2589
|
/**
|
|
@@ -2376,8 +2593,17 @@ var Table = function Table(props) {
|
|
|
2376
2593
|
|
|
2377
2594
|
|
|
2378
2595
|
var changeRowsPerPage = function changeRowsPerPage(num) {
|
|
2379
|
-
if (num !== undefined)
|
|
2380
|
-
|
|
2596
|
+
if (num !== undefined) handSize(num);
|
|
2597
|
+
handPage(1);
|
|
2598
|
+
};
|
|
2599
|
+
/**
|
|
2600
|
+
* 加载更多,点击改变分页
|
|
2601
|
+
*/
|
|
2602
|
+
|
|
2603
|
+
|
|
2604
|
+
var changePageMore = function changePageMore() {
|
|
2605
|
+
var pageHnad = Number(pageCom) + 1;
|
|
2606
|
+
handPage(pageHnad);
|
|
2381
2607
|
};
|
|
2382
2608
|
/**
|
|
2383
2609
|
* 排序
|
|
@@ -2428,6 +2654,9 @@ var Table = function Table(props) {
|
|
|
2428
2654
|
|
|
2429
2655
|
setOrderFieldArr(orderFieldArrHand);
|
|
2430
2656
|
setOrderTypeArr(orderTypeArrHand);
|
|
2657
|
+
constData.current.orderFieldArr = orderFieldArrHand;
|
|
2658
|
+
constData.current.orderTypeArr = orderTypeArrHand;
|
|
2659
|
+
setRefreshCom(Math.random());
|
|
2431
2660
|
};
|
|
2432
2661
|
/**
|
|
2433
2662
|
* 处理复选框往外抛值
|
|
@@ -2513,6 +2742,15 @@ var Table = function Table(props) {
|
|
|
2513
2742
|
handCheckValue({});
|
|
2514
2743
|
}
|
|
2515
2744
|
};
|
|
2745
|
+
/** 改变选择列 */
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
var changeSelectHead = function changeSelectHead(arr, item) {
|
|
2749
|
+
handHeadDataCom(arr);
|
|
2750
|
+
setHeadDataCom(arr);
|
|
2751
|
+
setLocalStorageHeadCom(arr);
|
|
2752
|
+
onClickColumns && onClickColumns(arr, item);
|
|
2753
|
+
};
|
|
2516
2754
|
/**
|
|
2517
2755
|
* 改变显示列 bol true重置
|
|
2518
2756
|
* @param headShowArr 当前显示列
|
|
@@ -2534,21 +2772,17 @@ var Table = function Table(props) {
|
|
|
2534
2772
|
}
|
|
2535
2773
|
}
|
|
2536
2774
|
|
|
2537
|
-
|
|
2538
|
-
setHeadDataCom(arr);
|
|
2539
|
-
onClickColumns && onClickColumns(arr, item);
|
|
2775
|
+
changeSelectHead(arr, item);
|
|
2540
2776
|
return;
|
|
2541
2777
|
}
|
|
2542
2778
|
|
|
2543
2779
|
headShowArr.sort(function (a, b) {
|
|
2544
|
-
return a.orderNum - b.orderNum;
|
|
2780
|
+
return Number(a.orderNum) - Number(b.orderNum);
|
|
2545
2781
|
});
|
|
2546
2782
|
|
|
2547
2783
|
var headShowArrHand = _toConsumableArray(headShowArr);
|
|
2548
2784
|
|
|
2549
|
-
|
|
2550
|
-
setHeadDataCom(headShowArrHand);
|
|
2551
|
-
onClickColumns && onClickColumns(headShowArrHand, item);
|
|
2785
|
+
changeSelectHead(headShowArrHand, item);
|
|
2552
2786
|
};
|
|
2553
2787
|
/**
|
|
2554
2788
|
* 改变过滤
|
|
@@ -2556,16 +2790,9 @@ var Table = function Table(props) {
|
|
|
2556
2790
|
|
|
2557
2791
|
|
|
2558
2792
|
var changeFilter = function changeFilter(val) {
|
|
2793
|
+
constData.current.selectFilterCom = DeepClone(val);
|
|
2559
2794
|
setSelectFilterCom(DeepClone(val));
|
|
2560
|
-
|
|
2561
|
-
/**
|
|
2562
|
-
* 加载更多,点击改变分页
|
|
2563
|
-
*/
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
var changePageMore = function changePageMore() {
|
|
2567
|
-
var pageHnad = Number(pageCom) + 1;
|
|
2568
|
-
setPageCom(pageHnad);
|
|
2795
|
+
handPage(1);
|
|
2569
2796
|
}; // 表格头部memo
|
|
2570
2797
|
|
|
2571
2798
|
|
|
@@ -2591,10 +2818,11 @@ var Table = function Table(props) {
|
|
|
2591
2818
|
showColumns: showColumns,
|
|
2592
2819
|
rowKey: rowKey,
|
|
2593
2820
|
fixedTable: fixedTable,
|
|
2821
|
+
fixedColumn: fixedColumn,
|
|
2594
2822
|
posFixed: posFixed,
|
|
2595
2823
|
beyondText: beyondText
|
|
2596
2824
|
});
|
|
2597
|
-
}, [totalDataJson, showColumns, rowKey, rowData, checkJson, disabledJson, orderTypeArr, orderFieldArr, sortTable, filter, expandable, check, headSelectStatus, radio, align, showHeadList, headDataCom, selectFilterCom, operate, onClickColumns, sortTableRadio, fixedTable, posFixed, beyondText]); // 表格内容memo
|
|
2825
|
+
}, [totalDataJson, showColumns, rowKey, rowData, checkJson, disabledJson, orderTypeArr, orderFieldArr, sortTable, filter, expandable, check, headSelectStatus, radio, align, showHeadList, headDataCom, selectFilterCom, operate, onClickColumns, sortTableRadio, fixedTable, posFixed, beyondText, fixedColumn]); // 表格内容memo
|
|
2598
2826
|
|
|
2599
2827
|
var TableBodyMemo = useMemo(function () {
|
|
2600
2828
|
return jsx(TableBody, {
|
|
@@ -2638,57 +2866,60 @@ var Table = function Table(props) {
|
|
|
2638
2866
|
return setRefreshCom(Math.random());
|
|
2639
2867
|
},
|
|
2640
2868
|
posFixed: posFixed,
|
|
2641
|
-
beyondText: beyondText
|
|
2869
|
+
beyondText: beyondText,
|
|
2870
|
+
fixedColumn: fixedColumn,
|
|
2871
|
+
fixedTable: fixedTable
|
|
2642
2872
|
});
|
|
2643
|
-
}, [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]); // 表格分页memo
|
|
2873
|
+
}, [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]); // 表格分页memo
|
|
2644
2874
|
|
|
2645
2875
|
var TablePaginationMemo = useMemo(function () {
|
|
2646
|
-
if (
|
|
2876
|
+
if (constData.current.page === null || constData.current.size === null || loadMore) return;
|
|
2647
2877
|
return pagination && jsx(TableHead, {
|
|
2648
2878
|
paginationType: paginationType,
|
|
2649
2879
|
autoPagination: autoPagination,
|
|
2650
2880
|
total: total,
|
|
2651
|
-
page:
|
|
2881
|
+
page: pageCom,
|
|
2652
2882
|
currentRowsPerPage: sizeCom,
|
|
2653
2883
|
rowsPerPage: sizeArrCom,
|
|
2654
2884
|
changePage: changePage,
|
|
2655
2885
|
changeRowsPerPage: changeRowsPerPage
|
|
2656
2886
|
});
|
|
2657
|
-
}, [total,
|
|
2887
|
+
}, [total, pageCom, sizeCom, sizeArrCom, pagination, loadMore, autoPagination, paginationType]); // 表格内容滚动
|
|
2658
2888
|
|
|
2659
2889
|
var tableBoxScroll = function tableBoxScroll(e) {
|
|
2660
2890
|
var dom = tableRef.current;
|
|
2661
2891
|
var scrollDom = e.target;
|
|
2662
2892
|
if (!dom || !scrollDom) return;
|
|
2663
|
-
dom.classList.remove('
|
|
2893
|
+
dom.classList.remove('table-scroll-left', 'table-scroll-right', 'table-scroll-middle');
|
|
2664
2894
|
if (scrollDom.scrollWidth <= scrollDom.clientWidth) return; // 最左边
|
|
2665
2895
|
|
|
2666
2896
|
if (scrollDom.scrollLeft === 0) {
|
|
2667
|
-
dom.classList.add('
|
|
2897
|
+
dom.classList.add('table-scroll-left');
|
|
2668
2898
|
return;
|
|
2669
2899
|
} // 最右边
|
|
2670
2900
|
|
|
2671
2901
|
|
|
2672
2902
|
if (scrollDom.scrollLeft + scrollDom.clientWidth === scrollDom.scrollWidth) {
|
|
2673
|
-
dom.classList.add('
|
|
2903
|
+
dom.classList.add('table-scroll-right');
|
|
2674
2904
|
return;
|
|
2675
2905
|
}
|
|
2676
2906
|
|
|
2677
|
-
dom.classList.add('
|
|
2907
|
+
dom.classList.add('table-scroll-middle');
|
|
2678
2908
|
}; // 处理class
|
|
2679
2909
|
|
|
2680
2910
|
|
|
2681
2911
|
var handClass = function handClass() {
|
|
2682
|
-
var str = '
|
|
2683
|
-
if (showColumns === 'inside') str +=
|
|
2684
|
-
if (pagination) str +=
|
|
2685
|
-
if (loadMore) str +=
|
|
2686
|
-
if (fixedTable) str +=
|
|
2687
|
-
if (
|
|
2688
|
-
if (
|
|
2689
|
-
if (
|
|
2690
|
-
if (
|
|
2691
|
-
if (
|
|
2912
|
+
var str = $prefixCls + '-table';
|
|
2913
|
+
if (showColumns === 'inside') str += " ".concat($prefixCls, "-table-columns-inside");
|
|
2914
|
+
if (pagination) str += " ".concat($prefixCls, "-table-pagination");
|
|
2915
|
+
if (loadMore) str += " ".concat($prefixCls, "-table-load-more");
|
|
2916
|
+
if (fixedTable) str += " ".concat($prefixCls, "-table-fixed-table");
|
|
2917
|
+
if (fixedColumn) str += " ".concat($prefixCls, "-table-fixed-cloumn");
|
|
2918
|
+
if (check) str += " ".concat($prefixCls, "-table-check");
|
|
2919
|
+
if (radio) str += " ".concat($prefixCls, "-table-radio");
|
|
2920
|
+
if (expandable) str += " ".concat($prefixCls, "-table-expandable");
|
|
2921
|
+
if (rowData.length === 0) str += " ".concat($prefixCls, "-table-no-data");
|
|
2922
|
+
if (loadState) str += " ".concat($prefixCls, "-table-load");
|
|
2692
2923
|
if (className) str += ' ' + className;
|
|
2693
2924
|
return str;
|
|
2694
2925
|
}; // 改变屏幕大小
|
|
@@ -2711,11 +2942,8 @@ var Table = function Table(props) {
|
|
|
2711
2942
|
onScroll: tableBoxScroll
|
|
2712
2943
|
}, {
|
|
2713
2944
|
children: [jsxs(TableElement, Object.assign({
|
|
2714
|
-
|
|
2715
|
-
style:
|
|
2716
|
-
tableLayout: 'fixed',
|
|
2717
|
-
minWidth: tableMinWidth + 'px'
|
|
2718
|
-
} : {
|
|
2945
|
+
fixedColumn: fixedColumn,
|
|
2946
|
+
style: {
|
|
2719
2947
|
minWidth: tableMinWidth + 'px'
|
|
2720
2948
|
}
|
|
2721
2949
|
}, {
|