@para-ui/core 3.0.0 → 3.0.2
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.d.ts +8 -0
- package/Button/index.js +77 -37
- 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 +266 -93
- package/ComboSelect/interface.d.ts +12 -9
- package/ComboSelect/lang/en_US.d.ts +1 -0
- package/ComboSelect/lang/index.d.ts +2 -0
- package/ComboSelect/lang/zh_CN.d.ts +1 -0
- package/Container/index.js +27 -31
- 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/componentsProps.d.ts +2 -0
- 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 +22 -23
- package/Pagination/index.js +10 -4
- package/ParauiProvider/index.js +1 -1
- package/PopConfirm/index.d.ts +2 -0
- 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 +32 -1
- 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 +4 -5
- package/Select/index.js +27 -22
- package/SelectInput/index.js +3 -2
- package/Selector/index.d.ts +3 -19
- package/Selector/index.js +2102 -213
- package/Selector/interface.d.ts +365 -0
- package/Selector/lang/en_US.d.ts +9 -0
- package/Selector/lang/index.d.ts +17 -0
- package/Selector/lang/zh_CN.d.ts +9 -0
- package/Selector/selectorData/index.d.ts +10 -0
- package/Selector/selectorMain/index.d.ts +2 -9
- package/Selector/selectorNode/index.d.ts +10 -0
- package/Selector/util.d.ts +15 -0
- package/SelectorPicker/index.d.ts +46 -0
- package/SelectorPicker/index.js +319 -0
- 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 +542 -313
- package/Table/interface.d.ts +43 -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 +4 -5
- package/TextField/index.js +23 -20
- 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 +51 -11
- package/Tooltip/interface.d.ts +2 -0
- package/Transfer/index.d.ts +6 -2
- package/Transfer/index.js +8 -4
- package/Tree/index.js +3 -2
- package/Tree/interface.d.ts +0 -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-3d26f6a5.js → index-cc4c83b8.js} +63 -31
- package/_verture/{index-ce3860a0.js → index-cf5bf211.js} +30 -21
- package/_verture/{modalContext-fc19f4ae.js → modalContext-95c3fc87.js} +0 -0
- package/index.d.ts +4 -0
- package/index.js +10 -6
- package/package.json +8 -5
- package/Selector/branchNode/index.d.ts +0 -32
- package/Selector/leafNode/index.d.ts +0 -34
- package/Selector/selectorRight/index.d.ts +0 -16
- package/Selector/selectorTop/index.d.ts +0 -16
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]; // 重置过期时间
|
|
127
155
|
|
|
128
|
-
|
|
156
|
+
if (headJsonItem) {
|
|
157
|
+
headJsonItem.storageTime = new Date().getTime();
|
|
158
|
+
headJsonItem.validity = num * (60 * 60 * 24);
|
|
159
|
+
}
|
|
160
|
+
|
|
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';
|
|
543
|
+
|
|
544
|
+
if (fixedColumn) {
|
|
545
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,且没有单选,没有嵌套表格
|
|
494
546
|
|
|
495
|
-
|
|
496
|
-
|
|
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;
|
|
@@ -503,52 +556,72 @@ var TableHead$1 = function TableHead(props) {
|
|
|
503
556
|
align: "center",
|
|
504
557
|
className: handCls()
|
|
505
558
|
}, {
|
|
506
|
-
children: jsx(
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
559
|
+
children: jsx("div", Object.assign({
|
|
560
|
+
className: 'table-header-box'
|
|
561
|
+
}, {
|
|
562
|
+
children: jsx(Checkbox, {
|
|
563
|
+
indeterminate: indeterminate,
|
|
564
|
+
checked: checked,
|
|
565
|
+
onChange: onSelectAll
|
|
566
|
+
})
|
|
567
|
+
}))
|
|
511
568
|
}));
|
|
512
569
|
}
|
|
513
|
-
}, [check, indeterminate, checked, selectAll, posFixed, radio, expandable]); // 单选框memo
|
|
570
|
+
}, [check, indeterminate, checked, selectAll, posFixed, radio, expandable, fixedColumn]); // 单选框memo
|
|
514
571
|
|
|
515
572
|
var TableRadioMemo = useMemo(function () {
|
|
516
573
|
if (radio) {
|
|
517
574
|
var handCls = function handCls() {
|
|
518
|
-
var str = 'table-radio table-head-btn
|
|
575
|
+
var str = 'table-radio table-head-btn';
|
|
576
|
+
|
|
577
|
+
if (fixedColumn) {
|
|
578
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,没有嵌套表格
|
|
519
579
|
|
|
520
|
-
|
|
521
|
-
|
|
580
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol) && !expandable) {
|
|
581
|
+
str += ' table-fixed-dom-left-last';
|
|
582
|
+
}
|
|
522
583
|
}
|
|
523
584
|
|
|
524
585
|
return str;
|
|
525
586
|
};
|
|
526
587
|
|
|
527
|
-
return jsx(ThElement, {
|
|
588
|
+
return jsx(ThElement, Object.assign({
|
|
528
589
|
align: "center",
|
|
529
590
|
className: handCls()
|
|
530
|
-
}
|
|
591
|
+
}, {
|
|
592
|
+
children: jsx("div", {
|
|
593
|
+
className: 'table-header-box'
|
|
594
|
+
})
|
|
595
|
+
}));
|
|
531
596
|
}
|
|
532
|
-
}, [radio, posFixed, expandable]); // 嵌套表格memo
|
|
597
|
+
}, [radio, posFixed, expandable, fixedColumn]); // 嵌套表格memo
|
|
533
598
|
|
|
534
599
|
var TableExpandableMemo = useMemo(function () {
|
|
535
600
|
if (expandable) {
|
|
536
601
|
var handCls = function handCls() {
|
|
537
|
-
var str = 'table-expandable table-head-btn
|
|
602
|
+
var str = 'table-expandable table-head-btn';
|
|
538
603
|
|
|
539
|
-
if (
|
|
540
|
-
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
|
+
}
|
|
541
610
|
}
|
|
542
611
|
|
|
543
612
|
return str;
|
|
544
613
|
};
|
|
545
614
|
|
|
546
|
-
return jsx(ThElement, {
|
|
615
|
+
return jsx(ThElement, Object.assign({
|
|
547
616
|
align: "center",
|
|
548
617
|
className: handCls()
|
|
549
|
-
}
|
|
618
|
+
}, {
|
|
619
|
+
children: jsx("div", {
|
|
620
|
+
className: 'table-header-box'
|
|
621
|
+
})
|
|
622
|
+
}));
|
|
550
623
|
}
|
|
551
|
-
}, [expandable, posFixed]); // 过滤弹窗内容
|
|
624
|
+
}, [expandable, posFixed, fixedColumn]); // 过滤弹窗内容
|
|
552
625
|
|
|
553
626
|
var filterPopoverContent = function filterPopoverContent() {
|
|
554
627
|
return jsxs("div", Object.assign({
|
|
@@ -612,16 +685,16 @@ var TableHead$1 = function TableHead(props) {
|
|
|
612
685
|
var handCls = function handCls(item) {
|
|
613
686
|
var str = '';
|
|
614
687
|
|
|
615
|
-
if (item.fixed) {
|
|
616
|
-
str = '
|
|
688
|
+
if (fixedColumn && item.fixed) {
|
|
689
|
+
str = 'table-fixed-dom-' + item.fixed; // 固定左边,判断是否是最后一个
|
|
617
690
|
|
|
618
691
|
if (item.fixed === 'left' && item.paraui_fixed_left_last) {
|
|
619
|
-
str += '
|
|
692
|
+
str += ' table-fixed-dom-left-last';
|
|
620
693
|
} // 固定右边,判断是否是第一个
|
|
621
694
|
|
|
622
695
|
|
|
623
696
|
if (item.fixed === 'right' && item.paraui_fixed_right_first) {
|
|
624
|
-
str += '
|
|
697
|
+
str += ' table-fixed-dom-right-first';
|
|
625
698
|
}
|
|
626
699
|
}
|
|
627
700
|
|
|
@@ -633,7 +706,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
633
706
|
width: item.width
|
|
634
707
|
};
|
|
635
708
|
|
|
636
|
-
if (item.fixed && item.width) {
|
|
709
|
+
if (fixedColumn && item.fixed && item.width) {
|
|
637
710
|
if (item.fixed === 'left') {
|
|
638
711
|
json.left = item.paraui_left_width + 'px';
|
|
639
712
|
}
|
|
@@ -653,13 +726,15 @@ var TableHead$1 = function TableHead(props) {
|
|
|
653
726
|
visible: filterHead.name === item.name,
|
|
654
727
|
content: filterPopoverContent(),
|
|
655
728
|
onVisibleChange: clickHideFilter,
|
|
656
|
-
overlayClassName:
|
|
729
|
+
overlayClassName: "".concat($prefixCls, "-filter-popover ").concat($prefixCls, "-scrollbar-small")
|
|
657
730
|
}, {
|
|
658
|
-
children: jsx("
|
|
731
|
+
children: jsx("div", Object.assign({
|
|
659
732
|
className: handFilterClass(item),
|
|
660
733
|
onClick: clickShowFilter(item)
|
|
661
734
|
}, {
|
|
662
|
-
children: jsx(
|
|
735
|
+
children: jsx("span", {
|
|
736
|
+
children: jsx(Screen, {})
|
|
737
|
+
})
|
|
663
738
|
}))
|
|
664
739
|
}));
|
|
665
740
|
};
|
|
@@ -673,11 +748,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
673
748
|
children: jsxs("div", Object.assign({
|
|
674
749
|
className: handCellClass(headCell)
|
|
675
750
|
}, {
|
|
676
|
-
children: [
|
|
677
|
-
className: "table-header-title"
|
|
678
|
-
onClick: createSortHandler(headCell.name, headCell)
|
|
751
|
+
children: [jsx("div", Object.assign({
|
|
752
|
+
className: "table-header-title"
|
|
679
753
|
}, {
|
|
680
|
-
children:
|
|
754
|
+
children: jsx("span", Object.assign({
|
|
681
755
|
className: "table-header-title-label"
|
|
682
756
|
}, {
|
|
683
757
|
children: jsx(AutoTips, Object.assign({
|
|
@@ -685,29 +759,37 @@ var TableHead$1 = function TableHead(props) {
|
|
|
685
759
|
}, {
|
|
686
760
|
children: headCell.label
|
|
687
761
|
}))
|
|
688
|
-
}))
|
|
689
|
-
|
|
762
|
+
}))
|
|
763
|
+
})), filter && headCell.name && headCell.filter && handFilterPopover(headCell), sortTable && headCell.name && headCell.sort !== false && jsx("div", Object.assign({
|
|
764
|
+
className: "table-sort-svg"
|
|
765
|
+
}, {
|
|
766
|
+
children: jsxs("span", Object.assign({
|
|
767
|
+
onClick: createSortHandler(headCell.name, headCell)
|
|
690
768
|
}, {
|
|
691
769
|
children: [jsx(SolidArrowUp, {
|
|
692
770
|
className: "up-svg"
|
|
693
771
|
}), jsx(SolidArrowDown, {
|
|
694
772
|
className: "down-svg"
|
|
695
773
|
})]
|
|
696
|
-
}))
|
|
697
|
-
}))
|
|
774
|
+
}))
|
|
775
|
+
}))]
|
|
698
776
|
}))
|
|
699
777
|
}), headCell.name || index);
|
|
700
778
|
});
|
|
701
|
-
}, [headData, sortTable, filter, orderFieldArr, orderTypeArr, align, filterHead, selectFilterCom, beyondText, selectFilter]); // 操作栏memo
|
|
779
|
+
}, [headData, sortTable, filter, orderFieldArr, orderTypeArr, align, filterHead, selectFilterCom, beyondText, selectFilter, fixedColumn]); // 操作栏memo
|
|
702
780
|
|
|
703
781
|
var TableOperateMemo = useMemo(function () {
|
|
704
782
|
if (operate) {
|
|
705
783
|
var handCls = function handCls() {
|
|
706
|
-
var str = 'table-operate
|
|
784
|
+
var str = 'table-operate';
|
|
707
785
|
if (operate.operateBtnRender) str += ' table-operate-small';
|
|
708
786
|
|
|
709
|
-
if (
|
|
710
|
-
str += '
|
|
787
|
+
if (fixedColumn) {
|
|
788
|
+
str += ' table-fixed-dom-right'; // 存在显示列,且没有右侧固定列
|
|
789
|
+
|
|
790
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
791
|
+
str += ' table-fixed-dom-right-first';
|
|
792
|
+
}
|
|
711
793
|
}
|
|
712
794
|
|
|
713
795
|
return str;
|
|
@@ -715,9 +797,13 @@ var TableHead$1 = function TableHead(props) {
|
|
|
715
797
|
|
|
716
798
|
var handStyle = function handStyle() {
|
|
717
799
|
var json = {
|
|
718
|
-
width: operate.width
|
|
719
|
-
right: showColumns === "inside" ? '56px' : '0px'
|
|
800
|
+
width: operate.width
|
|
720
801
|
};
|
|
802
|
+
|
|
803
|
+
if (fixedColumn) {
|
|
804
|
+
json.right = showColumns === "inside" ? '56px' : '0px';
|
|
805
|
+
}
|
|
806
|
+
|
|
721
807
|
return Object.assign(Object.assign({}, json), operate.style);
|
|
722
808
|
};
|
|
723
809
|
|
|
@@ -745,7 +831,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
745
831
|
}))
|
|
746
832
|
}));
|
|
747
833
|
}
|
|
748
|
-
}, [operate, align, posFixed, showColumns, posFixed, beyondText]); // 显示列弹窗内容
|
|
834
|
+
}, [operate, align, posFixed, showColumns, posFixed, beyondText, fixedColumn]); // 显示列弹窗内容
|
|
749
835
|
|
|
750
836
|
var showListContent = function showListContent() {
|
|
751
837
|
return jsxs("div", Object.assign({
|
|
@@ -787,10 +873,10 @@ var TableHead$1 = function TableHead(props) {
|
|
|
787
873
|
|
|
788
874
|
var TableShowList = useMemo(function () {
|
|
789
875
|
var handCls = function handCls() {
|
|
790
|
-
var str = 'show-colums
|
|
876
|
+
var str = 'show-colums table-fixed-dom-right'; // 没有固定列参数 或者 没有操作栏且没有右侧固定列
|
|
791
877
|
|
|
792
|
-
if (!operate && !(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
793
|
-
str += '
|
|
878
|
+
if (!fixedColumn || !operate && !(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
879
|
+
str += ' table-fixed-dom-right-first';
|
|
794
880
|
}
|
|
795
881
|
|
|
796
882
|
return str;
|
|
@@ -801,14 +887,18 @@ var TableHead$1 = function TableHead(props) {
|
|
|
801
887
|
visible: Boolean(anchorElColums),
|
|
802
888
|
content: showListContent(),
|
|
803
889
|
onVisibleChange: clickHideColums,
|
|
804
|
-
overlayClassName:
|
|
890
|
+
overlayClassName: "".concat($prefixCls, "-table-show-colums-popover ").concat($prefixCls, "-scrollbar-small")
|
|
805
891
|
}, {
|
|
806
892
|
children: jsx(ThElement, Object.assign({
|
|
807
893
|
align: "center",
|
|
808
894
|
className: handCls(),
|
|
809
895
|
onClick: clickShowColums
|
|
810
896
|
}, {
|
|
811
|
-
children: jsx(
|
|
897
|
+
children: jsx("div", Object.assign({
|
|
898
|
+
className: 'table-header-box'
|
|
899
|
+
}, {
|
|
900
|
+
children: jsx(Panel, {})
|
|
901
|
+
}))
|
|
812
902
|
}))
|
|
813
903
|
}));
|
|
814
904
|
}, [showColumns, posFixed, operate, anchorElColums, showList, headDataJson]); // 处理class
|
|
@@ -816,7 +906,8 @@ var TableHead$1 = function TableHead(props) {
|
|
|
816
906
|
var handClass = function handClass() {
|
|
817
907
|
var str = 'table-head';
|
|
818
908
|
if (showColumns === 'inside') str += ' table-head-inside';
|
|
819
|
-
if (!fixedTable) str += ' table-head-scroll'; //
|
|
909
|
+
if (!fixedTable) str += ' table-head-scroll'; // 防止长度过长
|
|
910
|
+
// 没有 复选框,单选框,展开 按钮
|
|
820
911
|
|
|
821
912
|
if (!check && !radio && !expandable) str += ' table-head-no-btn';
|
|
822
913
|
return str;
|
|
@@ -831,7 +922,7 @@ var TableHead$1 = function TableHead(props) {
|
|
|
831
922
|
}));
|
|
832
923
|
};
|
|
833
924
|
|
|
834
|
-
var css_248z$4 = ".
|
|
925
|
+
var css_248z$4 = ".table-body-element {\n display: table-row-group;\n}";
|
|
835
926
|
styleInject(css_248z$4);
|
|
836
927
|
|
|
837
928
|
var TableBodyElement = function TableBodyElement(props) {
|
|
@@ -841,7 +932,7 @@ var TableBodyElement = function TableBodyElement(props) {
|
|
|
841
932
|
otherProps = __rest(props, ["className", "style", "children"]);
|
|
842
933
|
|
|
843
934
|
var handClass = function handClass() {
|
|
844
|
-
var str = '
|
|
935
|
+
var str = 'table-body-element';
|
|
845
936
|
if (className) str += ' ' + className;
|
|
846
937
|
return str;
|
|
847
938
|
};
|
|
@@ -854,7 +945,7 @@ var TableBodyElement = function TableBodyElement(props) {
|
|
|
854
945
|
}));
|
|
855
946
|
};
|
|
856
947
|
|
|
857
|
-
var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.
|
|
948
|
+
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 fontWeight: 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}";
|
|
858
949
|
styleInject(css_248z$3);
|
|
859
950
|
|
|
860
951
|
var TdElement = function TdElement(props) {
|
|
@@ -864,7 +955,7 @@ var TdElement = function TdElement(props) {
|
|
|
864
955
|
otherProps = __rest(props, ["className", "style", "children"]);
|
|
865
956
|
|
|
866
957
|
var handClass = function handClass() {
|
|
867
|
-
var str = '
|
|
958
|
+
var str = 'td-element';
|
|
868
959
|
if (className) str += ' ' + className;
|
|
869
960
|
return str;
|
|
870
961
|
};
|
|
@@ -902,6 +993,7 @@ var TableBody = function TableBody(props) {
|
|
|
902
993
|
operate = props.operate,
|
|
903
994
|
showColumns = props.showColumns,
|
|
904
995
|
fixedTable = props.fixedTable,
|
|
996
|
+
fixedColumn = props.fixedColumn,
|
|
905
997
|
formatter = props.formatter,
|
|
906
998
|
_props$orderFieldArr = props.orderFieldArr,
|
|
907
999
|
orderFieldArr = _props$orderFieldArr === void 0 ? [] : _props$orderFieldArr,
|
|
@@ -1144,10 +1236,14 @@ var TableBody = function TableBody(props) {
|
|
|
1144
1236
|
}
|
|
1145
1237
|
|
|
1146
1238
|
var handCls = function handCls() {
|
|
1147
|
-
var str = 'table-checkbox table-body-btn
|
|
1239
|
+
var str = 'table-checkbox table-body-btn';
|
|
1240
|
+
|
|
1241
|
+
if (fixedColumn) {
|
|
1242
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,且没有单选,没有嵌套表格
|
|
1148
1243
|
|
|
1149
|
-
|
|
1150
|
-
|
|
1244
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol) && !radio && !expandable) {
|
|
1245
|
+
str += ' table-fixed-dom-left-last';
|
|
1246
|
+
}
|
|
1151
1247
|
}
|
|
1152
1248
|
|
|
1153
1249
|
return str;
|
|
@@ -1166,7 +1262,7 @@ var TableBody = function TableBody(props) {
|
|
|
1166
1262
|
})
|
|
1167
1263
|
}));
|
|
1168
1264
|
}
|
|
1169
|
-
}, [check, disabledJson, rowKey, checkJson, selectCheck, disabledArrStatus, posFixed, expandable, radio]); // 单选框useCallback
|
|
1265
|
+
}, [check, disabledJson, rowKey, checkJson, selectCheck, disabledArrStatus, posFixed, expandable, radio, fixedColumn]); // 单选框useCallback
|
|
1170
1266
|
|
|
1171
1267
|
var TableRadioCallback = useCallback(function (row) {
|
|
1172
1268
|
if (radio) {
|
|
@@ -1193,10 +1289,14 @@ var TableBody = function TableBody(props) {
|
|
|
1193
1289
|
}
|
|
1194
1290
|
|
|
1195
1291
|
var handCls = function handCls() {
|
|
1196
|
-
var str = 'table-radio table-body-btn
|
|
1292
|
+
var str = 'table-radio table-body-btn';
|
|
1293
|
+
|
|
1294
|
+
if (fixedColumn) {
|
|
1295
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,没有嵌套表格
|
|
1197
1296
|
|
|
1198
|
-
|
|
1199
|
-
|
|
1297
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol) && !expandable) {
|
|
1298
|
+
str += ' table-fixed-dom-left-last';
|
|
1299
|
+
}
|
|
1200
1300
|
}
|
|
1201
1301
|
|
|
1202
1302
|
return str;
|
|
@@ -1215,7 +1315,7 @@ var TableBody = function TableBody(props) {
|
|
|
1215
1315
|
})
|
|
1216
1316
|
}));
|
|
1217
1317
|
}
|
|
1218
|
-
}, [radio, disabledJson, radioValue, rowKey, selectRadio, disabledArrStatus, expandable, posFixed]); // 嵌套加减useCallback
|
|
1318
|
+
}, [radio, disabledJson, radioValue, rowKey, selectRadio, disabledArrStatus, expandable, posFixed, fixedColumn]); // 嵌套加减useCallback
|
|
1219
1319
|
|
|
1220
1320
|
var TableExpandableMemo = useCallback(function (row) {
|
|
1221
1321
|
if (!expandable) return null;
|
|
@@ -1224,10 +1324,14 @@ var TableBody = function TableBody(props) {
|
|
|
1224
1324
|
if (disabledExpandJson[row[rowKey]] || expandableDemo === false) return jsx(TdElement, {});
|
|
1225
1325
|
|
|
1226
1326
|
var handCls = function handCls() {
|
|
1227
|
-
var str = 'table-expandable table-body-btn
|
|
1327
|
+
var str = 'table-expandable table-body-btn';
|
|
1228
1328
|
|
|
1229
|
-
if (
|
|
1230
|
-
str += '
|
|
1329
|
+
if (fixedColumn) {
|
|
1330
|
+
str += ' table-fixed-dom-left'; // 左边没有定位,没有嵌套表格
|
|
1331
|
+
|
|
1332
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.leftBol)) {
|
|
1333
|
+
str += ' table-fixed-dom-left-last';
|
|
1334
|
+
}
|
|
1231
1335
|
}
|
|
1232
1336
|
|
|
1233
1337
|
return str;
|
|
@@ -1242,7 +1346,7 @@ var TableBody = function TableBody(props) {
|
|
|
1242
1346
|
onClick: handClickNestTable(row)
|
|
1243
1347
|
})
|
|
1244
1348
|
}));
|
|
1245
|
-
}, [expandable, expandableRow, rowKey, disabledExpandJson, onExpand]); // 表格一行内容useCallback
|
|
1349
|
+
}, [expandable, expandableRow, rowKey, disabledExpandJson, onExpand, fixedColumn]); // 表格一行内容useCallback
|
|
1246
1350
|
|
|
1247
1351
|
var TableContentUseCallback = useCallback(function (row) {
|
|
1248
1352
|
var params = {
|
|
@@ -1269,16 +1373,16 @@ var TableBody = function TableBody(props) {
|
|
|
1269
1373
|
}
|
|
1270
1374
|
}
|
|
1271
1375
|
|
|
1272
|
-
if (item.fixed) {
|
|
1273
|
-
str = '
|
|
1376
|
+
if (item.fixed && fixedColumn) {
|
|
1377
|
+
str = 'table-fixed-dom-' + item.fixed; // 固定左边,判断是否是最后一个
|
|
1274
1378
|
|
|
1275
1379
|
if (item.fixed === 'left' && item.paraui_fixed_left_last) {
|
|
1276
|
-
str += '
|
|
1380
|
+
str += ' table-fixed-dom-left-last';
|
|
1277
1381
|
} // 固定右边,判断是否是第一个
|
|
1278
1382
|
|
|
1279
1383
|
|
|
1280
1384
|
if (item.fixed === 'right' && item.paraui_fixed_right_first) {
|
|
1281
|
-
str += '
|
|
1385
|
+
str += ' table-fixed-dom-right-first';
|
|
1282
1386
|
}
|
|
1283
1387
|
}
|
|
1284
1388
|
|
|
@@ -1288,7 +1392,7 @@ var TableBody = function TableBody(props) {
|
|
|
1288
1392
|
var handStyle = function handStyle(item) {
|
|
1289
1393
|
var json = {};
|
|
1290
1394
|
|
|
1291
|
-
if (item.fixed && item.width) {
|
|
1395
|
+
if (fixedColumn && item.fixed && item.width) {
|
|
1292
1396
|
if (item.fixed === 'left') {
|
|
1293
1397
|
json.left = item.paraui_left_width + 'px';
|
|
1294
1398
|
}
|
|
@@ -1304,7 +1408,7 @@ var TableBody = function TableBody(props) {
|
|
|
1304
1408
|
return tableCell ? tableCell(row, params) : headData.map(function (item, index) {
|
|
1305
1409
|
var text = row[item.name];
|
|
1306
1410
|
var colSpan = 1;
|
|
1307
|
-
if (item.render) text = item.render(row);
|
|
1411
|
+
if (item.render) text = item.render(row, item, row[item.name], index);
|
|
1308
1412
|
if (formatter) text = formatter(row, item, row[item.name], index); // 存在显示列,最后一列占两格
|
|
1309
1413
|
|
|
1310
1414
|
if (showColumns === 'inside' && !operate && index === headData.length - 1) {
|
|
@@ -1324,7 +1428,7 @@ var TableBody = function TableBody(props) {
|
|
|
1324
1428
|
}))
|
|
1325
1429
|
}), item.name || index);
|
|
1326
1430
|
});
|
|
1327
|
-
}, [tableCell, headData, align, formatter, orderFieldArr, orderTypeArr, sortTable, showColumns, operate, beyondText]); // 操作栏useCallback
|
|
1431
|
+
}, [tableCell, headData, align, formatter, orderFieldArr, orderTypeArr, sortTable, showColumns, operate, beyondText, fixedColumn]); // 操作栏useCallback
|
|
1328
1432
|
|
|
1329
1433
|
var TableOperateUseCallback = useCallback(function (row) {
|
|
1330
1434
|
if (operate) {
|
|
@@ -1348,10 +1452,14 @@ var TableBody = function TableBody(props) {
|
|
|
1348
1452
|
};
|
|
1349
1453
|
|
|
1350
1454
|
var handCls = function handCls() {
|
|
1351
|
-
var str = 'table-operate
|
|
1455
|
+
var str = 'table-operate';
|
|
1352
1456
|
|
|
1353
|
-
if (
|
|
1354
|
-
str += '
|
|
1457
|
+
if (fixedColumn) {
|
|
1458
|
+
str += ' table-fixed-dom-right';
|
|
1459
|
+
|
|
1460
|
+
if (!(posFixed === null || posFixed === void 0 ? void 0 : posFixed.rightBol)) {
|
|
1461
|
+
str += ' table-fixed-dom-right-first';
|
|
1462
|
+
}
|
|
1355
1463
|
}
|
|
1356
1464
|
|
|
1357
1465
|
return str;
|
|
@@ -1366,7 +1474,7 @@ var TableBody = function TableBody(props) {
|
|
|
1366
1474
|
children: handOperate()
|
|
1367
1475
|
}));
|
|
1368
1476
|
}
|
|
1369
|
-
}, [operate, align, showColumns, posFixed]); // 嵌套表格useCallback
|
|
1477
|
+
}, [operate, align, showColumns, posFixed, fixedColumn]); // 嵌套表格useCallback
|
|
1370
1478
|
|
|
1371
1479
|
var TableExpandableContentUseCallback = useCallback(function (row) {
|
|
1372
1480
|
var id = row[rowKey];
|
|
@@ -1460,7 +1568,7 @@ var TableHead = function TableHead(props) {
|
|
|
1460
1568
|
};
|
|
1461
1569
|
|
|
1462
1570
|
return jsx("div", Object.assign({
|
|
1463
|
-
className: 'table-pagination
|
|
1571
|
+
className: 'table-pagination'
|
|
1464
1572
|
}, {
|
|
1465
1573
|
children: jsx(Pagination, {
|
|
1466
1574
|
type: paginationType,
|
|
@@ -1475,7 +1583,7 @@ var TableHead = function TableHead(props) {
|
|
|
1475
1583
|
}));
|
|
1476
1584
|
};
|
|
1477
1585
|
|
|
1478
|
-
var css_248z$2 = ".
|
|
1586
|
+
var css_248z$2 = ".table-container {\n overflow-x: auto;\n}";
|
|
1479
1587
|
styleInject(css_248z$2);
|
|
1480
1588
|
|
|
1481
1589
|
var TableContainer = function TableContainer(props) {
|
|
@@ -1486,7 +1594,7 @@ var TableContainer = function TableContainer(props) {
|
|
|
1486
1594
|
otherProps = __rest(props, ["cRef", "className", "style", "children"]);
|
|
1487
1595
|
|
|
1488
1596
|
var handClass = function handClass() {
|
|
1489
|
-
var str = '
|
|
1597
|
+
var str = 'table-container';
|
|
1490
1598
|
if (className) str += ' ' + className;
|
|
1491
1599
|
return str;
|
|
1492
1600
|
};
|
|
@@ -1500,19 +1608,19 @@ var TableContainer = function TableContainer(props) {
|
|
|
1500
1608
|
}));
|
|
1501
1609
|
};
|
|
1502
1610
|
|
|
1503
|
-
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.
|
|
1611
|
+
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}";
|
|
1504
1612
|
styleInject(css_248z$1);
|
|
1505
1613
|
|
|
1506
1614
|
var TableElement = function TableElement(props) {
|
|
1507
1615
|
var className = props.className,
|
|
1508
1616
|
style = props.style,
|
|
1509
|
-
|
|
1617
|
+
fixedColumn = props.fixedColumn,
|
|
1510
1618
|
children = props.children,
|
|
1511
|
-
otherProps = __rest(props, ["className", "style", "
|
|
1619
|
+
otherProps = __rest(props, ["className", "style", "fixedColumn", "children"]);
|
|
1512
1620
|
|
|
1513
1621
|
var handClass = function handClass() {
|
|
1514
|
-
var str = '
|
|
1515
|
-
if (
|
|
1622
|
+
var str = 'table-element';
|
|
1623
|
+
if (fixedColumn) str += ' table-element-fixed-column';
|
|
1516
1624
|
if (className) str += ' ' + className;
|
|
1517
1625
|
return str;
|
|
1518
1626
|
};
|
|
@@ -1525,10 +1633,19 @@ var TableElement = function TableElement(props) {
|
|
|
1525
1633
|
}));
|
|
1526
1634
|
};
|
|
1527
1635
|
|
|
1528
|
-
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-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-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 > svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n position: relative;\n top: 5px;\n}\n.paraui-table > .table-contain > table > .table-head .show-colums: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}";
|
|
1636
|
+
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 > .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.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.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-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}";
|
|
1529
1637
|
styleInject(css_248z);
|
|
1530
1638
|
|
|
1531
|
-
var Table = function Table(
|
|
1639
|
+
var Table = function Table(propsInit) {
|
|
1640
|
+
var props = useGlobalProps(propsInit, 'Table'); // 判断浏览器
|
|
1641
|
+
|
|
1642
|
+
var Browser = GetBrowserClass();
|
|
1643
|
+
|
|
1644
|
+
if (Browser === 'ie') {
|
|
1645
|
+
// IE浏览器没有固定列
|
|
1646
|
+
props.fixedColumn = false;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1532
1649
|
var url = props.url,
|
|
1533
1650
|
ctx = props.ctx,
|
|
1534
1651
|
emptyProps = props.emptyProps,
|
|
@@ -1581,6 +1698,8 @@ var Table = function Table(props) {
|
|
|
1581
1698
|
showColumns = _props$showColumns === void 0 ? 'inside' : _props$showColumns,
|
|
1582
1699
|
_props$fixedTable = props.fixedTable,
|
|
1583
1700
|
fixedTable = _props$fixedTable === void 0 ? true : _props$fixedTable,
|
|
1701
|
+
_props$fixedColumn = props.fixedColumn,
|
|
1702
|
+
fixedColumn = _props$fixedColumn === void 0 ? true : _props$fixedColumn,
|
|
1584
1703
|
formatter = props.formatter,
|
|
1585
1704
|
_props$lineHeight = props.lineHeight,
|
|
1586
1705
|
lineHeight = _props$lineHeight === void 0 ? 56 : _props$lineHeight,
|
|
@@ -1604,6 +1723,7 @@ var Table = function Table(props) {
|
|
|
1604
1723
|
_props$beyondText = props.beyondText,
|
|
1605
1724
|
beyondText = _props$beyondText === void 0 ? true : _props$beyondText,
|
|
1606
1725
|
loading = props.loading;
|
|
1726
|
+
var dayNum = props.expirationTime ? props.expirationTime : 7; // 过期天数
|
|
1607
1727
|
|
|
1608
1728
|
var _useState = useState(null),
|
|
1609
1729
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1613,161 +1733,159 @@ var Table = function Table(props) {
|
|
|
1613
1733
|
|
|
1614
1734
|
var _useState3 = useState(null),
|
|
1615
1735
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1616
|
-
|
|
1617
|
-
|
|
1736
|
+
sizeCom = _useState4[0],
|
|
1737
|
+
setSizeCom = _useState4[1]; // 每页条数
|
|
1618
1738
|
|
|
1619
1739
|
|
|
1620
|
-
var _useState5 = useState(
|
|
1740
|
+
var _useState5 = useState(sizeArr),
|
|
1621
1741
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1622
|
-
|
|
1623
|
-
|
|
1742
|
+
sizeArrCom = _useState6[0],
|
|
1743
|
+
setSizeArrCom = _useState6[1]; // 每页条数数组
|
|
1624
1744
|
|
|
1625
1745
|
|
|
1626
|
-
var _useState7 = useState(
|
|
1746
|
+
var _useState7 = useState(0),
|
|
1627
1747
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1628
|
-
|
|
1629
|
-
|
|
1748
|
+
total = _useState8[0],
|
|
1749
|
+
setTotal = _useState8[1]; // 总数
|
|
1630
1750
|
|
|
1631
1751
|
|
|
1632
|
-
var _useState9 = useState(
|
|
1752
|
+
var _useState9 = useState([]),
|
|
1633
1753
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
1634
|
-
|
|
1635
|
-
|
|
1754
|
+
rowData = _useState10[0],
|
|
1755
|
+
setRowData = _useState10[1]; // 当前页数据
|
|
1636
1756
|
|
|
1637
1757
|
|
|
1638
|
-
var _useState11 = useState(
|
|
1758
|
+
var _useState11 = useState({}),
|
|
1639
1759
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
1640
|
-
|
|
1641
|
-
|
|
1760
|
+
rowDataJson = _useState12[0],
|
|
1761
|
+
setRowDataJson = _useState12[1]; // 当前页数据对象
|
|
1642
1762
|
|
|
1643
1763
|
|
|
1644
1764
|
var _useState13 = useState({}),
|
|
1645
1765
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
1646
|
-
|
|
1647
|
-
|
|
1766
|
+
totalDataJson = _useState14[0],
|
|
1767
|
+
setTotalDataJson = _useState14[1]; // 数据总数对象--用来分页记录数据的
|
|
1648
1768
|
|
|
1649
1769
|
|
|
1650
|
-
var _useState15 = useState(
|
|
1770
|
+
var _useState15 = useState([]),
|
|
1651
1771
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
1652
|
-
|
|
1653
|
-
|
|
1772
|
+
orderTypeArr = _useState16[0],
|
|
1773
|
+
setOrderTypeArr = _useState16[1]; // 排序类型
|
|
1654
1774
|
|
|
1655
1775
|
|
|
1656
1776
|
var _useState17 = useState([]),
|
|
1657
1777
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
1658
|
-
|
|
1659
|
-
|
|
1778
|
+
orderFieldArr = _useState18[0],
|
|
1779
|
+
setOrderFieldArr = _useState18[1]; // 排序字段
|
|
1660
1780
|
|
|
1661
1781
|
|
|
1662
|
-
var _useState19 = useState(
|
|
1782
|
+
var _useState19 = useState('not'),
|
|
1663
1783
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
1664
|
-
|
|
1665
|
-
|
|
1784
|
+
headSelectStatus = _useState20[0],
|
|
1785
|
+
setHeadSelectStatus = _useState20[1]; // 表格头复选框状态
|
|
1666
1786
|
|
|
1667
1787
|
|
|
1668
|
-
var _useState21 = useState(
|
|
1788
|
+
var _useState21 = useState({}),
|
|
1669
1789
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
1670
|
-
|
|
1671
|
-
|
|
1790
|
+
checkJson = _useState22[0],
|
|
1791
|
+
setCheckJson = _useState22[1]; // 多选 选中的数据
|
|
1672
1792
|
|
|
1673
1793
|
|
|
1674
|
-
var _useState23 = useState(
|
|
1794
|
+
var _useState23 = useState(),
|
|
1675
1795
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
1676
|
-
|
|
1677
|
-
|
|
1796
|
+
radioValue = _useState24[0],
|
|
1797
|
+
setRadioValue = _useState24[1]; // 单选 选中的数据
|
|
1678
1798
|
|
|
1679
1799
|
|
|
1680
|
-
var _useState25 = useState(),
|
|
1800
|
+
var _useState25 = useState({}),
|
|
1681
1801
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
1682
|
-
|
|
1683
|
-
|
|
1802
|
+
disabledJson = _useState26[0],
|
|
1803
|
+
setDisabledJson = _useState26[1]; // 禁用对象
|
|
1684
1804
|
|
|
1685
1805
|
|
|
1686
1806
|
var _useState27 = useState({}),
|
|
1687
1807
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
1688
|
-
|
|
1689
|
-
|
|
1808
|
+
originalHead = _useState28[0],
|
|
1809
|
+
setOriginalHead = _useState28[1]; // 接口原数据表头json
|
|
1690
1810
|
|
|
1691
1811
|
|
|
1692
|
-
var _useState29 = useState(
|
|
1812
|
+
var _useState29 = useState([]),
|
|
1693
1813
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
1694
|
-
|
|
1695
|
-
|
|
1814
|
+
showHeadList = _useState30[0],
|
|
1815
|
+
setShowHeadList = _useState30[1]; // 显示列下拉值 所有头部的配置
|
|
1696
1816
|
|
|
1697
1817
|
|
|
1698
1818
|
var _useState31 = useState([]),
|
|
1699
1819
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
1700
|
-
|
|
1701
|
-
|
|
1820
|
+
headDataCom = _useState32[0],
|
|
1821
|
+
setHeadDataCom = _useState32[1]; // 表格当前显示列 集合本地数据
|
|
1702
1822
|
|
|
1703
1823
|
|
|
1704
|
-
var _useState33 = useState(
|
|
1824
|
+
var _useState33 = useState({}),
|
|
1705
1825
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
1706
|
-
|
|
1707
|
-
|
|
1826
|
+
selectFilterCom = _useState34[0],
|
|
1827
|
+
setSelectFilterCom = _useState34[1]; // 过滤值
|
|
1708
1828
|
|
|
1709
1829
|
|
|
1710
|
-
var _useState35 = useState(
|
|
1830
|
+
var _useState35 = useState(true),
|
|
1711
1831
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
1712
|
-
|
|
1713
|
-
|
|
1832
|
+
loadState = _useState36[0],
|
|
1833
|
+
setLoadState = _useState36[1]; // 加载进度条状态
|
|
1714
1834
|
|
|
1715
1835
|
|
|
1716
|
-
var _useState37 = useState(
|
|
1836
|
+
var _useState37 = useState(false),
|
|
1717
1837
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
1718
|
-
|
|
1719
|
-
|
|
1838
|
+
loadMoreUrl = _useState38[0],
|
|
1839
|
+
setLoadMoreUrl = _useState38[1];
|
|
1720
1840
|
|
|
1841
|
+
var _useState39 = useState(Math.random().toString()),
|
|
1842
|
+
_useState40 = _slicedToArray(_useState39, 1),
|
|
1843
|
+
reqId = _useState40[0];
|
|
1721
1844
|
|
|
1722
|
-
var
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1845
|
+
var _useState41 = useState(),
|
|
1846
|
+
_useState42 = _slicedToArray(_useState41, 2),
|
|
1847
|
+
refreshCom = _useState42[0],
|
|
1848
|
+
setRefreshCom = _useState42[1];
|
|
1726
1849
|
|
|
1727
|
-
var
|
|
1728
|
-
_useState42 = _slicedToArray(_useState41, 1),
|
|
1729
|
-
reqId = _useState42[0];
|
|
1730
|
-
|
|
1731
|
-
var _useState43 = useState(),
|
|
1850
|
+
var _useState43 = useState(0),
|
|
1732
1851
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
var _useState45 = useState(0),
|
|
1737
|
-
_useState46 = _slicedToArray(_useState45, 2),
|
|
1738
|
-
tableMinWidth = _useState46[0],
|
|
1739
|
-
setTableMinWidth = _useState46[1]; // 表格最小width
|
|
1852
|
+
tableMinWidth = _useState44[0],
|
|
1853
|
+
setTableMinWidth = _useState44[1]; // 表格最小width
|
|
1740
1854
|
|
|
1741
1855
|
|
|
1742
|
-
var
|
|
1743
|
-
|
|
1744
|
-
posFixed =
|
|
1745
|
-
setPosFixed =
|
|
1856
|
+
var _useState45 = useState({}),
|
|
1857
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
1858
|
+
posFixed = _useState46[0],
|
|
1859
|
+
setPosFixed = _useState46[1];
|
|
1746
1860
|
|
|
1747
1861
|
var containerRef = useRef(); // 表格内容高度
|
|
1748
1862
|
|
|
1749
1863
|
var tableRef = useRef(); // 表格
|
|
1750
1864
|
|
|
1751
|
-
var
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1865
|
+
var constData = useRef({
|
|
1866
|
+
page: props.page !== undefined ? props.page : 1
|
|
1867
|
+
}); // 存储常量
|
|
1755
1868
|
|
|
1756
|
-
constData.loadMoreUrl = loadMore && url; // 用来判断加载更多请求是否放在表格里面
|
|
1869
|
+
constData.current.loadMoreUrl = loadMore && url; // 用来判断加载更多请求是否放在表格里面
|
|
1757
1870
|
|
|
1871
|
+
constData.current.search = search;
|
|
1872
|
+
constData.current.url = url;
|
|
1873
|
+
constData.current.orderTypeArr = orderTypeArr;
|
|
1874
|
+
constData.current.orderFieldArr = orderFieldArr;
|
|
1875
|
+
constData.current.selectFilterCom = selectFilterCom;
|
|
1876
|
+
constData.current.data = data;
|
|
1758
1877
|
useEffect(function () {
|
|
1759
1878
|
window.addEventListener('resize', changeResize);
|
|
1760
1879
|
return function () {
|
|
1761
|
-
clearTimeout(constData.reqTimer);
|
|
1762
|
-
clearTimeout(constData.loadingTimer);
|
|
1763
|
-
clearTimeout(constData.reqLoadingTimer);
|
|
1880
|
+
clearTimeout(constData.current.reqTimer);
|
|
1881
|
+
clearTimeout(constData.current.loadingTimer);
|
|
1764
1882
|
window.removeEventListener('resize', changeResize);
|
|
1765
1883
|
};
|
|
1766
1884
|
}, []);
|
|
1767
1885
|
useEffect(function () {
|
|
1768
1886
|
if (loading !== undefined) {
|
|
1769
|
-
clearTimeout(constData.loadingTimer);
|
|
1770
|
-
constData.loadingTimer = setTimeout(function () {
|
|
1887
|
+
clearTimeout(constData.current.loadingTimer);
|
|
1888
|
+
constData.current.loadingTimer = setTimeout(function () {
|
|
1771
1889
|
setLoadState(loading);
|
|
1772
1890
|
}, 50);
|
|
1773
1891
|
}
|
|
@@ -1777,18 +1895,16 @@ var Table = function Table(props) {
|
|
|
1777
1895
|
}, [loadMore, url]); // 监听page
|
|
1778
1896
|
|
|
1779
1897
|
useEffect(function () {
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
setPagePagination(pageCom);
|
|
1785
|
-
}, [pageCom]); // 自动计算表格一页展示条数
|
|
1898
|
+
if (props.page !== undefined) {
|
|
1899
|
+
handPage(props.page);
|
|
1900
|
+
}
|
|
1901
|
+
}, [page]); // 自动计算表格一页展示条数
|
|
1786
1902
|
|
|
1787
1903
|
useEffect(function () {
|
|
1788
|
-
if (!autoSize) return
|
|
1904
|
+
if (!autoSize) return handSize(size);
|
|
1789
1905
|
|
|
1790
1906
|
if (props.size) {
|
|
1791
|
-
|
|
1907
|
+
handSize(size);
|
|
1792
1908
|
} else {
|
|
1793
1909
|
if (containerRef && containerRef.current) {
|
|
1794
1910
|
var height = containerRef.current.clientHeight - 50;
|
|
@@ -1805,37 +1921,14 @@ var Table = function Table(props) {
|
|
|
1805
1921
|
setSizeArrCom(sizeArr);
|
|
1806
1922
|
}
|
|
1807
1923
|
|
|
1808
|
-
|
|
1924
|
+
handSize(columnsNUmber);
|
|
1809
1925
|
}
|
|
1810
1926
|
}
|
|
1811
1927
|
}, [size, autoSize]); // 处理表格头部
|
|
1812
1928
|
|
|
1813
1929
|
useEffect(function () {
|
|
1814
1930
|
if (props.headData !== undefined) {
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
var headArr = []; // 显示列列表
|
|
1818
|
-
|
|
1819
|
-
var json = {};
|
|
1820
|
-
|
|
1821
|
-
for (var i = 0, l = headData.length; i < l; i++) {
|
|
1822
|
-
var item = headData[i];
|
|
1823
|
-
if (typeof item.width === 'number') item.width += 'px';
|
|
1824
|
-
item.orderNum = i;
|
|
1825
|
-
if (showColumns === false) item.selected = true; // 如果不显示选择列,全部显示
|
|
1826
|
-
|
|
1827
|
-
if (item.selected) {
|
|
1828
|
-
headShowArr.push(item);
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
headArr.push(item);
|
|
1832
|
-
json[item.name] = item;
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
handHeadDataCom(headShowArr);
|
|
1836
|
-
setHeadDataCom(headShowArr);
|
|
1837
|
-
setShowHeadList(headArr);
|
|
1838
|
-
constData.headDataJson = json;
|
|
1931
|
+
handInitHead(headData, false);
|
|
1839
1932
|
}
|
|
1840
1933
|
}, [headData]); // 设置总数对象
|
|
1841
1934
|
|
|
@@ -1843,28 +1936,31 @@ var Table = function Table(props) {
|
|
|
1843
1936
|
if (data) {
|
|
1844
1937
|
var handTotalDataJson = ArrayToObject(rowKey, data);
|
|
1845
1938
|
setTotalDataJson(handTotalDataJson);
|
|
1939
|
+
constData.current.data = data;
|
|
1940
|
+
setRefreshCom(Math.random());
|
|
1846
1941
|
}
|
|
1847
1942
|
}, [data]);
|
|
1848
1943
|
useEffect(function () {
|
|
1849
1944
|
// 第一次初始化不设置
|
|
1850
|
-
if (!constData.initReq) return;
|
|
1851
|
-
|
|
1852
|
-
constData.historyData = [];
|
|
1945
|
+
if (!constData.current.initReq) return;
|
|
1946
|
+
handPage(1);
|
|
1947
|
+
constData.current.historyData = [];
|
|
1853
1948
|
}, [search, url]); // 表格数据获取赋值
|
|
1854
1949
|
|
|
1855
1950
|
useEffect(function () {
|
|
1856
|
-
clearTimeout(constData.reqTimer);
|
|
1857
|
-
constData.
|
|
1858
|
-
|
|
1951
|
+
clearTimeout(constData.current.reqTimer);
|
|
1952
|
+
if (constData.current.url) Cancel(reqId);
|
|
1953
|
+
constData.current.reqTimer = setTimeout(function () {
|
|
1954
|
+
constData.current.initReq = true;
|
|
1859
1955
|
|
|
1860
|
-
if (url) {
|
|
1956
|
+
if (constData.current.url) {
|
|
1861
1957
|
// 提交参数
|
|
1862
1958
|
var postBody = {};
|
|
1863
1959
|
|
|
1864
1960
|
if (pagination) {
|
|
1865
|
-
if (
|
|
1866
|
-
postBody.size =
|
|
1867
|
-
postBody.page =
|
|
1961
|
+
if (constData.current.page === null || constData.current.size === null) return;
|
|
1962
|
+
postBody.size = constData.current.size;
|
|
1963
|
+
postBody.page = constData.current.page;
|
|
1868
1964
|
}
|
|
1869
1965
|
|
|
1870
1966
|
if (orderFieldArr.length > 0) {
|
|
@@ -1881,14 +1977,14 @@ var Table = function Table(props) {
|
|
|
1881
1977
|
postBody.filter = handFilterReq();
|
|
1882
1978
|
}
|
|
1883
1979
|
|
|
1884
|
-
if (search) {
|
|
1885
|
-
if (_typeof(search) === 'object') {
|
|
1886
|
-
postBody = Object.assign(Object.assign({}, postBody), search);
|
|
1980
|
+
if (constData.current.search) {
|
|
1981
|
+
if (_typeof(constData.current.search) === 'object') {
|
|
1982
|
+
postBody = Object.assign(Object.assign({}, postBody), constData.current.search);
|
|
1887
1983
|
}
|
|
1888
1984
|
}
|
|
1889
1985
|
|
|
1890
1986
|
var obj = {
|
|
1891
|
-
url: url,
|
|
1987
|
+
url: constData.current.url,
|
|
1892
1988
|
ctx: ctx,
|
|
1893
1989
|
method: method,
|
|
1894
1990
|
data: postBody
|
|
@@ -1922,19 +2018,19 @@ var Table = function Table(props) {
|
|
|
1922
2018
|
}
|
|
1923
2019
|
}
|
|
1924
2020
|
|
|
1925
|
-
if (data) {
|
|
2021
|
+
if (constData.current.data) {
|
|
1926
2022
|
var dataT = [];
|
|
1927
2023
|
|
|
1928
|
-
if (data instanceof Array) {
|
|
1929
|
-
dataT = data;
|
|
2024
|
+
if (constData.current.data instanceof Array) {
|
|
2025
|
+
dataT = constData.current.data;
|
|
1930
2026
|
} else {
|
|
1931
|
-
dataT = data.list;
|
|
2027
|
+
dataT = constData.current.data.list;
|
|
1932
2028
|
}
|
|
1933
2029
|
|
|
1934
2030
|
if (pagination) {
|
|
1935
|
-
if (
|
|
2031
|
+
if (constData.current.page === null || constData.current.size === null) return; // 分页
|
|
1936
2032
|
|
|
1937
|
-
var sliceData = dataT.slice((
|
|
2033
|
+
var sliceData = dataT.slice((constData.current.page - 1) * constData.current.size, (constData.current.page - 1) * constData.current.size + constData.current.size);
|
|
1938
2034
|
setNowPageData(sliceData);
|
|
1939
2035
|
setTotal(dataT.length);
|
|
1940
2036
|
} else {
|
|
@@ -1945,7 +2041,7 @@ var Table = function Table(props) {
|
|
|
1945
2041
|
if (props.loading === undefined) setLoadState(false);
|
|
1946
2042
|
}
|
|
1947
2043
|
}, 50);
|
|
1948
|
-
}, [
|
|
2044
|
+
}, [refresh, refreshCom]); // 单选赋值默认值
|
|
1949
2045
|
|
|
1950
2046
|
useEffect(function () {
|
|
1951
2047
|
if (radioDefaultValue !== undefined && radioDefaultValue !== radioValue) {
|
|
@@ -2026,7 +2122,139 @@ var Table = function Table(props) {
|
|
|
2026
2122
|
tableBoxScroll({
|
|
2027
2123
|
target: containerRef.current
|
|
2028
2124
|
});
|
|
2029
|
-
});
|
|
2125
|
+
});
|
|
2126
|
+
/** 设置size */
|
|
2127
|
+
|
|
2128
|
+
var handSize = function handSize(num) {
|
|
2129
|
+
constData.current.size = num;
|
|
2130
|
+
setSizeCom(num);
|
|
2131
|
+
setRefreshCom(Math.random());
|
|
2132
|
+
};
|
|
2133
|
+
/** 本地显示列key */
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
var getTableHeadKey = function getTableHeadKey() {
|
|
2137
|
+
// 自定义key
|
|
2138
|
+
if (props.tableKey) {
|
|
2139
|
+
return props.tableKey;
|
|
2140
|
+
} // 本地数据
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
if (props.data) {
|
|
2144
|
+
return window.location.origin + window.location.pathname + window.location.hash;
|
|
2145
|
+
} // url
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
if (props.url) {
|
|
2149
|
+
return props.url + '_' + (props.method || 'Get');
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
return '';
|
|
2153
|
+
};
|
|
2154
|
+
/** 获取储存的表头列 */
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
var getLocalStorageHeadCom = function getLocalStorageHeadCom() {
|
|
2158
|
+
if (props.rememberColumns === false) return {};
|
|
2159
|
+
var json = getLocalStorageSelectHead(getTableHeadKey(), dayNum);
|
|
2160
|
+
return json;
|
|
2161
|
+
};
|
|
2162
|
+
/** 设置本地表格列 */
|
|
2163
|
+
|
|
2164
|
+
|
|
2165
|
+
var setLocalStorageHeadCom = function setLocalStorageHeadCom(headArr) {
|
|
2166
|
+
if (props.rememberColumns === false) return;
|
|
2167
|
+
var selectHeadJson = ArrayToObject('name', headArr);
|
|
2168
|
+
var json = {
|
|
2169
|
+
headName: {},
|
|
2170
|
+
storageTime: new Date().getTime(),
|
|
2171
|
+
validity: dayNum * (60 * 60 * 24)
|
|
2172
|
+
};
|
|
2173
|
+
|
|
2174
|
+
for (var i = 0, l = showHeadList.length; i < l; i++) {
|
|
2175
|
+
var item = showHeadList[i];
|
|
2176
|
+
var name = item.name || '';
|
|
2177
|
+
json.headName[name] = false;
|
|
2178
|
+
|
|
2179
|
+
if (selectHeadJson[name]) {
|
|
2180
|
+
json.headName[name] = true;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
setLocalStorageSelectHead(getTableHeadKey(), json);
|
|
2185
|
+
};
|
|
2186
|
+
/**
|
|
2187
|
+
* 处理表格列是否显示
|
|
2188
|
+
* @param item {HeadDataProps} 当前列
|
|
2189
|
+
* @param showHeadArr {HeadDataProps[]} 显示列与本地数据集合
|
|
2190
|
+
* @param localHead {HeadLocalStorageItem} 本地显示列数据
|
|
2191
|
+
* */
|
|
2192
|
+
|
|
2193
|
+
|
|
2194
|
+
var handHeadShow = function handHeadShow(item, showHeadArr, localHead) {
|
|
2195
|
+
if (showColumns === false) {
|
|
2196
|
+
// 如果不显示选择列,全部显示
|
|
2197
|
+
showHeadArr.push(item);
|
|
2198
|
+
return;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
if (props.rememberColumns === false) {
|
|
2202
|
+
// 不记住列
|
|
2203
|
+
if (item.selected) showHeadArr.push(item);
|
|
2204
|
+
} else {
|
|
2205
|
+
// 记住列
|
|
2206
|
+
var nameSelectJson = localHead.headName || {};
|
|
2207
|
+
var name = item.name || '';
|
|
2208
|
+
var nameSelect = nameSelectJson[name];
|
|
2209
|
+
|
|
2210
|
+
if (nameSelect !== undefined) {
|
|
2211
|
+
// 存在本地选择列里面,选中添加到显示列
|
|
2212
|
+
if (nameSelect) showHeadArr.push(item);
|
|
2213
|
+
} else {
|
|
2214
|
+
// 不存在本地选择列里面,当前选中,则添加进去
|
|
2215
|
+
if (item.selected) showHeadArr.push(item);
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
};
|
|
2219
|
+
/**
|
|
2220
|
+
* 初始化设置表头
|
|
2221
|
+
* @param arr {(HeadDataProps | HeadDataReqProps)[]} 表头数据
|
|
2222
|
+
* @param bol {boolean} true请求表头
|
|
2223
|
+
* */
|
|
2224
|
+
|
|
2225
|
+
|
|
2226
|
+
var handInitHead = function handInitHead(arr, bol) {
|
|
2227
|
+
var headShowArr = []; // 表格显示列
|
|
2228
|
+
|
|
2229
|
+
var headArr = []; // 显示列列表
|
|
2230
|
+
|
|
2231
|
+
var json = {};
|
|
2232
|
+
var localHead = getLocalStorageHeadCom();
|
|
2233
|
+
|
|
2234
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
2235
|
+
var item = arr[i];
|
|
2236
|
+
if (typeof item.width === 'number') item.width += 'px';
|
|
2237
|
+
if (!bol) item.orderNum = i;
|
|
2238
|
+
handHeadShow(item, headShowArr, localHead);
|
|
2239
|
+
headArr.push(item);
|
|
2240
|
+
json[item.name] = item;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
if (bol) {
|
|
2244
|
+
headShowArr.sort(function (a, b) {
|
|
2245
|
+
return Number(a.orderNum) - Number(b.orderNum);
|
|
2246
|
+
});
|
|
2247
|
+
headArr.sort(function (a, b) {
|
|
2248
|
+
return Number(a.orderNum) - Number(b.orderNum);
|
|
2249
|
+
});
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
handHeadDataCom(headShowArr);
|
|
2253
|
+
setHeadDataCom(headShowArr);
|
|
2254
|
+
setShowHeadList(headArr);
|
|
2255
|
+
constData.current.headDataJson = json;
|
|
2256
|
+
}; // 计算左边的差量
|
|
2257
|
+
|
|
2030
2258
|
|
|
2031
2259
|
var handLeftWidth = function handLeftWidth() {
|
|
2032
2260
|
var leftNum = 0; // 复选
|
|
@@ -2180,7 +2408,7 @@ var Table = function Table(props) {
|
|
|
2180
2408
|
var handFilterReq = function handFilterReq() {
|
|
2181
2409
|
var json = {};
|
|
2182
2410
|
var arr = Object.keys(selectFilterCom);
|
|
2183
|
-
var headDataJson = constData.headDataJson || {};
|
|
2411
|
+
var headDataJson = constData.current.headDataJson || {};
|
|
2184
2412
|
|
|
2185
2413
|
for (var i = 0, l = arr.length; i < l; i++) {
|
|
2186
2414
|
var name = arr[i];
|
|
@@ -2210,23 +2438,18 @@ var Table = function Table(props) {
|
|
|
2210
2438
|
while (1) {
|
|
2211
2439
|
switch (_context.prev = _context.next) {
|
|
2212
2440
|
case 0:
|
|
2213
|
-
Cancel(reqId); // 因为cancel掉以后,上一个接口err回来会取消loading,用setTimeout把事件推迟
|
|
2214
|
-
|
|
2215
|
-
clearTimeout(constData.reqLoadingTimer);
|
|
2216
|
-
constData.reqLoadingTimer = setTimeout(function () {
|
|
2217
|
-
if (props.loading === undefined) setLoadState(true);
|
|
2218
|
-
});
|
|
2219
2441
|
obj.uuid = reqId;
|
|
2220
|
-
|
|
2442
|
+
if (props.loading === undefined) setLoadState(true);
|
|
2443
|
+
_context.next = 4;
|
|
2221
2444
|
return requestFunc(obj);
|
|
2222
2445
|
|
|
2223
|
-
case
|
|
2446
|
+
case 4:
|
|
2224
2447
|
_yield$requestFunc = _context.sent;
|
|
2225
2448
|
data = _yield$requestFunc.data;
|
|
2226
2449
|
err = _yield$requestFunc.err;
|
|
2227
2450
|
|
|
2228
2451
|
if (!err) {
|
|
2229
|
-
_context.next =
|
|
2452
|
+
_context.next = 11;
|
|
2230
2453
|
break;
|
|
2231
2454
|
}
|
|
2232
2455
|
|
|
@@ -2240,7 +2463,7 @@ var Table = function Table(props) {
|
|
|
2240
2463
|
|
|
2241
2464
|
return _context.abrupt("return", false);
|
|
2242
2465
|
|
|
2243
|
-
case
|
|
2466
|
+
case 11:
|
|
2244
2467
|
if (requestCallback) {
|
|
2245
2468
|
requestCallback(data, function (handData) {
|
|
2246
2469
|
if (handData) {
|
|
@@ -2255,7 +2478,7 @@ var Table = function Table(props) {
|
|
|
2255
2478
|
if (props.loading === undefined) setLoadState(false);
|
|
2256
2479
|
}
|
|
2257
2480
|
|
|
2258
|
-
case
|
|
2481
|
+
case 12:
|
|
2259
2482
|
case "end":
|
|
2260
2483
|
return _context.stop();
|
|
2261
2484
|
}
|
|
@@ -2276,41 +2499,22 @@ var Table = function Table(props) {
|
|
|
2276
2499
|
if (str !== JSON.stringify(originalHead)) {
|
|
2277
2500
|
setOriginalHead(data.columns);
|
|
2278
2501
|
var arr = Object.keys(data.columns);
|
|
2279
|
-
var
|
|
2280
|
-
|
|
2281
|
-
var headArr = []; // 显示列列表
|
|
2282
|
-
|
|
2283
|
-
var json = {};
|
|
2502
|
+
var headDataArr = []; // 表头数据
|
|
2284
2503
|
|
|
2285
2504
|
for (var i = 0, l = arr.length; i < l; i++) {
|
|
2286
2505
|
var key = arr[i];
|
|
2287
2506
|
var item = data.columns[key];
|
|
2288
|
-
item.label = item.displayName;
|
|
2289
2507
|
item.name = key;
|
|
2508
|
+
item.label = item.displayName;
|
|
2290
2509
|
item.filter = item.filterFlag;
|
|
2291
2510
|
item.filterRadio = item.filterRadioFlag;
|
|
2292
2511
|
item.sort = item.orderFlag;
|
|
2293
2512
|
item.selected = item.selectedFlag;
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
// 当前显示字段
|
|
2297
|
-
headShowArr.push(item);
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
headArr.push(item);
|
|
2301
|
-
json[item.name] = item;
|
|
2513
|
+
item.width = item.width;
|
|
2514
|
+
headDataArr.push(item);
|
|
2302
2515
|
}
|
|
2303
2516
|
|
|
2304
|
-
|
|
2305
|
-
return a.orderNum - b.orderNum;
|
|
2306
|
-
});
|
|
2307
|
-
headArr.sort(function (a, b) {
|
|
2308
|
-
return a.orderNum - b.orderNum;
|
|
2309
|
-
});
|
|
2310
|
-
handHeadDataCom(headShowArr);
|
|
2311
|
-
setHeadDataCom(headShowArr);
|
|
2312
|
-
setShowHeadList(headArr);
|
|
2313
|
-
constData.headDataJson = json;
|
|
2517
|
+
handInitHead(headDataArr, true);
|
|
2314
2518
|
}
|
|
2315
2519
|
}
|
|
2316
2520
|
|
|
@@ -2318,7 +2522,11 @@ var Table = function Table(props) {
|
|
|
2318
2522
|
// 分页 data是对象
|
|
2319
2523
|
setNowPageData(data.list || []);
|
|
2320
2524
|
setTotal(data.total);
|
|
2321
|
-
|
|
2525
|
+
|
|
2526
|
+
if (data.page !== undefined && data.page !== null) {
|
|
2527
|
+
constData.current.page = Number(data.page);
|
|
2528
|
+
setPageCom(Number(data.page));
|
|
2529
|
+
}
|
|
2322
2530
|
} else {
|
|
2323
2531
|
var handData1 = [];
|
|
2324
2532
|
|
|
@@ -2339,8 +2547,8 @@ var Table = function Table(props) {
|
|
|
2339
2547
|
|
|
2340
2548
|
var setNowPageData = function setNowPageData(nowPageData) {
|
|
2341
2549
|
// 加载更多请求放在里面
|
|
2342
|
-
if (constData.loadMoreUrl) {
|
|
2343
|
-
var historyData = constData.historyData || [];
|
|
2550
|
+
if (constData.current.loadMoreUrl) {
|
|
2551
|
+
var historyData = constData.current.historyData || [];
|
|
2344
2552
|
|
|
2345
2553
|
if (historyData.length > 0) {
|
|
2346
2554
|
nowPageData = [].concat(_toConsumableArray(historyData), _toConsumableArray(nowPageData));
|
|
@@ -2348,7 +2556,7 @@ var Table = function Table(props) {
|
|
|
2348
2556
|
}
|
|
2349
2557
|
|
|
2350
2558
|
var handDataJson = ArrayToObject(rowKey, nowPageData);
|
|
2351
|
-
constData.historyData = nowPageData;
|
|
2559
|
+
constData.current.historyData = nowPageData;
|
|
2352
2560
|
setRowDataJson(handDataJson);
|
|
2353
2561
|
setRowData(nowPageData); // 设置总数对象
|
|
2354
2562
|
|
|
@@ -2356,6 +2564,16 @@ var Table = function Table(props) {
|
|
|
2356
2564
|
setTotalDataJson(Object.assign(Object.assign({}, totalDataJson), handDataJson));
|
|
2357
2565
|
}
|
|
2358
2566
|
};
|
|
2567
|
+
/**
|
|
2568
|
+
* 处理page
|
|
2569
|
+
* */
|
|
2570
|
+
|
|
2571
|
+
|
|
2572
|
+
var handPage = function handPage(num) {
|
|
2573
|
+
constData.current.page = num;
|
|
2574
|
+
setPageCom(num);
|
|
2575
|
+
setRefreshCom(Math.random());
|
|
2576
|
+
};
|
|
2359
2577
|
/**
|
|
2360
2578
|
* 改变页数
|
|
2361
2579
|
* @param num {number | undefined} 页数
|
|
@@ -2363,7 +2581,7 @@ var Table = function Table(props) {
|
|
|
2363
2581
|
|
|
2364
2582
|
|
|
2365
2583
|
var changePage = function changePage(num) {
|
|
2366
|
-
if (num !== undefined)
|
|
2584
|
+
if (num !== undefined) handPage(num);
|
|
2367
2585
|
clearCheckValue();
|
|
2368
2586
|
};
|
|
2369
2587
|
/**
|
|
@@ -2373,8 +2591,17 @@ var Table = function Table(props) {
|
|
|
2373
2591
|
|
|
2374
2592
|
|
|
2375
2593
|
var changeRowsPerPage = function changeRowsPerPage(num) {
|
|
2376
|
-
if (num !== undefined)
|
|
2377
|
-
|
|
2594
|
+
if (num !== undefined) handSize(num);
|
|
2595
|
+
handPage(1);
|
|
2596
|
+
};
|
|
2597
|
+
/**
|
|
2598
|
+
* 加载更多,点击改变分页
|
|
2599
|
+
*/
|
|
2600
|
+
|
|
2601
|
+
|
|
2602
|
+
var changePageMore = function changePageMore() {
|
|
2603
|
+
var pageHnad = Number(pageCom) + 1;
|
|
2604
|
+
handPage(pageHnad);
|
|
2378
2605
|
};
|
|
2379
2606
|
/**
|
|
2380
2607
|
* 排序
|
|
@@ -2425,6 +2652,9 @@ var Table = function Table(props) {
|
|
|
2425
2652
|
|
|
2426
2653
|
setOrderFieldArr(orderFieldArrHand);
|
|
2427
2654
|
setOrderTypeArr(orderTypeArrHand);
|
|
2655
|
+
constData.current.orderFieldArr = orderFieldArrHand;
|
|
2656
|
+
constData.current.orderTypeArr = orderTypeArrHand;
|
|
2657
|
+
setRefreshCom(Math.random());
|
|
2428
2658
|
};
|
|
2429
2659
|
/**
|
|
2430
2660
|
* 处理复选框往外抛值
|
|
@@ -2510,6 +2740,15 @@ var Table = function Table(props) {
|
|
|
2510
2740
|
handCheckValue({});
|
|
2511
2741
|
}
|
|
2512
2742
|
};
|
|
2743
|
+
/** 改变选择列 */
|
|
2744
|
+
|
|
2745
|
+
|
|
2746
|
+
var changeSelectHead = function changeSelectHead(arr, item) {
|
|
2747
|
+
handHeadDataCom(arr);
|
|
2748
|
+
setHeadDataCom(arr);
|
|
2749
|
+
setLocalStorageHeadCom(arr);
|
|
2750
|
+
onClickColumns && onClickColumns(arr, item);
|
|
2751
|
+
};
|
|
2513
2752
|
/**
|
|
2514
2753
|
* 改变显示列 bol true重置
|
|
2515
2754
|
* @param headShowArr 当前显示列
|
|
@@ -2531,21 +2770,17 @@ var Table = function Table(props) {
|
|
|
2531
2770
|
}
|
|
2532
2771
|
}
|
|
2533
2772
|
|
|
2534
|
-
|
|
2535
|
-
setHeadDataCom(arr);
|
|
2536
|
-
onClickColumns && onClickColumns(arr, item);
|
|
2773
|
+
changeSelectHead(arr, item);
|
|
2537
2774
|
return;
|
|
2538
2775
|
}
|
|
2539
2776
|
|
|
2540
2777
|
headShowArr.sort(function (a, b) {
|
|
2541
|
-
return a.orderNum - b.orderNum;
|
|
2778
|
+
return Number(a.orderNum) - Number(b.orderNum);
|
|
2542
2779
|
});
|
|
2543
2780
|
|
|
2544
2781
|
var headShowArrHand = _toConsumableArray(headShowArr);
|
|
2545
2782
|
|
|
2546
|
-
|
|
2547
|
-
setHeadDataCom(headShowArrHand);
|
|
2548
|
-
onClickColumns && onClickColumns(headShowArrHand, item);
|
|
2783
|
+
changeSelectHead(headShowArrHand, item);
|
|
2549
2784
|
};
|
|
2550
2785
|
/**
|
|
2551
2786
|
* 改变过滤
|
|
@@ -2553,16 +2788,9 @@ var Table = function Table(props) {
|
|
|
2553
2788
|
|
|
2554
2789
|
|
|
2555
2790
|
var changeFilter = function changeFilter(val) {
|
|
2791
|
+
constData.current.selectFilterCom = DeepClone(val);
|
|
2556
2792
|
setSelectFilterCom(DeepClone(val));
|
|
2557
|
-
|
|
2558
|
-
/**
|
|
2559
|
-
* 加载更多,点击改变分页
|
|
2560
|
-
*/
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
var changePageMore = function changePageMore() {
|
|
2564
|
-
var pageHnad = Number(pageCom) + 1;
|
|
2565
|
-
setPageCom(pageHnad);
|
|
2793
|
+
handPage(1);
|
|
2566
2794
|
}; // 表格头部memo
|
|
2567
2795
|
|
|
2568
2796
|
|
|
@@ -2588,10 +2816,11 @@ var Table = function Table(props) {
|
|
|
2588
2816
|
showColumns: showColumns,
|
|
2589
2817
|
rowKey: rowKey,
|
|
2590
2818
|
fixedTable: fixedTable,
|
|
2819
|
+
fixedColumn: fixedColumn,
|
|
2591
2820
|
posFixed: posFixed,
|
|
2592
2821
|
beyondText: beyondText
|
|
2593
2822
|
});
|
|
2594
|
-
}, [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
|
|
2823
|
+
}, [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
|
|
2595
2824
|
|
|
2596
2825
|
var TableBodyMemo = useMemo(function () {
|
|
2597
2826
|
return jsx(TableBody, {
|
|
@@ -2635,57 +2864,60 @@ var Table = function Table(props) {
|
|
|
2635
2864
|
return setRefreshCom(Math.random());
|
|
2636
2865
|
},
|
|
2637
2866
|
posFixed: posFixed,
|
|
2638
|
-
beyondText: beyondText
|
|
2867
|
+
beyondText: beyondText,
|
|
2868
|
+
fixedColumn: fixedColumn,
|
|
2869
|
+
fixedTable: fixedTable
|
|
2639
2870
|
});
|
|
2640
|
-
}, [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
|
|
2871
|
+
}, [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
|
|
2641
2872
|
|
|
2642
2873
|
var TablePaginationMemo = useMemo(function () {
|
|
2643
|
-
if (
|
|
2874
|
+
if (constData.current.page === null || constData.current.size === null || loadMore) return;
|
|
2644
2875
|
return pagination && jsx(TableHead, {
|
|
2645
2876
|
paginationType: paginationType,
|
|
2646
2877
|
autoPagination: autoPagination,
|
|
2647
2878
|
total: total,
|
|
2648
|
-
page:
|
|
2879
|
+
page: pageCom,
|
|
2649
2880
|
currentRowsPerPage: sizeCom,
|
|
2650
2881
|
rowsPerPage: sizeArrCom,
|
|
2651
2882
|
changePage: changePage,
|
|
2652
2883
|
changeRowsPerPage: changeRowsPerPage
|
|
2653
2884
|
});
|
|
2654
|
-
}, [total,
|
|
2885
|
+
}, [total, pageCom, sizeCom, sizeArrCom, pagination, loadMore, autoPagination, paginationType]); // 表格内容滚动
|
|
2655
2886
|
|
|
2656
2887
|
var tableBoxScroll = function tableBoxScroll(e) {
|
|
2657
2888
|
var dom = tableRef.current;
|
|
2658
2889
|
var scrollDom = e.target;
|
|
2659
2890
|
if (!dom || !scrollDom) return;
|
|
2660
|
-
dom.classList.remove('
|
|
2891
|
+
dom.classList.remove('table-scroll-left', 'table-scroll-right', 'table-scroll-middle');
|
|
2661
2892
|
if (scrollDom.scrollWidth <= scrollDom.clientWidth) return; // 最左边
|
|
2662
2893
|
|
|
2663
2894
|
if (scrollDom.scrollLeft === 0) {
|
|
2664
|
-
dom.classList.add('
|
|
2895
|
+
dom.classList.add('table-scroll-left');
|
|
2665
2896
|
return;
|
|
2666
2897
|
} // 最右边
|
|
2667
2898
|
|
|
2668
2899
|
|
|
2669
2900
|
if (scrollDom.scrollLeft + scrollDom.clientWidth === scrollDom.scrollWidth) {
|
|
2670
|
-
dom.classList.add('
|
|
2901
|
+
dom.classList.add('table-scroll-right');
|
|
2671
2902
|
return;
|
|
2672
2903
|
}
|
|
2673
2904
|
|
|
2674
|
-
dom.classList.add('
|
|
2905
|
+
dom.classList.add('table-scroll-middle');
|
|
2675
2906
|
}; // 处理class
|
|
2676
2907
|
|
|
2677
2908
|
|
|
2678
2909
|
var handClass = function handClass() {
|
|
2679
|
-
var str = '
|
|
2680
|
-
if (showColumns === 'inside') str +=
|
|
2681
|
-
if (pagination) str +=
|
|
2682
|
-
if (loadMore) str +=
|
|
2683
|
-
if (fixedTable) str +=
|
|
2684
|
-
if (
|
|
2685
|
-
if (
|
|
2686
|
-
if (
|
|
2687
|
-
if (
|
|
2688
|
-
if (
|
|
2910
|
+
var str = $prefixCls + '-table';
|
|
2911
|
+
if (showColumns === 'inside') str += " ".concat($prefixCls, "-table-columns-inside");
|
|
2912
|
+
if (pagination) str += " ".concat($prefixCls, "-table-pagination");
|
|
2913
|
+
if (loadMore) str += " ".concat($prefixCls, "-table-load-more");
|
|
2914
|
+
if (fixedTable) str += " ".concat($prefixCls, "-table-fixed-table");
|
|
2915
|
+
if (fixedColumn) str += " ".concat($prefixCls, "-table-fixed-cloumn");
|
|
2916
|
+
if (check) str += " ".concat($prefixCls, "-table-check");
|
|
2917
|
+
if (radio) str += " ".concat($prefixCls, "-table-radio");
|
|
2918
|
+
if (expandable) str += " ".concat($prefixCls, "-table-expandable");
|
|
2919
|
+
if (rowData.length === 0) str += " ".concat($prefixCls, "-table-no-data");
|
|
2920
|
+
if (loadState) str += " ".concat($prefixCls, "-table-load");
|
|
2689
2921
|
if (className) str += ' ' + className;
|
|
2690
2922
|
return str;
|
|
2691
2923
|
}; // 改变屏幕大小
|
|
@@ -2708,11 +2940,8 @@ var Table = function Table(props) {
|
|
|
2708
2940
|
onScroll: tableBoxScroll
|
|
2709
2941
|
}, {
|
|
2710
2942
|
children: [jsxs(TableElement, Object.assign({
|
|
2711
|
-
|
|
2712
|
-
style:
|
|
2713
|
-
tableLayout: 'fixed',
|
|
2714
|
-
minWidth: tableMinWidth + 'px'
|
|
2715
|
-
} : {
|
|
2943
|
+
fixedColumn: fixedColumn,
|
|
2944
|
+
style: {
|
|
2716
2945
|
minWidth: tableMinWidth + 'px'
|
|
2717
2946
|
}
|
|
2718
2947
|
}, {
|