UNPKG

2.65 kBTypeScriptView Raw
1import { VXETableComponent } from './component'
2import { ColumnInfo } from './column'
3import { TableRenderParams, RenderOptions, OptionProps, OptionGroupProps } from './v-x-e-table'
4
5/**
6 * 筛选
7 */
8export declare class Filter extends VXETableComponent {}
9
10export class FilterPanel {
11 /**
12 * 筛选所有发生改变
13 * @param evnt 事件
14 * @param checked 是否选中
15 */
16 changeAllOption(evnt: any, checked: boolean): any;
17 /**
18 * 筛选选项发生改变
19 * @param evnt 事件
20 * @param checked 是否选中
21 * @param option 选项对象
22 */
23 changeOption(evnt: any, checked: boolean, option: ColumnFilterParams): any;
24 /**
25 * 确认筛选
26 */
27 confirmFilter(): any;
28 /**
29 * 重置筛选
30 */
31 resetFilter(): any;
32}
33
34export interface ColumnFilterOption {
35 label?: string | number;
36 value?: any;
37 data?: any;
38 resetValue?: any;
39 checked?: boolean;
40}
41
42export interface ColumnFilterParams {
43 label: string | number;
44 value: any;
45 data: any;
46 resetValue: any;
47 checked: boolean;
48}
49
50/**
51 * 筛选渲染参数
52 */
53export interface ColumnFilterRenderParams extends TableRenderParams{
54 $panel: FilterPanel;
55 /**
56 * 列对象
57 */
58 column: ColumnInfo;
59 /**
60 * 相对于 columns 中的索引
61 */
62 columnIndex: number;
63 /**
64 * 相对于可视区渲染中的列索引
65 */
66 $columnIndex: number;
67 /**
68 * 相对于表头行数据的索引
69 */
70 $rowIndex: number;
71}
72
73/**
74 * 筛选渲染参数
75 */
76export interface ColumnFilterMethodParams {
77 /**
78 * 选项值
79 */
80 value: any;
81 /**
82 * 选项
83 */
84 option: ColumnFilterParams;
85 /**
86 * 行数据对象
87 */
88 row: any;
89 /**
90 * 列对象
91 */
92 column: ColumnInfo;
93}
94
95export interface ColumnFilterSlotParams extends ColumnFilterRenderParams {}
96
97export interface ColumnFilterResetParams extends TableRenderParams {
98 options: ColumnFilterParams[];
99 column: ColumnInfo;
100}
101
102/**
103 * 筛选渲染配置项
104 */
105export interface ColumnFilterRenderOptions extends RenderOptions {
106 /**
107 * 下拉选项列表(需要渲染器支持)
108 */
109 options?: { [key: string]: any }[];
110 /**
111 * 下拉选项属性参数配置(需要渲染器支持)
112 */
113 optionProps?: OptionProps;
114 /**
115 * 下拉分组选项列表(需要渲染器支持)
116 */
117 optionGroups?: { [key: string]: any }[];
118 /**
119 * 下拉分组选项属性参数配置(需要渲染器支持)
120 */
121 optionGroupProps?: OptionGroupProps;
122 /**
123 * 渲染组件的内容(需要渲染器支持)
124 */
125 content?: string;
126}