@cqsjjb/jjb-react-admin-component 3.3.9 → 3.3.10
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/PageLayout/index.less +2 -2
- package/SearchForm/index.d.ts +3 -1
- package/SearchForm/index.js +17 -81
- package/Table/README.md +1 -1
- package/Table/index.d.ts +17 -64
- package/Table/index.js +97 -78
- package/Table/index.less +5 -7
- package/TableAction/index.js +3 -1
- package/package.json +1 -1
package/PageLayout/index.less
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
.@{com-prefix-cls}-layout-container-tools {
|
|
23
23
|
margin-top: 0;
|
|
24
24
|
margin-bottom: 0;
|
|
25
|
-
padding: 0 20px
|
|
25
|
+
padding: 0 20px 16px 20px;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.@{com-prefix-cls}-layout-container-content {
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
padding: 20px;
|
|
45
45
|
border-top: 1px #f0f0f0 solid;
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
package/SearchForm/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export interface SearchFormProps {
|
|
|
11
11
|
expand?: boolean;
|
|
12
12
|
// 内部默认展开状态,仅在 expand 未传入时生效 默认-false
|
|
13
13
|
defaultExpand?: boolean;
|
|
14
|
+
// 列数 默认-3
|
|
15
|
+
colSize?: number;
|
|
14
16
|
// 查询 loading 状态 默认-false
|
|
15
17
|
loading?: boolean;
|
|
16
18
|
// 表单行节点数组 默认-[]
|
|
@@ -29,4 +31,4 @@ export interface SearchFormProps {
|
|
|
29
31
|
|
|
30
32
|
declare const SearchForm: React.FC<SearchFormProps>;
|
|
31
33
|
|
|
32
|
-
export default SearchForm;
|
|
34
|
+
export default SearchForm;
|
package/SearchForm/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
1
|
import React, { useState, useRef, useEffect } from 'react';
|
|
3
2
|
import { Form, Button, Space, Row, Col } from 'antd';
|
|
4
3
|
import { SearchOutlined, DoubleRightOutlined, UndoOutlined } from '@ant-design/icons';
|
|
@@ -9,6 +8,7 @@ const SearchForm = ({
|
|
|
9
8
|
// 受控
|
|
10
9
|
defaultExpand = false,
|
|
11
10
|
// 内部默认展开
|
|
11
|
+
colSize = 3,
|
|
12
12
|
loading = false,
|
|
13
13
|
formLine = [],
|
|
14
14
|
initialValues = {},
|
|
@@ -17,45 +17,14 @@ const SearchForm = ({
|
|
|
17
17
|
onFinish = () => {},
|
|
18
18
|
onExpand
|
|
19
19
|
}) => {
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
const internalFormRef = useRef(internalFormInstance);
|
|
23
|
-
|
|
24
|
-
// 判断外部传入的是 ref 还是 form 实例
|
|
25
|
-
// ref 对象有 current 属性,form 实例没有
|
|
26
|
-
const isExternalRef = externalForm && 'current' in externalForm;
|
|
27
|
-
|
|
28
|
-
// 警告:ref 用法将在后续版本中移除
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (isExternalRef) {
|
|
31
|
-
console.warn('[SearchForm] 警告:通过 ref 传入 form 的方式已废弃,将在后续版本中移除。' + '请使用 Form.useForm() 创建 form 实例并直接传入,例如:\n' + ' const [form] = Form.useForm();\n' + ' <SearchForm form={form} />');
|
|
32
|
-
}
|
|
33
|
-
}, [isExternalRef]);
|
|
34
|
-
|
|
35
|
-
// 获取实际的 form 实例(兼容 ref 和直接传入实例两种情况)
|
|
36
|
-
const getFormInstance = () => {
|
|
37
|
-
if (externalForm) {
|
|
38
|
-
return isExternalRef ? externalForm.current : externalForm;
|
|
39
|
-
}
|
|
40
|
-
return internalFormInstance;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// 兼容性处理:用于 form.current 访问方式的 ref
|
|
44
|
-
const formRef = externalForm && isExternalRef ? externalForm : internalFormRef;
|
|
45
|
-
|
|
46
|
-
// 更新内部 ref,确保 formRef.current 始终指向正确的实例
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (!isExternalRef && externalForm) {
|
|
49
|
-
// 如果外部传入的是实例,将其赋值给内部 ref 的 current
|
|
50
|
-
internalFormRef.current = externalForm;
|
|
51
|
-
}
|
|
52
|
-
}, [externalForm, isExternalRef]);
|
|
20
|
+
const internalForm = useRef();
|
|
21
|
+
const form = externalForm || internalForm;
|
|
53
22
|
const [internalOpen, setInternalOpen] = useState(defaultExpand);
|
|
54
23
|
useEffect(() => {
|
|
55
24
|
if (onRef) {
|
|
56
|
-
onRef(
|
|
25
|
+
onRef(form);
|
|
57
26
|
}
|
|
58
|
-
}, [
|
|
27
|
+
}, [form, onRef]);
|
|
59
28
|
const isControlled = expand !== undefined;
|
|
60
29
|
const isOpen = isControlled ? expand : internalOpen;
|
|
61
30
|
const handleToggle = () => {
|
|
@@ -78,11 +47,10 @@ const SearchForm = ({
|
|
|
78
47
|
icon: /*#__PURE__*/React.createElement(UndoOutlined, null),
|
|
79
48
|
loading: loading,
|
|
80
49
|
onClick: () => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
onReset(formInstance.getFieldsValue());
|
|
50
|
+
form.current.resetFields();
|
|
51
|
+
onReset(form.current.getFieldsValue());
|
|
84
52
|
}
|
|
85
|
-
}, "\u91CD\u7F6E"), formLine.length >
|
|
53
|
+
}, "\u91CD\u7F6E"), formLine.length / colSize > 1 && /*#__PURE__*/React.createElement(Button, {
|
|
86
54
|
icon: /*#__PURE__*/React.createElement(DoubleRightOutlined, {
|
|
87
55
|
style: {
|
|
88
56
|
transform: isOpen ? 'rotate(-90deg)' : 'rotate(90deg)'
|
|
@@ -90,70 +58,38 @@ const SearchForm = ({
|
|
|
90
58
|
}),
|
|
91
59
|
onClick: handleToggle
|
|
92
60
|
}, isOpen ? '收起' : '展开'));
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* 处理 formLine,确保所有 Form.Item 都有 noStyle 属性
|
|
96
|
-
* @param {ReactNode[]} nodes - 表单节点数组
|
|
97
|
-
* @returns {ReactNode[]} - 处理后的节点数组
|
|
98
|
-
*/
|
|
99
|
-
const processFormLine = nodes => {
|
|
100
|
-
return nodes.map(node => {
|
|
101
|
-
// 检查是否是 Form.Item 组件
|
|
102
|
-
if (/*#__PURE__*/React.isValidElement(node) && node.type === Form.Item) {
|
|
103
|
-
// 如果没有 noStyle 属性,则克隆并添加
|
|
104
|
-
if (!node.props.noStyle) {
|
|
105
|
-
return /*#__PURE__*/React.cloneElement(node, {
|
|
106
|
-
noStyle: true
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return node;
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
61
|
const groupsList = () => {
|
|
114
|
-
|
|
115
|
-
const processedFormLine = processFormLine(formLine);
|
|
116
|
-
const arr = processedFormLine.map(node => ({
|
|
62
|
+
const arr = formLine.map(node => ({
|
|
117
63
|
show: true,
|
|
118
64
|
node
|
|
119
65
|
}));
|
|
120
|
-
if (isOpen || arr.length <=
|
|
66
|
+
if (isOpen || arr.length <= 3) {
|
|
121
67
|
return arr;
|
|
122
68
|
}
|
|
123
|
-
return arr.map((item, index) => index >
|
|
69
|
+
return arr.map((item, index) => index > 2 ? {
|
|
124
70
|
...item,
|
|
125
71
|
show: false
|
|
126
72
|
} : item);
|
|
127
73
|
};
|
|
128
74
|
const formItemList = groupsList();
|
|
129
75
|
if (formItemList.length === 0) return null;
|
|
130
|
-
return /*#__PURE__*/React.createElement(Form,
|
|
131
|
-
ref:
|
|
132
|
-
} : {
|
|
133
|
-
form: externalForm || internalFormInstance
|
|
134
|
-
}, {
|
|
76
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
77
|
+
ref: form,
|
|
135
78
|
style: style,
|
|
136
79
|
initialValues: initialValues,
|
|
137
80
|
onFinish: values => onFinish(values)
|
|
138
|
-
}
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
139
82
|
gutter: [16, 16]
|
|
140
83
|
}, formItemList.map((item, index) => /*#__PURE__*/React.createElement(Col, {
|
|
141
84
|
key: index,
|
|
142
|
-
span:
|
|
85
|
+
span: 24 / colSize,
|
|
143
86
|
style: {
|
|
144
87
|
display: item.show ? 'block' : 'none'
|
|
145
88
|
}
|
|
146
89
|
}, item.node)), /*#__PURE__*/React.createElement(Col, {
|
|
147
|
-
span:
|
|
148
|
-
style: {
|
|
149
|
-
display: 'flex',
|
|
150
|
-
alignItems: 'flex-start'
|
|
151
|
-
}
|
|
90
|
+
span: 24 / colSize
|
|
152
91
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
153
|
-
noStyle: true
|
|
154
|
-
style: {
|
|
155
|
-
marginBottom: 0
|
|
156
|
-
}
|
|
92
|
+
noStyle: true
|
|
157
93
|
}, getButtons()))));
|
|
158
94
|
};
|
|
159
95
|
export default SearchForm;
|
package/Table/README.md
CHANGED
|
@@ -33,4 +33,4 @@ function App() {
|
|
|
33
33
|
| disabledResizer | 是否禁用内容区滚动,设置true自动将适配内容区滚动高度 | `boolean` | false |
|
|
34
34
|
| storeIndex | 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖 | `number` | - |
|
|
35
35
|
|
|
36
|
-
其他属性参考 https://ant-design.antgroup.com/components/table-cn#api
|
|
36
|
+
其他属性参考 https://ant-design.antgroup.com/components/table-cn#api
|
package/Table/index.d.ts
CHANGED
|
@@ -1,64 +1,17 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import type { TableProps } from 'antd';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/** 列表高度 */
|
|
19
|
-
listsHeight?: number;
|
|
20
|
-
/** 额外内容 */
|
|
21
|
-
extra?: React.ReactNode;
|
|
22
|
-
/** 子元素 */
|
|
23
|
-
children?: React.ReactNode;
|
|
24
|
-
/** 自定义设置图标 */
|
|
25
|
-
settingIcon?: React.ReactNode;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* ProTable options 配置项
|
|
30
|
-
*/
|
|
31
|
-
export interface OptionConfig {
|
|
32
|
-
/** 是否显示密度切换 */
|
|
33
|
-
density?: boolean;
|
|
34
|
-
/** 是否显示全屏按钮,或自定义函数 */
|
|
35
|
-
fullScreen?: boolean | ((e: React.MouseEvent<HTMLSpanElement>, action?: any) => void);
|
|
36
|
-
/** 是否显示刷新按钮,或自定义函数 */
|
|
37
|
-
reload?: boolean | ((e: React.MouseEvent<HTMLSpanElement>, action?: any) => void);
|
|
38
|
-
/** 列设置配置 */
|
|
39
|
-
setting?: boolean | SettingOptionType;
|
|
40
|
-
/** 搜索配置 */
|
|
41
|
-
search?: boolean | {
|
|
42
|
-
name?: string;
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
};
|
|
45
|
-
/** 自定义刷新图标 */
|
|
46
|
-
reloadIcon?: React.ReactNode;
|
|
47
|
-
/** 自定义密度图标 */
|
|
48
|
-
densityIcon?: React.ReactNode;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface OverTableProps extends TableProps {
|
|
52
|
-
// 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖
|
|
53
|
-
storeIndex?: string;
|
|
54
|
-
// 是否启用自动计算滚动高度,默认-true
|
|
55
|
-
enableAutoScrollY?: boolean;
|
|
56
|
-
// ProTable options 配置项
|
|
57
|
-
options?: OptionConfig | false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
interface TableFc extends React.FC<OverTableProps> {
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
declare const Table: TableFc;
|
|
64
|
-
export default Table;
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import type { TableProps } from 'antd';
|
|
5
|
+
|
|
6
|
+
export interface OverTableProps extends TableProps {
|
|
7
|
+
// 是否禁用内容区滚动,默认-false
|
|
8
|
+
disabledResizer?: boolean;
|
|
9
|
+
// 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖
|
|
10
|
+
storeIndex?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface TableFc extends React.FC<OverTableProps> {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const Table: TableFc;
|
|
17
|
+
export default Table;
|
package/Table/index.js
CHANGED
|
@@ -1,99 +1,118 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
3
4
|
import { ProTable } from '@ant-design/pro-components';
|
|
5
|
+
import { useAntdResizableHeader } from 'use-antd-resizable-header';
|
|
6
|
+
import { antPrefix, setTableSize, getTableSize, getPersistenceKey } from './utils';
|
|
4
7
|
import './index.less';
|
|
5
|
-
|
|
8
|
+
require('use-antd-resizable-header/dist/style.css');
|
|
6
9
|
export default function TablePro(props) {
|
|
7
10
|
const prefix = antPrefix || 'ant';
|
|
8
11
|
const baseCls = `.${prefix}-table`;
|
|
9
|
-
const
|
|
12
|
+
const tableCls = `${baseCls}-wrapper`;
|
|
10
13
|
const tableBodyCls = `${baseCls}-body`;
|
|
11
|
-
const tablePaginationCls = `${baseCls}-pagination`;
|
|
12
|
-
const tableFooterCls = `${baseCls}-footer`;
|
|
13
14
|
const {
|
|
14
|
-
|
|
15
|
-
options = {
|
|
16
|
-
reload: false,
|
|
17
|
-
density: true,
|
|
18
|
-
fullScreen: true,
|
|
19
|
-
setting: {
|
|
20
|
-
checkedReset: true,
|
|
21
|
-
draggable: false,
|
|
22
|
-
checkable: true
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
...restProps
|
|
15
|
+
storeIndex
|
|
26
16
|
} = props;
|
|
27
|
-
const [
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const tablePaginationHeight = tablePaginationRect?.height || 0;
|
|
39
|
-
const border = 2;
|
|
40
|
-
const margin = 20;
|
|
41
|
-
const scrollY = window.innerHeight - tableBodyRect.top - tableFooterHeight - tablePaginationHeight - tablePaginationMargin - border - margin;
|
|
42
|
-
return scrollY;
|
|
43
|
-
};
|
|
44
|
-
const debouncedCalcScrollY = useCallback(() => {
|
|
45
|
-
if (timerRef.current) {
|
|
46
|
-
clearTimeout(timerRef.current);
|
|
47
|
-
}
|
|
48
|
-
timerRef.current = setTimeout(() => {
|
|
49
|
-
const height = calcTableScrollY();
|
|
50
|
-
if (height) {
|
|
51
|
-
setScrollY(height);
|
|
52
|
-
}
|
|
53
|
-
}, 150);
|
|
54
|
-
}, []);
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (!ref.current || !enableAutoScrollY) return;
|
|
17
|
+
const [size, setSize] = React.useState(getTableSize(storeIndex) || 'default');
|
|
18
|
+
const [tableHeight, setTableHeight] = React.useState(0);
|
|
19
|
+
const persistenceKey = getPersistenceKey(storeIndex);
|
|
20
|
+
const enabledResizer = tools.isUndefined(props.disabledResizer);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
let mutationObserver, resizeObserver;
|
|
23
|
+
if (enabledResizer) {
|
|
24
|
+
// 监听-DOM树
|
|
25
|
+
mutationObserver = new MutationObserver(mutations => mutations.forEach(() => calcTableHeight()));
|
|
26
|
+
// 监听-缩放
|
|
27
|
+
resizeObserver = new ResizeObserver(entries => entries.forEach(() => calcTableHeight()));
|
|
57
28
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// 等待 table-pagination 元素生成后再计算
|
|
61
|
-
debouncedCalcScrollY();
|
|
62
|
-
});
|
|
63
|
-
const mutationObserver = new MutationObserver(() => {
|
|
64
|
-
debouncedCalcScrollY();
|
|
65
|
-
});
|
|
66
|
-
mutationObserver.observe(ref.current, {
|
|
67
|
-
childList: true,
|
|
68
|
-
subtree: true,
|
|
69
|
-
attributes: true
|
|
70
|
-
});
|
|
29
|
+
// 初始化首次计算
|
|
30
|
+
setTimeout(() => calcTableHeight(), 500);
|
|
71
31
|
|
|
72
|
-
|
|
73
|
-
|
|
32
|
+
// 执行-监听-缩放
|
|
33
|
+
resizeObserver.observe(document.body);
|
|
34
|
+
// 执行-监听-DOM树是否发生变化
|
|
35
|
+
mutationObserver.observe(document.body, {
|
|
36
|
+
subtree: true,
|
|
37
|
+
childList: true
|
|
38
|
+
});
|
|
39
|
+
}
|
|
74
40
|
return () => {
|
|
75
|
-
if (
|
|
76
|
-
|
|
41
|
+
if (mutationObserver && resizeObserver && enabledResizer) {
|
|
42
|
+
resizeObserver.unobserve(document.body);
|
|
43
|
+
mutationObserver.disconnect(document.body);
|
|
77
44
|
}
|
|
78
|
-
resizeObserver.disconnect();
|
|
79
|
-
mutationObserver.disconnect();
|
|
80
45
|
};
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
46
|
+
}, []);
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
setTableSize(size, storeIndex);
|
|
49
|
+
}, [size]);
|
|
50
|
+
|
|
51
|
+
// 计算高度
|
|
52
|
+
const calcTableHeight = () => {
|
|
53
|
+
try {
|
|
54
|
+
// table元素
|
|
55
|
+
const tableEl = document.querySelector(tableCls);
|
|
56
|
+
// table-body元素
|
|
57
|
+
const tableBodyEl = document.querySelector(tableBodyCls);
|
|
58
|
+
if (tableBodyEl && tableEl) {
|
|
59
|
+
// 获取table元素的矩形数据
|
|
60
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
61
|
+
// 获取table-body元素的矩形数据
|
|
62
|
+
const tableBodyRect = tableBodyEl.getBoundingClientRect();
|
|
63
|
+
// 获取底部的高度差
|
|
64
|
+
const bottomHeight = tableRect.bottom - tableBodyRect.bottom;
|
|
65
|
+
// 计算最终值
|
|
66
|
+
setTableHeight(innerHeight - tableBodyRect.top - bottomHeight - (window.__IN_BASE__ ? 38 : 22));
|
|
67
|
+
}
|
|
68
|
+
} catch (e) {
|
|
69
|
+
window.console['error'](e);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const {
|
|
73
|
+
components,
|
|
74
|
+
resizableColumns,
|
|
75
|
+
tableWidth,
|
|
76
|
+
resetColumns
|
|
77
|
+
// refresh
|
|
78
|
+
} = useAntdResizableHeader({
|
|
79
|
+
columns: props.columns,
|
|
80
|
+
columnsState: {
|
|
81
|
+
persistenceKey: persistenceKey.resizable,
|
|
82
|
+
persistenceType: 'localStorage'
|
|
86
83
|
}
|
|
87
|
-
}
|
|
84
|
+
});
|
|
85
|
+
const scroll = {
|
|
86
|
+
x: tableWidth
|
|
87
|
+
};
|
|
88
|
+
if (enabledResizer) {
|
|
89
|
+
scroll.y = tableHeight;
|
|
90
|
+
}
|
|
91
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProTable, _extends({
|
|
88
92
|
ghost: true,
|
|
89
93
|
columnEmptyText: true,
|
|
94
|
+
size: size,
|
|
90
95
|
search: false,
|
|
91
|
-
scroll:
|
|
92
|
-
y: scrollY || 0
|
|
93
|
-
} : undefined,
|
|
96
|
+
scroll: scroll,
|
|
94
97
|
className: `${antPrefix}-gbs-pro-table`,
|
|
95
|
-
options:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
options: {
|
|
99
|
+
reload: false,
|
|
100
|
+
fullScreen: true,
|
|
101
|
+
setting: {
|
|
102
|
+
checkedReset: true,
|
|
103
|
+
extra: /*#__PURE__*/React.createElement("a", {
|
|
104
|
+
className: `${antPrefix}-pro-table-column-setting-action-rest-button`,
|
|
105
|
+
onClick: resetColumns
|
|
106
|
+
}, "\u91CD\u7F6E\u5217\u5BBD")
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
components: components,
|
|
110
|
+
columnsState: {
|
|
111
|
+
persistenceKey: persistenceKey.columnState,
|
|
112
|
+
persistenceType: 'localStorage'
|
|
113
|
+
},
|
|
114
|
+
onSizeChange: setSize
|
|
115
|
+
}, props, {
|
|
116
|
+
columns: resizableColumns
|
|
98
117
|
})));
|
|
99
118
|
}
|
package/Table/index.less
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.@{com-prefix-cls} {
|
|
1
|
+
.@{ant-prefix} {
|
|
4
2
|
&-gbs-pro-table {
|
|
5
|
-
.@{
|
|
3
|
+
.@{ant-prefix}-pro-card {
|
|
6
4
|
&-body {
|
|
7
|
-
.@{
|
|
5
|
+
.@{ant-prefix}-pro-table-list-toolbar {
|
|
8
6
|
&-container {
|
|
9
|
-
padding-
|
|
7
|
+
padding-top: 0;
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
|
-
}
|
|
13
|
+
}
|
package/TableAction/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
3
|
+
import { MoreOutlined } from '@ant-design/icons';
|
|
3
4
|
import { Dropdown, Space } from 'antd';
|
|
4
5
|
export default function TableAction({
|
|
5
6
|
maximum = 3,
|
|
6
7
|
children,
|
|
7
8
|
space,
|
|
9
|
+
icon: Icon = MoreOutlined,
|
|
8
10
|
placement = 'bottomRight',
|
|
9
11
|
// 下拉菜单位置,默认 bottomRight
|
|
10
12
|
trigger = ['hover'] // 下拉触发方式,默认 hover
|
|
@@ -24,5 +26,5 @@ export default function TableAction({
|
|
|
24
26
|
},
|
|
25
27
|
placement: placement,
|
|
26
28
|
trigger: trigger
|
|
27
|
-
}, /*#__PURE__*/React.createElement("a", null,
|
|
29
|
+
}, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(Icon, null))));
|
|
28
30
|
}
|