th-design 1.0.0

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.
@@ -0,0 +1,131 @@
1
+ /// <reference types="react" />
2
+ import type { TableProps } from 'antd';
3
+ export interface ThSelectProps {
4
+ /**
5
+ * 选择模式
6
+ * @default "multiple"
7
+ */
8
+ mode?: 'single' | 'multiple';
9
+ /**
10
+ * 组件实例数据缓存key值,减少接口请求次数,
11
+ * 1、如果页面多个组件实例的下拉列表的数据来源是同一个接口,传入相同的cacheKey,达到缓存数据共享
12
+ * 2、每个组件实例数据来源不同,传入不同的cacheKey
13
+ * 3、外部传入数据不缓存,无需cacheKey
14
+ * 4、页面销毁,缓存同时销毁
15
+ * */
16
+ cacheKey?: string;
17
+ /**
18
+ * 选中值的名称,用于回显,多选不传
19
+ */
20
+ name?: string;
21
+ /**
22
+ * 选中值,单选模式,多选模式下,传入数组
23
+ */
24
+ value?: string | any[];
25
+ /**
26
+ * 占位符
27
+ */
28
+ placeholder?: string;
29
+ /**
30
+ * 是否显示右侧已勾选面板,多选模式下有效
31
+ */
32
+ showRightPanel?: boolean;
33
+ /**
34
+ * 是否禁用
35
+ */
36
+ disabled?: boolean;
37
+ /**
38
+ * 是否支持搜索
39
+ */
40
+ showSearch?: boolean;
41
+ /**
42
+ * 自定义高级搜索区域, 用于自定义搜索条件
43
+ */
44
+ searchBar?: React.ReactNode;
45
+ /**
46
+ * 单选时,双击选中触发;或者点击确认按钮触发;或者输入模式下回车触发
47
+ */
48
+ onChange?: (value: string | any[], names?: string, values?: string | Record<string, any>) => void;
49
+ /**
50
+ * 下拉框容器类名
51
+ */
52
+ className?: string;
53
+ /**
54
+ * label和下拉框布局
55
+ * @default "horizontal"
56
+ */
57
+ direction?: 'vertical' | 'horizontal';
58
+ /**
59
+ * 自定义节点 name、value、children 的字段
60
+ */
61
+ fieldNames?: Record<string, string>;
62
+ /**
63
+ * 下拉框宽度
64
+ * @default 500
65
+ */
66
+ width?: number;
67
+ /**
68
+ * 下拉框高度
69
+ * @default 400
70
+ */
71
+ height?: number;
72
+ /**
73
+ * label
74
+ */
75
+ label?: string;
76
+ /**
77
+ * 自定义label样式
78
+ */
79
+ labelStyle?: React.CSSProperties;
80
+ /**
81
+ * 是否显示清除按钮
82
+ * @default true
83
+ */
84
+ showClear?: boolean;
85
+ /**
86
+ * 最大显示选中标签数量
87
+ * @default 2
88
+ */
89
+ maxDisplayCount?: number;
90
+ /**
91
+ * 自定义表格属性
92
+ */
93
+ tableProps: TableProps;
94
+ /**
95
+ * 自定义请求参数
96
+ */
97
+ requestProps?: ThSelectRequestProps;
98
+ /**
99
+ * 是否需要输入模式,如果设置为true,单击进入输入模式,双击打开下拉列表选择模式
100
+ * @default false
101
+ */
102
+ needInput?: boolean;
103
+ /**
104
+ * 自定义响应数据字段,用于解析接口返回数据
105
+ * @default records
106
+ */
107
+ responseField?: string;
108
+ }
109
+ export interface ThSelectRequestProps {
110
+ /**
111
+ * 接口地址
112
+ */
113
+ url: string;
114
+ /**
115
+ * 请求方法
116
+ * @default "post"
117
+ */
118
+ method?: 'get' | 'post' | 'POST' | 'GET';
119
+ /**
120
+ * 请求参数
121
+ */
122
+ params?: Record<string, any>;
123
+ /**
124
+ * 自定义搜索关键字
125
+ */
126
+ transformSearchKey?: string;
127
+ /**
128
+ * 自定义搜索关键字选项
129
+ */
130
+ searchOpt?: unknown;
131
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import type { ThTableProps } from './typing';
4
+ /**
5
+ * @description table组件
6
+ */
7
+ export declare const ThTable: <T extends Record<string, any>, U extends Record<string, any>>(props: ThTableProps<T, U>) => JSX.Element;
8
+ export default ThTable;
@@ -0,0 +1,232 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["onResize", "width", "isResizable"],
3
+ _excluded2 = ["columns", "request", "form", "search", "pagination", "showHeader", "scroll", "scrollX", "hideSearch", "style", "toolBarRender", "headerOperation", "options", "tableAlertRender", "btnPermissionList", "requestFormatter", "otherHeight", "footer"],
4
+ _excluded3 = ["pageSize", "current"];
5
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
+ import ProTable from '@ant-design/pro-table';
23
+ import { Button } from 'antd';
24
+ import classNames from 'classnames';
25
+ import { useEffect, useRef, useState } from 'react';
26
+ import { Resizable } from 'react-resizable';
27
+ import "./index.less";
28
+ import { createUuid, formatterQueryParams, hasBtnPermission } from "./utils";
29
+ import { jsx as _jsx } from "react/jsx-runtime";
30
+ import { jsxs as _jsxs } from "react/jsx-runtime";
31
+ var ResizeableTitle = function ResizeableTitle(resizeProps) {
32
+ var onResize = resizeProps.onResize,
33
+ width = resizeProps.width,
34
+ isResizable = resizeProps.isResizable,
35
+ restProps = _objectWithoutProperties(resizeProps, _excluded);
36
+ delete restProps.onResize;
37
+ if (!width || isResizable === false) {
38
+ return /*#__PURE__*/_jsx("th", _objectSpread({}, restProps));
39
+ }
40
+ return /*#__PURE__*/_jsx(Resizable, {
41
+ width: width,
42
+ height: 0,
43
+ onResize: onResize,
44
+ draggableOpts: {
45
+ enableUserSelectHack: false
46
+ },
47
+ children: /*#__PURE__*/_jsx("th", _objectSpread({}, restProps))
48
+ });
49
+ };
50
+
51
+ /**
52
+ * @description table组件
53
+ */
54
+ export var ThTable = function ThTable(props) {
55
+ var columns = props.columns,
56
+ request = props.request,
57
+ _props$form = props.form,
58
+ form = _props$form === void 0 ? {} : _props$form,
59
+ _props$search = props.search,
60
+ search = _props$search === void 0 ? {} : _props$search,
61
+ _props$pagination = props.pagination,
62
+ pagination = _props$pagination === void 0 ? {} : _props$pagination,
63
+ showHeader = props.showHeader,
64
+ scroll = props.scroll,
65
+ _props$scrollX = props.scrollX,
66
+ scrollX = _props$scrollX === void 0 ? '100%' : _props$scrollX,
67
+ _props$hideSearch = props.hideSearch,
68
+ hideSearch = _props$hideSearch === void 0 ? {} : _props$hideSearch,
69
+ _props$style = props.style,
70
+ style = _props$style === void 0 ? {
71
+ height: '100%'
72
+ } : _props$style,
73
+ toolBarRender = props.toolBarRender,
74
+ _props$headerOperatio = props.headerOperation,
75
+ headerOperation = _props$headerOperatio === void 0 ? [] : _props$headerOperatio,
76
+ _props$options = props.options,
77
+ options = _props$options === void 0 ? {
78
+ density: false
79
+ } : _props$options,
80
+ _props$tableAlertRend = props.tableAlertRender,
81
+ tableAlertRender = _props$tableAlertRend === void 0 ? false : _props$tableAlertRend,
82
+ _props$btnPermissionL = props.btnPermissionList,
83
+ btnPermissionList = _props$btnPermissionL === void 0 ? [] : _props$btnPermissionL,
84
+ requestFormatter = props.requestFormatter,
85
+ _props$otherHeight = props.otherHeight,
86
+ otherHeight = _props$otherHeight === void 0 ? 0 : _props$otherHeight,
87
+ footer = props.footer,
88
+ rest = _objectWithoutProperties(props, _excluded2);
89
+ var tableRef = useRef(null);
90
+ var _useState = useState(0),
91
+ _useState2 = _slicedToArray(_useState, 2),
92
+ height = _useState2[0],
93
+ setHeight = _useState2[1];
94
+ var _useState3 = useState(null),
95
+ _useState4 = _slicedToArray(_useState3, 2),
96
+ isCollapsed = _useState4[0],
97
+ setIsCollapsed = _useState4[1];
98
+ var toolBarHeight = !toolBarRender && headerOperation.length === 0 && !options ? 0 : 64;
99
+ var headerHeight = showHeader === false ? 0 : 47;
100
+ var paginationHeight = pagination ? 60 : 0;
101
+ var footerHeight = footer ? 47 : 0;
102
+ var searchPanelHeight = search ? 124 : 0;
103
+ var id = "thTable_".concat(createUuid().split('-')[0]);
104
+ var _useState5 = useState(columns || []),
105
+ _useState6 = _slicedToArray(_useState5, 2),
106
+ tableColumns = _useState6[0],
107
+ setTableColumns = _useState6[1];
108
+ useEffect(function () {
109
+ if (columns) {
110
+ setTableColumns(columns);
111
+ }
112
+ }, [columns]);
113
+ var components = {
114
+ header: {
115
+ cell: ResizeableTitle
116
+ }
117
+ };
118
+ var handleResize = function handleResize(index) {
119
+ return function (e, _ref) {
120
+ var size = _ref.size;
121
+ var width = size.width || e.target.offsetWidth;
122
+ var nextColumns = _toConsumableArray(tableColumns);
123
+ nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
124
+ width: width
125
+ });
126
+ setTableColumns(nextColumns);
127
+ };
128
+ };
129
+ var formatterRequest = function formatterRequest(params, sorter, filter) {
130
+ var pageSize = params.pageSize,
131
+ current = params.current,
132
+ queryPrams = _objectWithoutProperties(params, _excluded3);
133
+ return request(_objectSpread({
134
+ pageSize: pageSize,
135
+ current: current,
136
+ sorter: sorter,
137
+ filter: filter
138
+ }, formatterQueryParams(queryPrams, hideSearch, columns)));
139
+ };
140
+ useEffect(function () {
141
+ var _tableRef$current;
142
+ setHeight(((_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.clientHeight) || 0);
143
+ }, []);
144
+ var headerTitle = headerOperation.map(function (item) {
145
+ var key = item.key,
146
+ type = item.type,
147
+ name = item.name,
148
+ onClick = item.onClick,
149
+ btnRender = item.btnRender,
150
+ btnPermissionCode = item.btnPermissionCode,
151
+ icon = item.icon,
152
+ buttonRender = item.buttonRender;
153
+ if (hasBtnPermission(btnPermissionList, btnPermissionCode)) {
154
+ return btnRender || /*#__PURE__*/_jsx(Button, {
155
+ type: type || 'primary',
156
+ icon: icon,
157
+ onClick: onClick,
158
+ className: 'bool-button',
159
+ children: buttonRender ? buttonRender() : name
160
+ }, key);
161
+ }
162
+ return null;
163
+ });
164
+ var tableClassName = classNames('tableStyles', _defineProperty({}, 'tableHasSearch', !!search));
165
+ var collapseRenderBtn = function collapseRenderBtn(collapsed) {
166
+ return /*#__PURE__*/_jsxs(Button, {
167
+ children: [/*#__PURE__*/_jsx("i", {
168
+ className: "iconfont ".concat(collapsed ? 'icon-ic-zhankai' : 'icon-ic-shouqi'),
169
+ style: {
170
+ color: '#9AA5B4',
171
+ fontSize: 14
172
+ }
173
+ }), /*#__PURE__*/_jsx("span", {
174
+ children: collapsed ? '展开' : '收起'
175
+ })]
176
+ });
177
+ };
178
+ return /*#__PURE__*/_jsxs("div", {
179
+ ref: tableRef,
180
+ id: id,
181
+ className: tableClassName,
182
+ style: style,
183
+ children: [/*#__PURE__*/_jsx(ProTable, _objectSpread({
184
+ columns: tableColumns.map(function (col, index) {
185
+ return _objectSpread(_objectSpread({}, col), {}, {
186
+ onHeaderCell: function onHeaderCell(column) {
187
+ return {
188
+ width: column.width,
189
+ onResize: handleResize(index)
190
+ };
191
+ }
192
+ });
193
+ }),
194
+ components: components,
195
+ request: requestFormatter || formatterRequest,
196
+ form: _objectSpread(_objectSpread({}, form), {}, {
197
+ layout: 'vertical'
198
+ }),
199
+ search: search ? _objectSpread(_objectSpread({}, search), {}, {
200
+ searchText: search.searchText || '搜索',
201
+ collapsed: isCollapsed === null ? true : isCollapsed,
202
+ collapseRender: search.collapseRender || collapseRenderBtn,
203
+ onCollapse: search.onCollapse || setIsCollapsed
204
+ }) : false,
205
+ pagination: pagination ? _objectSpread({
206
+ showQuickJumper: true,
207
+ showTotal: function showTotal(total) {
208
+ return "\u5171 ".concat(total, "\u6761");
209
+ }
210
+ }, pagination) : false,
211
+ scroll: scroll ? {
212
+ y: height - headerHeight - paginationHeight - toolBarHeight - footerHeight - otherHeight - searchPanelHeight,
213
+ x: scrollX
214
+ } : undefined,
215
+ headerTitle: headerTitle,
216
+ toolBarRender: toolBarRender,
217
+ options: options,
218
+ onSubmit: function onSubmit() {
219
+ if (!isCollapsed && isCollapsed !== null) {
220
+ setIsCollapsed(true);
221
+ }
222
+ },
223
+ rowClassName: function rowClassName(record, index) {
224
+ return index % 2 === 1 ? "tableColorTwo" : "tableColorOne";
225
+ },
226
+ tableAlertRender: tableAlertRender
227
+ }, rest)), /*#__PURE__*/_jsx("div", {
228
+ className: "SearchMask ".concat(isCollapsed === null ? '' : isCollapsed ? 'hide' : 'show')
229
+ })]
230
+ });
231
+ };
232
+ export default ThTable;
@@ -0,0 +1,337 @@
1
+ @primary-color: #1890ff; // 临时定义,或从其他地方获取
2
+ @padding: 24px;
3
+
4
+ .tableStyles {
5
+ position: relative;
6
+
7
+ ::-webkit-scrollbar {
8
+ width: 10px;
9
+ height: 10px;
10
+ }
11
+
12
+ ::-webkit-scrollbar-thumb {
13
+ background-color: #dee2e8;
14
+ border-radius: 3px;
15
+ }
16
+
17
+ ::-webkit-scrollbar-track {
18
+ background: #f5f7f8;
19
+ }
20
+
21
+ .ant-pro-table {
22
+ position: relative;
23
+ z-index: unset;
24
+
25
+ .ant-table-body {
26
+ overflow-y: auto !important;
27
+ border-right: 1px solid #f5f7f8;
28
+ border-left: 1px solid #f5f7f8;
29
+ }
30
+
31
+ .ant-pro-card {
32
+ padding: 0 @padding;
33
+ }
34
+
35
+ .bool-button {
36
+ margin-right: 5px;
37
+ }
38
+
39
+ .ant-pro-table-search {
40
+ position: absolute;
41
+ top: 0;
42
+ left: 0;
43
+ z-index: 1000;
44
+ width: 100%;
45
+ padding: 20px @padding 0 @padding;
46
+
47
+ .ant-space-align-center {
48
+ flex-direction: row-reverse;
49
+ justify-content: space-between;
50
+ width: 100%;
51
+ }
52
+ }
53
+
54
+ .ant-pro-table-list-toolbar-setting-item {
55
+ display: inline-block;
56
+ width: 36px;
57
+ height: 36px;
58
+ margin: unset !important;
59
+ color: #9aa5b4 !important;
60
+ line-height: 36px !important;
61
+ text-align: center;
62
+ background: #f5f7f8;
63
+ border: 1px solid #e1e3e6;
64
+
65
+ :hover {
66
+ color: @primary-color;
67
+ background-color: #f8fbfd;
68
+ }
69
+
70
+ & > span {
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ width: 100%;
75
+ height: 100%;
76
+ }
77
+ }
78
+
79
+ .ant-pro-card-body {
80
+ padding: 0;
81
+ // margin-top: 100px;
82
+ }
83
+
84
+ //分页样式
85
+ .ant-pagination {
86
+ color: #666;
87
+
88
+ .ant-pagination-options {
89
+ flex: 1;
90
+ order: -1;
91
+
92
+ .select-scroll-wrapper {
93
+ margin: 0;
94
+ }
95
+
96
+ .ant-pagination-options-size-changer {
97
+ float: left;
98
+
99
+ .ant-select-selector {
100
+ height: 28px !important;
101
+ }
102
+ }
103
+
104
+ .ant-pagination-options-quick-jumper {
105
+ float: right;
106
+
107
+ input {
108
+ width: 32px;
109
+ height: 28px;
110
+ }
111
+ }
112
+ }
113
+
114
+ .ant-pagination-total-text {
115
+ order: -2;
116
+ height: 28px;
117
+ line-height: 28px;
118
+ }
119
+
120
+ .ant-pagination-prev {
121
+ a {
122
+ &::after {
123
+ color: rgba(0, 185, 255, 0.3);
124
+ }
125
+ }
126
+ }
127
+
128
+ .ant-pagination-next {
129
+ background-size: 100% 100%;
130
+
131
+ a {
132
+ &::after {
133
+ color: rgba(0, 185, 255, 0.3);
134
+ }
135
+ }
136
+ }
137
+
138
+ //分页颜色调整
139
+ .ant-pagination-item {
140
+ z-index: 1;
141
+ min-width: 28px;
142
+ height: 28px;
143
+ margin: 0 4px;
144
+ color: #9aa5b4;
145
+ line-height: 28px;
146
+ background-color: #f5f7f8 !important;
147
+ border: 0;
148
+ border-radius: 0 !important;
149
+
150
+ a {
151
+ color: #9aa5b4;
152
+ }
153
+ }
154
+
155
+ .ant-pagination-item-active:hover a {
156
+ color: #fff;
157
+ background-color: @primary-color !important;
158
+ border-color: @primary-color !important;
159
+ }
160
+
161
+ .ant-pagination-item-active a {
162
+ color: #fff !important;
163
+ background-color: @primary-color !important;
164
+ border-color: @primary-color !important;
165
+ }
166
+
167
+ .ant-pagination-prev,
168
+ .ant-pagination-next,
169
+ .ant-pagination-jump-prev,
170
+ .ant-pagination-jump-next {
171
+ z-index: 1;
172
+ width: 28px;
173
+ height: 28px;
174
+ margin: 0 12px;
175
+ }
176
+
177
+ .ant-pagination-prev .ant-pagination-item-link,
178
+ .ant-pagination-next .ant-pagination-item-link {
179
+ color: #9aa5b4;
180
+ border: 1px solid #e1e3e6;
181
+ }
182
+
183
+ .ant-pagination-jump-next {
184
+ &::after {
185
+ color: white;
186
+ }
187
+ }
188
+ }
189
+
190
+ //修改表头文字、背景颜色
191
+ .ant-table-thead > tr > th {
192
+ height: 51px;
193
+ padding: 0 16px;
194
+ overflow: hidden;
195
+ color: #000;
196
+ font-weight: bold;
197
+ font-size: 14px;
198
+ line-height: 51px;
199
+ white-space: nowrap;
200
+ text-align: center;
201
+ text-overflow: ellipsis;
202
+ background: #f5f7f8 !important;
203
+ border-right: 1px solid #f0f0f0;
204
+ border-bottom: 1px solid #c4cbd5 !important;
205
+ }
206
+
207
+ .ant-table-thead
208
+ > tr
209
+ > th:not(:last-child):not(.ant-table-selection-column):not(
210
+ .ant-table-row-expand-icon-cell
211
+ ):not([colspan])::before {
212
+ background-color: unset !important;
213
+ }
214
+
215
+ .ant-table-tbody > tr > td {
216
+ height: 51px;
217
+ // line-height: 60px;
218
+ padding: 0 16px;
219
+ color: #666;
220
+ font-size: 14px;
221
+ text-align: center;
222
+ border-bottom: 1px solid #f5f7f8;
223
+
224
+ .ant-space-align-center {
225
+ gap: unset !important;
226
+
227
+ .ant-space-item {
228
+ height: 24px;
229
+ line-height: 24px;
230
+
231
+ button {
232
+ height: 24px !important;
233
+ padding: 0 15px;
234
+ line-height: 24px;
235
+ border-left: 1px solid #e1e3e6;
236
+ }
237
+ }
238
+
239
+ .ant-space-item:first-child button {
240
+ border-left: unset !important;
241
+ }
242
+ }
243
+ }
244
+ }
245
+
246
+ .tableColorOne,
247
+ .tableColorOne .ant-table-column-sort {
248
+ background-color: #ffffff !important;
249
+ }
250
+
251
+ .tableColorTwo,
252
+ .tableColorTwo .ant-table-column-sort {
253
+ background-color: #f5f7f8 !important;
254
+ }
255
+
256
+ .react-resizable {
257
+ position: relative;
258
+ background-clip: padding-box;
259
+ }
260
+
261
+ .react-resizable-handle {
262
+ position: absolute;
263
+ right: -5px;
264
+ bottom: 0;
265
+ z-index: 1;
266
+ width: 10px;
267
+ height: 100%;
268
+ cursor: col-resize;
269
+ }
270
+
271
+ &.tableHasSearch {
272
+ .ant-pro-card-body {
273
+ margin-top: 124px;
274
+ }
275
+ }
276
+
277
+ .SearchMask {
278
+ position: absolute;
279
+ top: 0;
280
+ left: 0;
281
+ z-index: 999;
282
+ width: 100%;
283
+ background: rgba(0, 0, 0, 0.38);
284
+
285
+ &.show {
286
+ animation: show-mask 0.2s ease-in forwards;
287
+ }
288
+
289
+ &.hide {
290
+ animation: hide-mask 0.2s ease-in forwards;
291
+ }
292
+ }
293
+ }
294
+
295
+ @keyframes show-mask {
296
+ 0% {
297
+ height: 0;
298
+ }
299
+
300
+ 25% {
301
+ height: 25%;
302
+ }
303
+
304
+ 50% {
305
+ height: 50%;
306
+ }
307
+
308
+ 75% {
309
+ height: 75%;
310
+ }
311
+
312
+ 100% {
313
+ height: 100%;
314
+ }
315
+ }
316
+
317
+ @keyframes hide-mask {
318
+ 0% {
319
+ height: 100%;
320
+ }
321
+
322
+ 25% {
323
+ height: 75%;
324
+ }
325
+
326
+ 50% {
327
+ height: 50%;
328
+ }
329
+
330
+ 75% {
331
+ height: 25%;
332
+ }
333
+
334
+ 100% {
335
+ height: 0;
336
+ }
337
+ }