1 | import { VXETableComponent, RowInfo } from './component'
|
2 | import { Table } from './table'
|
3 | import { Grid } from './grid'
|
4 | import { ColumnInfo } from './column'
|
5 | import { GridRenderParams } from './v-x-e-table'
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare class Export extends VXETableComponent {}
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export interface TableExportConfig {
|
16 | |
17 |
|
18 |
|
19 | filename?: string;
|
20 | |
21 |
|
22 |
|
23 | sheetName?: string;
|
24 | |
25 |
|
26 |
|
27 | type?: string;
|
28 | |
29 |
|
30 |
|
31 | types?: string[];
|
32 | |
33 |
|
34 |
|
35 | mode?: string;
|
36 | |
37 |
|
38 |
|
39 | modes?: string[];
|
40 | |
41 |
|
42 |
|
43 | original?: boolean;
|
44 | |
45 |
|
46 |
|
47 | message?: boolean;
|
48 | |
49 |
|
50 |
|
51 | isHeader?: boolean;
|
52 | |
53 |
|
54 |
|
55 | isFooter?: boolean;
|
56 | |
57 |
|
58 |
|
59 | download?: boolean;
|
60 | |
61 |
|
62 |
|
63 | data?: any[];
|
64 | |
65 |
|
66 |
|
67 | columns?: ColumnInfo[] | ColumnOption[];
|
68 | |
69 |
|
70 |
|
71 | columnFilterMethod?(params: { column: ColumnInfo, $columnIndex: number }): boolean;
|
72 | |
73 |
|
74 |
|
75 | dataFilterMethod?(params: { row: RowInfo, $rowIndex: number }): boolean;
|
76 | |
77 |
|
78 |
|
79 | footerFilterMethod?(params: { items: any[], $rowIndex: number }): boolean;
|
80 | |
81 |
|
82 |
|
83 | remote?: boolean;
|
84 | |
85 |
|
86 |
|
87 | exportMethod?(params: { $table: Table, $grid?: Grid, options: ExportParams }): Promise<any>;
|
88 | useStyle?:boolean;
|
89 | sheetMethod?(params: { $table: Table, $grid?: Grid, options: ExportParams, columns: ColumnOption[], workbook: any, worksheet: any }): void;
|
90 |
|
91 | [name: string]: any;
|
92 | }
|
93 |
|
94 | export interface ExportParams extends TableExportConfig {
|
95 | data: any[];
|
96 | columns: ColumnOption[];
|
97 |
|
98 | [name: string]: any;
|
99 | }
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | export interface TableImportConfig {
|
105 | |
106 |
|
107 |
|
108 | types?: string[];
|
109 | |
110 |
|
111 |
|
112 | mode?: string;
|
113 | |
114 |
|
115 |
|
116 | message?: boolean;
|
117 | |
118 |
|
119 |
|
120 | remote?: boolean;
|
121 | |
122 |
|
123 |
|
124 | importMethod?(params: { $table: Table, $grid: Grid, file: File, options: TableExportConfig }): Promise<any>;
|
125 |
|
126 | [name: string]: any;
|
127 | }
|
128 |
|
129 |
|
130 |
|
131 |
|
132 | export interface TablePrintConfig {
|
133 | |
134 |
|
135 |
|
136 | sheetName?: string;
|
137 | |
138 |
|
139 |
|
140 | mode?: string;
|
141 | |
142 |
|
143 |
|
144 | modes?: string[];
|
145 | |
146 |
|
147 |
|
148 | original?: boolean;
|
149 | |
150 |
|
151 |
|
152 | isHeader?: boolean;
|
153 | |
154 |
|
155 |
|
156 | isFooter?: boolean;
|
157 | |
158 |
|
159 |
|
160 | data?: any[];
|
161 | |
162 |
|
163 |
|
164 | columns?: ColumnInfo[];
|
165 | |
166 |
|
167 |
|
168 | style?: string;
|
169 | |
170 |
|
171 |
|
172 | content?: string;
|
173 | |
174 |
|
175 |
|
176 | columnFilterMethod?(params: { column: ColumnInfo, $columnIndex: number }): boolean;
|
177 | |
178 |
|
179 |
|
180 | dataFilterMethod?(params: { row: RowInfo, $rowIndex: number }): boolean;
|
181 | |
182 |
|
183 |
|
184 | footerFilterMethod?(params: { items: any[], $rowIndex: number }): boolean;
|
185 | |
186 |
|
187 |
|
188 | beforePrintMethod?(params: { content: string, options: TablePrintConfig }): string;
|
189 |
|
190 | [name: string]: any;
|
191 | }
|
192 |
|
193 | interface ColumnOption {
|
194 | colid?: number;
|
195 | type?: string;
|
196 | field?: string;
|
197 | [key: string]: any;
|
198 | }
|
199 |
|
200 | export interface ReadFileParams {
|
201 | status: boolean;
|
202 | files: FileList;
|
203 | file: File;
|
204 | target: HTMLInputElement & EventTarget & {
|
205 | files: FileList;
|
206 | };
|
207 | }
|
208 |
|
209 | export type SaveFileFunction = (options?: SaveFileOptions) => Promise<any>;
|
210 | export type ReadFileFunction =(options?: ReadFileOptions) => Promise<ReadFileParams>;
|
211 | export type PrintFunction = (options: TablePrintConfig) => any;
|
212 |
|
213 | export interface SaveFileOptions {
|
214 | filename: string;
|
215 | type: string;
|
216 | content: string | Blob;
|
217 | }
|
218 |
|
219 | export interface ReadFileOptions {
|
220 | multiple?: boolean;
|
221 | types?: string[];
|
222 | message?: boolean;
|
223 | }
|
224 |
|
225 | export interface ColumnExportCellRenderParams extends GridRenderParams {
|
226 | row: RowInfo;
|
227 | column: ColumnInfo;
|
228 | options: ExportParams;
|
229 | }
|
230 |
|
231 | export interface ColumnExportFooterRenderParams extends GridRenderParams {
|
232 | items: any[];
|
233 | _columnIndex: number;
|
234 | column: ColumnInfo;
|
235 | options: ExportParams;
|
236 | }
|