props.ts
3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import { PropType } from 'vue';
import { PaginationProps } from './types/pagination';
import { BasicColumn, FetchSetting } from './types/table';
import { TableCustomRecord, TableRowSelection } from 'ant-design-vue/types/table/table';
import { FormProps } from '/@/components/Form/index';
import { FETCH_SETTING } from './const';
// 注释看 types/table
export const basicProps = {
autoCreateKey: {
type: Boolean as PropType<boolean>,
default: true,
},
striped: {
type: Boolean as PropType<boolean>,
default: true,
},
showSummary: {
type: Boolean as PropType<boolean>,
default: false,
},
summaryFunc: {
type: [Function, Array] as PropType<(...arg: any[]) => any[]>,
default: null,
},
canColDrag: {
type: Boolean as PropType<boolean>,
default: true,
},
isTreeTable: {
type: Boolean as PropType<boolean>,
default: false,
},
api: {
type: Function as PropType<(...arg: any[]) => Promise<any>>,
default: null,
},
beforeFetch: {
type: Function as PropType<Fn>,
default: null,
},
afterFetch: {
type: Function as PropType<Fn>,
default: null,
},
handleSearchInfoFn: {
type: Function as PropType<Fn>,
default: null,
},
fetchSetting: {
type: Object as PropType<FetchSetting>,
default: () => {
return FETCH_SETTING;
},
},
// 立即请求接口
immediate: { type: Boolean as PropType<boolean>, default: true },
emptyDataIsShowTable: {
type: Boolean as PropType<boolean>,
default: true,
},
// 额外的请求参数
searchInfo: {
type: Object as PropType<any>,
default: null,
},
// 使用搜索表单
useSearchForm: {
type: Boolean as PropType<boolean>,
default: false,
},
// 表单配置
formConfig: {
type: Object as PropType<Partial<FormProps>>,
default: null,
},
columns: {
type: [Array] as PropType<BasicColumn[]>,
default: null,
},
showIndexColumn: {
type: Boolean as PropType<boolean>,
default: true,
},
indexColumnProps: {
type: Object as PropType<BasicColumn>,
default: null,
},
actionColumn: {
type: Object as PropType<BasicColumn>,
default: null,
},
ellipsis: {
type: Boolean as PropType<boolean>,
default: true,
},
canResize: {
type: Boolean as PropType<boolean>,
default: true,
},
clearSelectOnPageChange: {
type: Boolean as PropType<boolean>,
default: false,
},
resizeHeightOffset: {
type: Number as PropType<number>,
default: 0,
},
rowSelection: {
type: Object as PropType<TableRowSelection<any> | null>,
default: null,
},
title: {
type: [String, Function] as PropType<string | ((data: any) => any)>,
default: null,
},
titleHelpMessage: {
type: [String, Array] as PropType<string | string[]>,
},
maxHeight: {
type: Number as PropType<number>,
},
dataSource: {
type: Array as PropType<any[]>,
default: null,
},
rowKey: {
type: [String, Function] as PropType<string | ((record: any) => string)>,
default: '',
},
bordered: {
type: Boolean as PropType<boolean>,
default: true,
},
pagination: {
type: [Object, Boolean] as PropType<PaginationProps | boolean>,
default: null,
},
loading: {
type: Boolean as PropType<boolean>,
default: false,
},
rowClassName: {
type: Function as PropType<(record: TableCustomRecord<any>, index: number) => string>,
},
scroll: {
type: Object as PropType<{ x: number | true; y: number }>,
default: null,
},
};