@zat-design/sisyphus-react 3.11.14-beta.8 → 3.11.14-beta.9
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/es/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
- package/es/ProDrawerForm/components/ProModal/index.d.ts +2 -2
- package/es/ProDrawerForm/index.d.ts +1 -2
- package/es/ProDrawerForm/propsType.d.ts +38 -27
- package/es/ProDrawerForm/utils/index.d.ts +2 -2
- package/es/ProEditLabel/propsType.d.ts +2 -2
- package/es/ProEditTable/components/Summary/index.d.ts +2 -2
- package/es/ProEditTable/index.d.ts +2 -2
- package/es/ProEditTable/propsType.d.ts +232 -93
- package/es/ProEnum/propsType.d.ts +2 -2
- package/es/ProForm/components/FormFooter/index.d.ts +2 -2
- package/es/ProForm/components/FormFooter/propsType.d.ts +8 -3
- package/es/ProForm/components/base/Checkbox/index.d.ts +2 -2
- package/es/ProForm/components/base/Input/index.d.ts +2 -2
- package/es/ProForm/components/base/Input/propsType.d.ts +8 -4
- package/es/ProForm/components/base/InputNumber/index.d.ts +2 -2
- package/es/ProForm/components/base/Radio/index.d.ts +2 -2
- package/es/ProForm/components/base/RangePicker/index.d.ts +2 -2
- package/es/ProForm/components/base/Select/index.d.ts +2 -2
- package/es/ProForm/components/base/Switch/index.d.ts +2 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
- package/es/ProForm/components/base/TextArea/index.d.ts +2 -2
- package/es/ProForm/components/base/TimePicker/index.d.ts +2 -2
- package/es/ProForm/components/combination/Container/index.d.ts +2 -2
- package/es/ProForm/components/combination/Container/propsType.d.ts +9 -5
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
- package/es/ProForm/components/combination/FormList/index.d.ts +2 -2
- package/es/ProForm/components/combination/FormList/propsType.d.ts +18 -10
- package/es/ProForm/components/combination/Group/index.d.ts +2 -2
- package/es/ProForm/components/combination/Group/propsType.d.ts +10 -5
- package/es/ProForm/components/combination/Group/utils.d.ts +4 -4
- package/es/ProForm/components/combination/ProCascader/index.d.ts +2 -1
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +6 -2
- package/es/ProForm/components/combination/ProCombination/index.d.ts +3 -3
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +60 -8
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +14 -8
- package/es/ProForm/components/render/ChangedWrapper.d.ts +2 -2
- package/es/ProForm/components/render/Render.d.ts +2 -2
- package/es/ProForm/components/render/RenderFields.d.ts +4 -4
- package/es/ProForm/components/render/propsType.d.ts +54 -43
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/propsType.d.ts +22 -15
- package/es/ProForm/utils/transformValue.d.ts +2 -2
- package/es/ProForm/utils/useFieldProps.d.ts +3 -3
- package/es/ProForm/utils/useShouldUpdate.d.ts +3 -3
- package/es/ProSelect/propsType.d.ts +2 -2
- package/es/ProStep/components/Item/index.d.ts +2 -2
- package/es/ProStep/components/Step/index.d.ts +2 -2
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +12 -1
- package/es/ProStep/propsType.d.ts +60 -12
- package/es/ProStep/utils/index.d.ts +2 -2
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -2
- package/es/ProTable/hooks/useAntdTable.d.ts +2 -2
- package/es/ProTable/index.d.ts +2 -2
- package/es/ProTable/propsType.d.ts +590 -39
- package/es/ProTooltip/index.d.ts +2 -2
- package/es/ProTooltip/propsType.d.ts +52 -9
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/propsType.d.ts +3 -3
- package/es/ProTreeModal/propsType.d.ts +2 -2
- package/es/ProUpload/propsType.d.ts +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
- package/lib/ProDrawerForm/components/ProModal/index.d.ts +2 -2
- package/lib/ProDrawerForm/index.d.ts +1 -2
- package/lib/ProDrawerForm/propsType.d.ts +38 -27
- package/lib/ProDrawerForm/utils/index.d.ts +2 -2
- package/lib/ProEditLabel/propsType.d.ts +2 -2
- package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
- package/lib/ProEditTable/index.d.ts +2 -2
- package/lib/ProEditTable/propsType.d.ts +232 -93
- package/lib/ProEnum/propsType.d.ts +2 -2
- package/lib/ProForm/components/FormFooter/index.d.ts +2 -2
- package/lib/ProForm/components/FormFooter/propsType.d.ts +8 -3
- package/lib/ProForm/components/base/Checkbox/index.d.ts +2 -2
- package/lib/ProForm/components/base/Input/index.d.ts +2 -2
- package/lib/ProForm/components/base/Input/propsType.d.ts +8 -4
- package/lib/ProForm/components/base/InputNumber/index.d.ts +2 -2
- package/lib/ProForm/components/base/Radio/index.d.ts +2 -2
- package/lib/ProForm/components/base/RangePicker/index.d.ts +2 -2
- package/lib/ProForm/components/base/Select/index.d.ts +2 -2
- package/lib/ProForm/components/base/Switch/index.d.ts +2 -2
- package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
- package/lib/ProForm/components/base/TextArea/index.d.ts +2 -2
- package/lib/ProForm/components/base/TimePicker/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Container/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Container/propsType.d.ts +9 -5
- package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
- package/lib/ProForm/components/combination/FormList/index.d.ts +2 -2
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +18 -10
- package/lib/ProForm/components/combination/Group/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Group/propsType.d.ts +10 -5
- package/lib/ProForm/components/combination/Group/utils.d.ts +4 -4
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +2 -1
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +6 -2
- package/lib/ProForm/components/combination/ProCombination/index.d.ts +3 -3
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +60 -8
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +14 -8
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +2 -2
- package/lib/ProForm/components/render/Render.d.ts +2 -2
- package/lib/ProForm/components/render/RenderFields.d.ts +4 -4
- package/lib/ProForm/components/render/propsType.d.ts +54 -43
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/propsType.d.ts +22 -15
- package/lib/ProForm/utils/transformValue.d.ts +2 -2
- package/lib/ProForm/utils/useFieldProps.d.ts +3 -3
- package/lib/ProForm/utils/useShouldUpdate.d.ts +3 -3
- package/lib/ProSelect/propsType.d.ts +2 -2
- package/lib/ProStep/components/Item/index.d.ts +2 -2
- package/lib/ProStep/components/Step/index.d.ts +2 -2
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/index.js +12 -1
- package/lib/ProStep/propsType.d.ts +60 -12
- package/lib/ProStep/utils/index.d.ts +2 -2
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -2
- package/lib/ProTable/hooks/useAntdTable.d.ts +2 -2
- package/lib/ProTable/index.d.ts +2 -2
- package/lib/ProTable/propsType.d.ts +590 -39
- package/lib/ProTooltip/index.d.ts +2 -2
- package/lib/ProTooltip/propsType.d.ts +52 -9
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/propsType.d.ts +3 -3
- package/lib/ProTreeModal/propsType.d.ts +2 -2
- package/lib/ProUpload/propsType.d.ts +3 -3
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
@@ -3,163 +3,714 @@ import { TableProps } from 'antd/es/table/Table';
|
|
3
3
|
import { ColumnType, GetRowKey, RowSelectionType } from 'antd/es/table/interface';
|
4
4
|
import { FormInstance } from 'antd';
|
5
5
|
import type { TooltipProps } from 'antd';
|
6
|
-
|
6
|
+
/**
|
7
|
+
* 合计栏的每列配置参数
|
8
|
+
*/
|
9
|
+
interface ProTableSummaryColumnType {
|
10
|
+
/**
|
11
|
+
* 配置列的 dataIndex
|
12
|
+
* @description 对应表格列的 dataIndex
|
13
|
+
* @default undefined
|
14
|
+
*/
|
7
15
|
key: string | string[];
|
16
|
+
/**
|
17
|
+
* 配置列的下标
|
18
|
+
* @description 列在表格中的索引位置
|
19
|
+
* @default undefined
|
20
|
+
*/
|
8
21
|
index: number;
|
22
|
+
/**
|
23
|
+
* 配置列的自定义文本
|
24
|
+
* @description 自定义显示的文本内容
|
25
|
+
* @default undefined
|
26
|
+
*/
|
9
27
|
title?: string;
|
28
|
+
/**
|
29
|
+
* 配置列的跨度
|
30
|
+
* @description 占表格的几列
|
31
|
+
* @default undefined
|
32
|
+
*/
|
10
33
|
colSpan?: number;
|
34
|
+
/**
|
35
|
+
* 同可编辑表格类型
|
36
|
+
* @description 快捷转换数字类型
|
37
|
+
* @default undefined
|
38
|
+
*/
|
11
39
|
valueType?: string;
|
40
|
+
/**
|
41
|
+
* 数字精度
|
42
|
+
* @description 小数点后保留的位数
|
43
|
+
* @default undefined
|
44
|
+
*/
|
12
45
|
precision?: number;
|
46
|
+
/**
|
47
|
+
* 自定义前缀
|
48
|
+
* @description 显示在值前面的文本或节点
|
49
|
+
* @default undefined
|
50
|
+
*/
|
13
51
|
prefix?: ReactNode | string;
|
52
|
+
/**
|
53
|
+
* 自定义后缀
|
54
|
+
* @description 显示在值后面的文本或节点
|
55
|
+
* @default undefined
|
56
|
+
*/
|
14
57
|
suffix?: ReactNode | string;
|
15
58
|
}
|
16
|
-
|
17
|
-
|
59
|
+
/**
|
60
|
+
* 合计栏的配置参数
|
61
|
+
*/
|
62
|
+
export interface ProTableSummaryType {
|
63
|
+
/**
|
64
|
+
* 每列的配置信息
|
65
|
+
* @description 配置合计栏中每一列的展示方式
|
66
|
+
* @default []
|
67
|
+
*/
|
68
|
+
columns: ProTableSummaryColumnType[];
|
69
|
+
/**
|
70
|
+
* 是否开启自动计算
|
71
|
+
* @description 启用后将自动计算列值的总和
|
72
|
+
* @default true
|
73
|
+
*/
|
18
74
|
total?: boolean;
|
75
|
+
/**
|
76
|
+
* 合计栏位置
|
77
|
+
* @description 控制合计栏的固定位置
|
78
|
+
* @default true
|
79
|
+
*/
|
19
80
|
fixed?: boolean;
|
20
81
|
}
|
21
|
-
|
82
|
+
/**
|
83
|
+
* ProTable 列定义
|
84
|
+
*/
|
85
|
+
export interface ProTableColumnType extends Omit<ColumnType<any>, 'dataIndex'> {
|
86
|
+
/**
|
87
|
+
* 列数据在数据项中对应的路径
|
88
|
+
* @description 支持通过数组表示嵌套路径
|
89
|
+
* @default undefined
|
90
|
+
*/
|
22
91
|
dataIndex?: string | string[];
|
92
|
+
/**
|
93
|
+
* 列宽度
|
94
|
+
* @description 设置列的宽度
|
95
|
+
* @default undefined
|
96
|
+
*/
|
23
97
|
width?: number | string;
|
98
|
+
/**
|
99
|
+
* 最小宽度
|
100
|
+
* @description 设置在拖拽调节列宽过程中的最小宽度
|
101
|
+
* @default 50
|
102
|
+
*/
|
24
103
|
minWidth?: number;
|
104
|
+
/**
|
105
|
+
* 值类型
|
106
|
+
* @description 快捷转换不同类型数据的展示方式
|
107
|
+
* @default undefined
|
108
|
+
*/
|
25
109
|
valueType?: ProTableValueType;
|
110
|
+
/**
|
111
|
+
* 日期格式
|
112
|
+
* @description 设置日期格式
|
113
|
+
* @default 'YYYY-MM-DD HH:mm:ss'
|
114
|
+
*/
|
26
115
|
format?: string;
|
116
|
+
/**
|
117
|
+
* 数值精度
|
118
|
+
* @description 设置数值精度
|
119
|
+
* @default undefined
|
120
|
+
*/
|
27
121
|
precision?: number;
|
122
|
+
/**
|
123
|
+
* 枚举code
|
124
|
+
* @description 用于枚举类型的值映射
|
125
|
+
* @default undefined
|
126
|
+
*/
|
28
127
|
code?: string | string[] | ((text: any, record: any) => string);
|
128
|
+
/**
|
129
|
+
* 枚举数据源
|
130
|
+
* @description 枚举 code 数据源
|
131
|
+
* @default undefined
|
132
|
+
*/
|
29
133
|
codeValues?: {
|
30
134
|
label: string;
|
31
135
|
value: string | number;
|
32
136
|
}[];
|
137
|
+
/**
|
138
|
+
* 是否可复制
|
139
|
+
* @description 开启字段复制功能
|
140
|
+
* @default false
|
141
|
+
*/
|
33
142
|
copyable?: boolean;
|
143
|
+
/**
|
144
|
+
* 自定义前缀
|
145
|
+
* @description 用于 valueType 转换时的前缀添加,render 开启时会失效
|
146
|
+
* @default undefined
|
147
|
+
*/
|
34
148
|
prefix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
149
|
+
/**
|
150
|
+
* 自定义后缀
|
151
|
+
* @description 用于 valueType 转换时的后缀添加,render 开启时会失效
|
152
|
+
* @default undefined
|
153
|
+
*/
|
35
154
|
suffix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
155
|
+
/**
|
156
|
+
* 列头提示
|
157
|
+
* @description 列头是否开启提示
|
158
|
+
* @default undefined
|
159
|
+
*/
|
36
160
|
tooltip?: ReactNode | {
|
37
161
|
title?: ReactNode;
|
38
162
|
icon?: ReactNode;
|
39
163
|
};
|
164
|
+
/**
|
165
|
+
* 提示组件属性
|
166
|
+
* @description 传递给 Tooltip 组件的属性
|
167
|
+
* @default undefined
|
168
|
+
*/
|
40
169
|
toolTipProps?: TooltipProps & React.RefAttributes<unknown>;
|
170
|
+
/**
|
171
|
+
* 地址转换
|
172
|
+
* @description valueType 为 address 时可用,用于对地址的转换
|
173
|
+
* @default undefined
|
174
|
+
*/
|
41
175
|
transform?: (value: any, record?: any) => string[];
|
176
|
+
/**
|
177
|
+
* 列头显示控制
|
178
|
+
* @description 控制列是否显示
|
179
|
+
* @default true
|
180
|
+
*/
|
42
181
|
show?: boolean | (() => boolean);
|
43
|
-
/**
|
182
|
+
/**
|
183
|
+
* 自定义比较函数
|
184
|
+
* @description 自定义如何比较数据差异,触发条件必须写render
|
185
|
+
* @default undefined
|
186
|
+
*/
|
44
187
|
onDiff?: ({ value, record, index, originalValue, originalRecord }: any) => any;
|
45
|
-
/**
|
188
|
+
/**
|
189
|
+
* 自定义比对渲染
|
190
|
+
* @description 用于开启比对时,自定义 render 渲染初始值,触发条件必须写render
|
191
|
+
* @default undefined
|
192
|
+
*/
|
46
193
|
viewRender?: ({ value, record, index, originalValue, originalRecord, }: any) => 'same' | 'changed' | 'add' | undefined;
|
194
|
+
/**
|
195
|
+
* 是否已更改
|
196
|
+
* @description 标记列值是否已变更
|
197
|
+
* @default undefined
|
198
|
+
*/
|
47
199
|
isChanged?: boolean | null;
|
48
|
-
|
49
|
-
|
200
|
+
/**
|
201
|
+
* 子列
|
202
|
+
* @description 用于表头分组
|
203
|
+
* @default undefined
|
204
|
+
*/
|
205
|
+
children?: ProTableColumnType[];
|
206
|
+
/**
|
207
|
+
* 表格滚动配置
|
208
|
+
* @description table透传下来的scroll配置
|
209
|
+
* @default undefined
|
210
|
+
*/
|
50
211
|
scroll?: any;
|
51
212
|
}
|
52
|
-
|
213
|
+
/**
|
214
|
+
* 从数组创建树形结构的选项
|
215
|
+
*/
|
216
|
+
export interface ProTableCreateTreeFromArrayType {
|
217
|
+
/**
|
218
|
+
* 项目键
|
219
|
+
* @description 用作标识项目的属性名
|
220
|
+
* @default 'id'
|
221
|
+
*/
|
53
222
|
itemKey?: string;
|
223
|
+
/**
|
224
|
+
* 父项键
|
225
|
+
* @description 指向父项的属性名
|
226
|
+
* @default 'parentId'
|
227
|
+
*/
|
54
228
|
parentKey?: string;
|
229
|
+
/**
|
230
|
+
* 子项键
|
231
|
+
* @description 存储子项的属性名
|
232
|
+
* @default 'children'
|
233
|
+
*/
|
55
234
|
childrenKey?: string;
|
56
235
|
}
|
57
|
-
|
236
|
+
/**
|
237
|
+
* 拖拽通用守卫属性
|
238
|
+
*/
|
239
|
+
export interface ProTableDragCommonGuardType<T> {
|
240
|
+
/**
|
241
|
+
* 事件对象
|
242
|
+
* @description 拖拽事件对象
|
243
|
+
* @default undefined
|
244
|
+
*/
|
58
245
|
event: T;
|
59
246
|
}
|
60
|
-
|
247
|
+
/**
|
248
|
+
* 拖拽结束守卫属性
|
249
|
+
*/
|
250
|
+
export interface ProTableDragEndGuardType {
|
251
|
+
/**
|
252
|
+
* 开始拖拽的元素
|
253
|
+
* @description 被拖拽的数据项
|
254
|
+
* @default undefined
|
255
|
+
*/
|
61
256
|
activeObject: any;
|
257
|
+
/**
|
258
|
+
* 最终置放的元素
|
259
|
+
* @description 放置目标的数据项
|
260
|
+
* @default undefined
|
261
|
+
*/
|
62
262
|
overObject?: any;
|
263
|
+
/**
|
264
|
+
* 数据源
|
265
|
+
* @description 当前表格的数据源
|
266
|
+
* @default []
|
267
|
+
*/
|
63
268
|
currentDataSource: any[];
|
64
269
|
}
|
65
|
-
|
270
|
+
/**
|
271
|
+
* 拖拽开始守卫属性
|
272
|
+
*/
|
273
|
+
export interface ProTableDragStartGuardType {
|
274
|
+
/**
|
275
|
+
* 开始拖拽的元素
|
276
|
+
* @description 被拖拽的数据项
|
277
|
+
* @default undefined
|
278
|
+
*/
|
66
279
|
activeObject: any;
|
280
|
+
/**
|
281
|
+
* 数据源
|
282
|
+
* @description 当前表格的数据源
|
283
|
+
* @default []
|
284
|
+
*/
|
67
285
|
currentDataSource: any[];
|
68
286
|
}
|
69
|
-
|
70
|
-
|
287
|
+
/**
|
288
|
+
* 表单比对配置
|
289
|
+
*/
|
290
|
+
export interface ProTableDiffConfigType {
|
291
|
+
/**
|
292
|
+
* 比对原始数据源
|
293
|
+
* @description 用于和当前数据比对的数据源
|
294
|
+
* @default undefined
|
295
|
+
*/
|
71
296
|
originalDataSource: any[];
|
72
|
-
/**
|
297
|
+
/**
|
298
|
+
* 是否显示对比值气泡
|
299
|
+
* @description 控制是否显示对比信息的气泡提示
|
300
|
+
* @default true
|
301
|
+
*/
|
73
302
|
toolTip?: boolean;
|
74
|
-
/**
|
303
|
+
/**
|
304
|
+
* 变更提示颜色
|
305
|
+
* @description 数据变更时的背景颜色
|
306
|
+
* @default '#fffaa1'
|
307
|
+
*/
|
75
308
|
changeTipColor?: string;
|
76
|
-
/**
|
309
|
+
/**
|
310
|
+
* 新增提示颜色
|
311
|
+
* @description 新增数据时的背景颜色
|
312
|
+
* @default '#d2fff4'
|
313
|
+
*/
|
77
314
|
addTipColor?: string;
|
78
315
|
}
|
79
|
-
|
316
|
+
/**
|
317
|
+
* ProTable 主要属性
|
318
|
+
*/
|
319
|
+
export interface ProTableType<T = any> extends Omit<TableProps<any>, 'summary' | 'columns'> {
|
320
|
+
/**
|
321
|
+
* table 唯一标识
|
322
|
+
* @description 用于缓存和获取 columns 配置,在开启 resizeColumn/columnConfig 功能时需要传递以保证缓存和获取到正确的 columns 配置
|
323
|
+
* @default undefined
|
324
|
+
*/
|
80
325
|
tableId?: string;
|
326
|
+
/**
|
327
|
+
* 表格行 key 的取值
|
328
|
+
* @description 表格行数据的唯一标识字段
|
329
|
+
* @default undefined
|
330
|
+
*/
|
81
331
|
rowKey?: string | GetRowKey<any>;
|
332
|
+
/**
|
333
|
+
* 自定义 table header 左侧渲染
|
334
|
+
* @description 可以是 ReactNode 或返回 ReactNode 的函数
|
335
|
+
* @default undefined
|
336
|
+
*/
|
82
337
|
headerRender?: ReactNode | (() => ReactNode);
|
338
|
+
/**
|
339
|
+
* 全局快速 config 开关
|
340
|
+
* @description 快速开启自定义列、缓存列配置功能
|
341
|
+
* @default false
|
342
|
+
*/
|
83
343
|
quickConfig?: boolean;
|
344
|
+
/**
|
345
|
+
* 是否开启可伸缩列功能
|
346
|
+
* @description 开启伸缩列功能时,需要在 columns 中设置列宽,否则伸缩列功能不生效
|
347
|
+
* @default false
|
348
|
+
*/
|
84
349
|
resizeColumn?: boolean;
|
350
|
+
/**
|
351
|
+
* 行排序方式
|
352
|
+
* @description 控制表格行的排序方式
|
353
|
+
* @default false
|
354
|
+
*/
|
85
355
|
sortRow?: boolean | 'drag' | 'move';
|
356
|
+
/**
|
357
|
+
* 是否开启列配置功能
|
358
|
+
* @description 开启列配置功能时默认开启缓存,cacheTime 为 true
|
359
|
+
* @default false
|
360
|
+
*/
|
86
361
|
columnConfig?: boolean | {
|
87
|
-
onColumnOk: (cacheColumns: any, columns:
|
362
|
+
onColumnOk: (cacheColumns: any, columns: ProTableColumnType[]) => Promise<void>;
|
88
363
|
};
|
364
|
+
/**
|
365
|
+
* 是否开启缓存列配置和列宽度功能
|
366
|
+
* @description 开启时默认缓存时间为一天,可以自定义缓存时间,单位为天
|
367
|
+
* @default false
|
368
|
+
*/
|
89
369
|
cacheTime?: number | boolean;
|
370
|
+
/**
|
371
|
+
* 排序列文本
|
372
|
+
* @description 排序列按钮的文本
|
373
|
+
* @default '排序'
|
374
|
+
*/
|
90
375
|
sortColumnText?: string;
|
376
|
+
/**
|
377
|
+
* 浏览器缓存位置
|
378
|
+
* @description 用于设置表格配置的存储位置
|
379
|
+
* @default 'localStorage'
|
380
|
+
*/
|
91
381
|
storage?: 'localStorage' | 'sessionStorage';
|
382
|
+
/**
|
383
|
+
* 自定义 table footer 左侧渲染
|
384
|
+
* @description 可以是 ReactNode 或返回 ReactNode 的函数
|
385
|
+
* @default undefined
|
386
|
+
*/
|
92
387
|
footerRender?: ReactNode | (() => ReactNode);
|
388
|
+
/**
|
389
|
+
* 空数据文案
|
390
|
+
* @description 表格无数据时显示的内容
|
391
|
+
* @default '暂无数据'
|
392
|
+
*/
|
93
393
|
emptyText?: string | ReactNode | (() => ReactNode);
|
94
|
-
|
394
|
+
/**
|
395
|
+
* 总结栏
|
396
|
+
* @description 表格底部汇总行
|
397
|
+
* @default true
|
398
|
+
*/
|
399
|
+
summary?: ProTableSummaryType | TableProps<any>['summary'];
|
400
|
+
/**
|
401
|
+
* 排序开关
|
402
|
+
* @description 是否启用拖拽排序功能
|
403
|
+
* @default false
|
404
|
+
*/
|
95
405
|
draggable?: boolean;
|
406
|
+
/**
|
407
|
+
* 是否禁用
|
408
|
+
* @description 全局禁用表格交互
|
409
|
+
* @default false
|
410
|
+
*/
|
96
411
|
disabled?: boolean;
|
412
|
+
/**
|
413
|
+
* 是否为查看模式
|
414
|
+
* @description 开启后表格将以只读模式显示
|
415
|
+
* @default false
|
416
|
+
*/
|
97
417
|
isView?: boolean;
|
418
|
+
/**
|
419
|
+
* 行禁用判断
|
420
|
+
* @description 判断指定行是否禁用
|
421
|
+
* @default undefined
|
422
|
+
*/
|
98
423
|
rowDisabled?: (record?: T) => string | boolean;
|
99
424
|
/**
|
100
|
-
*
|
425
|
+
* 是否为斑马纹 table
|
426
|
+
* @description 启用后表格将显示交替的行背景色
|
427
|
+
* @default true
|
101
428
|
*/
|
102
429
|
stripe?: boolean;
|
103
|
-
columns: ProTableColumn[];
|
104
430
|
/**
|
105
|
-
*
|
431
|
+
* 表格列配置
|
432
|
+
* @description 定义表格的列结构
|
433
|
+
* @default []
|
434
|
+
*/
|
435
|
+
columns: ProTableColumnType[];
|
436
|
+
/**
|
437
|
+
* 表单比对配置
|
438
|
+
* @description 用于标记数据变化的配置
|
439
|
+
* @default undefined
|
106
440
|
*/
|
107
|
-
diffConfig?:
|
441
|
+
diffConfig?: ProTableDiffConfigType;
|
108
442
|
/**
|
109
|
-
*
|
443
|
+
* 开始拖拽回调
|
444
|
+
* @description 拖拽开始时触发
|
445
|
+
* @default undefined
|
110
446
|
*/
|
111
|
-
onDragStart?:
|
112
|
-
onDragEnd?: DragEndGuardProps;
|
447
|
+
onDragStart?: ProTableDragStartGuardType;
|
113
448
|
/**
|
114
|
-
*
|
449
|
+
* 结束拖拽回调
|
450
|
+
* @description 拖拽结束时触发,务必返回变更后的数据源
|
451
|
+
* @default undefined
|
452
|
+
*/
|
453
|
+
onDragEnd?: ProTableDragEndGuardType;
|
454
|
+
/**
|
455
|
+
* tip 是否跟随父节点
|
456
|
+
* @description 提示气泡是否附加到父元素
|
457
|
+
* @default true
|
115
458
|
*/
|
116
459
|
scrollFollowParent?: boolean;
|
117
460
|
}
|
461
|
+
/**
|
462
|
+
* ProTable 值类型
|
463
|
+
* @description 定义表格单元格内容的展示类型
|
464
|
+
*/
|
118
465
|
export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
|
119
|
-
|
466
|
+
/**
|
467
|
+
* 请求响应接口
|
468
|
+
*/
|
469
|
+
export interface ProTableResponseType<T = any> {
|
470
|
+
/**
|
471
|
+
* 响应数据
|
472
|
+
* @description 服务器返回的数据
|
473
|
+
* @default undefined
|
474
|
+
*/
|
120
475
|
data: T;
|
476
|
+
/**
|
477
|
+
* 状态码
|
478
|
+
* @description 用于标识错误类型的代码
|
479
|
+
* @default undefined
|
480
|
+
*/
|
121
481
|
status: number;
|
482
|
+
/**
|
483
|
+
* 消息
|
484
|
+
* @description 显示给用户的消息
|
485
|
+
* @default ''
|
486
|
+
*/
|
122
487
|
message: string;
|
123
488
|
}
|
124
|
-
|
489
|
+
/**
|
490
|
+
* 分页属性
|
491
|
+
*/
|
492
|
+
export interface ProTablePaginationType {
|
493
|
+
/**
|
494
|
+
* 当前页码
|
495
|
+
* @description 显示的页数
|
496
|
+
* @default 1
|
497
|
+
*/
|
125
498
|
pageNum: number;
|
499
|
+
/**
|
500
|
+
* 每页条数
|
501
|
+
* @description 每页显示的记录数
|
502
|
+
* @default 10
|
503
|
+
*/
|
126
504
|
pageSize: number;
|
127
505
|
}
|
506
|
+
/**
|
507
|
+
* 使用 antd表格 的选择类型
|
508
|
+
*/
|
128
509
|
type RowSelectionTypeWithPick = Pick<TableProps<any>, 'rowSelection'>['rowSelection'];
|
129
|
-
|
510
|
+
/**
|
511
|
+
* 请求选项
|
512
|
+
*/
|
513
|
+
export interface ProTableRequestOptionsType<T, R> {
|
514
|
+
/**
|
515
|
+
* 查询表单实例
|
516
|
+
* @description 用于获取和设置表单值
|
517
|
+
* @default undefined
|
518
|
+
*/
|
130
519
|
form?: FormInstance;
|
520
|
+
/**
|
521
|
+
* 重置时是否重新查询
|
522
|
+
* @description 控制表单重置后是否自动发起查询
|
523
|
+
* @default false
|
524
|
+
*/
|
131
525
|
isResetQuery?: boolean;
|
526
|
+
/**
|
527
|
+
* 表格行 key 的取值
|
528
|
+
* @description 表格行数据的唯一标识字段
|
529
|
+
* @default undefined
|
530
|
+
*/
|
132
531
|
rowKey?: string | GetRowKey<R>;
|
532
|
+
/**
|
533
|
+
* 行选择配置
|
534
|
+
* @description 控制表格行的选择功能
|
535
|
+
* @default false
|
536
|
+
*/
|
133
537
|
rowSelection?: boolean | RowSelectionTypeWithPick;
|
538
|
+
/**
|
539
|
+
* 选择功能类型
|
540
|
+
* @description 控制选择为多选或单选
|
541
|
+
* @default 'checkbox'
|
542
|
+
*/
|
134
543
|
rowSelectType?: RowSelectionType;
|
544
|
+
/**
|
545
|
+
* 选择扩展下拉
|
546
|
+
* @description 启用选择当前页、选择全部、取消选择下拉菜单
|
547
|
+
* @default false
|
548
|
+
*/
|
135
549
|
rowSelections?: boolean;
|
550
|
+
/**
|
551
|
+
* 额外参数
|
552
|
+
* @description 无法通过搜索表单设置的值,此值变更时也会重新发起请求,重置表单不会被清空
|
553
|
+
* @default undefined
|
554
|
+
*/
|
136
555
|
extraParams?: Partial<T>;
|
137
|
-
|
556
|
+
/**
|
557
|
+
* 分页配置
|
558
|
+
* @description 设置初始分页参数
|
559
|
+
* @default { pageNum: 1, pageSize: 10 }
|
560
|
+
*/
|
561
|
+
page?: ProTablePaginationType;
|
562
|
+
/**
|
563
|
+
* 是否支持跨页勾选
|
564
|
+
* @description 启用后可在不同页面间保持选中状态
|
565
|
+
* @default false
|
566
|
+
*/
|
138
567
|
crossPageSelect?: boolean;
|
139
|
-
|
568
|
+
/**
|
569
|
+
* 页码改变回调
|
570
|
+
* @description 页码或每页条数变化时的回调函数
|
571
|
+
* @default undefined
|
572
|
+
*/
|
573
|
+
onPageChange?: (page: ProTablePaginationType) => void;
|
574
|
+
/**
|
575
|
+
* 转换请求参数
|
576
|
+
* @description 在发送请求前转换参数
|
577
|
+
* @default undefined
|
578
|
+
*/
|
140
579
|
transformParams?: (params: any, requestParams: any) => any;
|
141
|
-
|
580
|
+
/**
|
581
|
+
* 转换响应数据
|
582
|
+
* @description 处理服务器返回的数据
|
583
|
+
* @default undefined
|
584
|
+
*/
|
585
|
+
transformResponse?: (res: any) => ProTableListResponseType<R>;
|
586
|
+
/**
|
587
|
+
* 行禁用判断
|
588
|
+
* @description 判断指定行是否禁用
|
589
|
+
* @default undefined
|
590
|
+
*/
|
142
591
|
disabled?: (record: any) => boolean;
|
143
592
|
}
|
144
|
-
|
593
|
+
/**
|
594
|
+
* 参数接口
|
595
|
+
*/
|
596
|
+
export interface ProTableParamsType<T = any> extends ProTablePaginationType {
|
597
|
+
/**
|
598
|
+
* 查询参数
|
599
|
+
* @description 包含查询条件的对象
|
600
|
+
* @default undefined
|
601
|
+
*/
|
145
602
|
queryBean?: Partial<T>;
|
603
|
+
/**
|
604
|
+
* 其他参数
|
605
|
+
* @description 任意其他参数
|
606
|
+
* @default undefined
|
607
|
+
*/
|
146
608
|
[key: string]: any;
|
147
609
|
}
|
148
|
-
|
610
|
+
/**
|
611
|
+
* 列表数据结构
|
612
|
+
*/
|
613
|
+
export interface ProTableListType<T> {
|
614
|
+
/**
|
615
|
+
* 当前页码
|
616
|
+
* @description 当前页数
|
617
|
+
* @default undefined
|
618
|
+
*/
|
149
619
|
pageNum?: number;
|
620
|
+
/**
|
621
|
+
* 每页条数
|
622
|
+
* @description 每页显示的记录数
|
623
|
+
* @default undefined
|
624
|
+
*/
|
150
625
|
pageSize?: number;
|
626
|
+
/**
|
627
|
+
* 总条数
|
628
|
+
* @description 符合条件的记录总数
|
629
|
+
* @default 0
|
630
|
+
*/
|
151
631
|
total: number;
|
632
|
+
/**
|
633
|
+
* 数据列表
|
634
|
+
* @description 当前页的数据记录
|
635
|
+
* @default []
|
636
|
+
*/
|
152
637
|
list: T[];
|
153
638
|
}
|
154
|
-
|
155
|
-
|
156
|
-
|
639
|
+
/**
|
640
|
+
* 列表响应类型
|
641
|
+
*/
|
642
|
+
export type ProTableListResponseType<T> = ProTableResponseType<ProTableListType<T>>;
|
643
|
+
/**
|
644
|
+
* 服务调用函数类型
|
645
|
+
*/
|
646
|
+
export type ProTableServiceType<Req, Res> = (params?: ProTableParamsType<Req>) => Promise<ProTableListResponseType<Res>>;
|
647
|
+
/**
|
648
|
+
* useAntdTable 状态
|
649
|
+
*/
|
650
|
+
export interface ProTableUseAntdTableStateType<I, R> {
|
651
|
+
/**
|
652
|
+
* 表格数据
|
653
|
+
* @description 当前表格显示的数据
|
654
|
+
* @default []
|
655
|
+
*/
|
157
656
|
data: R[];
|
657
|
+
/**
|
658
|
+
* 总记录数
|
659
|
+
* @description 符合条件的记录总数
|
660
|
+
* @default 0
|
661
|
+
*/
|
158
662
|
total: number;
|
663
|
+
/**
|
664
|
+
* 已选择的记录
|
665
|
+
* @description 当前已选中的表格行数据
|
666
|
+
* @default []
|
667
|
+
*/
|
159
668
|
selectedRecords: R[];
|
669
|
+
/**
|
670
|
+
* 已选择的行键值
|
671
|
+
* @description 当前已选中的表格行键值
|
672
|
+
* @default []
|
673
|
+
*/
|
160
674
|
selectedRowKeys: Key[];
|
675
|
+
/**
|
676
|
+
* 搜索值
|
677
|
+
* @description 当前表单的搜索条件
|
678
|
+
* @default undefined
|
679
|
+
*/
|
161
680
|
searchValues: I;
|
681
|
+
/**
|
682
|
+
* 额外过滤条件
|
683
|
+
* @description 表单之外的额外过滤条件
|
684
|
+
* @default {}
|
685
|
+
*/
|
162
686
|
extraFilter: any;
|
687
|
+
/**
|
688
|
+
* 是否全选
|
689
|
+
* @description 是否选中了所有数据
|
690
|
+
* @default false
|
691
|
+
*/
|
163
692
|
allSelected: boolean;
|
164
693
|
}
|
694
|
+
export type ProTableProps<T = any> = ProTableType<T>;
|
695
|
+
export type ProTableColumn = ProTableColumnType;
|
696
|
+
export type ProTableSummaryProps = ProTableSummaryType;
|
697
|
+
export type PaginationProps = ProTablePaginationType;
|
698
|
+
export type PaginationType = ProTablePaginationType;
|
699
|
+
export type DragStartGuardProps = ProTableDragStartGuardType;
|
700
|
+
export type DragEndGuardProps = ProTableDragEndGuardType;
|
701
|
+
export type DragCommonGuardProps<T> = ProTableDragCommonGuardType<T>;
|
702
|
+
export type DragStartGuardType = ProTableDragStartGuardType;
|
703
|
+
export type DragEndGuardType = ProTableDragEndGuardType;
|
704
|
+
export type DragCommonGuardType<T> = ProTableDragCommonGuardType<T>;
|
705
|
+
export type RequestOptions<T, R> = ProTableRequestOptionsType<T, R>;
|
706
|
+
export type RequestOptionsType<T, R> = ProTableRequestOptionsType<T, R>;
|
707
|
+
export type UseAntdTableState<I, R> = ProTableUseAntdTableStateType<I, R>;
|
708
|
+
export type UseAntdTableStateType<I, R> = ProTableUseAntdTableStateType<I, R>;
|
709
|
+
export type Response<T = any> = ProTableResponseType<T>;
|
710
|
+
export type List<T> = ProTableListType<T>;
|
711
|
+
export type ListResponse<T> = ProTableListResponseType<T>;
|
712
|
+
export type Params<T = any> = ProTableParamsType<T>;
|
713
|
+
export type Service<Req, Res> = ProTableServiceType<Req, Res>;
|
714
|
+
export type TableDiffConfigType = ProTableDiffConfigType;
|
715
|
+
export type CreateTreeFromArrayOptions = ProTableCreateTreeFromArrayType;
|
165
716
|
export {};
|