import { ColumnType, ICommonColumn } from '../../common'; import type { ExtractPropTypes, VNode } from 'vue'; /** * @description 公开的table column配置 */ export interface ITableCommonColumn { /** * @description 对齐方式 */ align?: 'left' | 'center' | 'right'; /** * @description 超出隐藏 */ overHidden?: boolean; /** * @description 帮助信息文本 */ help?: string; /** * @description 格式化内容 * @param row 行数据 * @param column 列信息 * @param index 行索引 * @returns */ formatter?: (row: any, column: ITableColumn, index: number) => VNode | string; /** * @description 列宽度 */ width?: number; /** * @description 二维码宽度,默认70 */ qrcodeWidth?: number; /** * @description 二维码高度,默认70 */ qrcodeHeight?: number; /** * 一维码宽度,默认2 */ barcodeWith?: number; /** * 一维码高度,默认50 */ barcodeHeight?: number; } export interface ITableColumn extends ICommonColumn, ITableCommonColumn { /** * @description 类型 */ type?: ColumnType | 'index' | 'single' | 'selection'; /** * @description 仅对 type=selection 的列有效,类型为 Function,Function 的返回值用来决定这一行的 CheckBox 是否可以勾选 * @param row 行数据 * @param index 索引 * @returns */ selectable?: (row: any, index: number) => boolean; /** * @description 对应列是否可以排序, 如果设置为 'custom',则代表用户希望远程排序,需要监听 Table 的 sort-change 事件 */ sortable?: boolean | string; } /** * @description 公开的table配置 */ export interface ITableCommonOption { /** * @description 是否显示操作栏 */ menu?: boolean; /** * @description 是否为斑马纹 */ stripe?: boolean; /** * @description 是否带有纵向边框 */ border?: boolean; /** * @description 操作栏宽度 */ menuWidth?: number; /** * @description 操作栏列冻结列 ,true 表示固定在左侧 */ menuFixed?: true | 'left' | 'right'; /** * @description 操作栏按钮的对齐方式 */ menuAlign?: 'left' | 'center' | 'right'; /** * @description 操作栏标题名称 */ menuTitle?: string; /** * @description 表格rowKey */ rowKey?: string; } export interface ITableOption extends ITableCommonOption { /** * @description 列配置 */ column: ITableColumn[]; } export declare const tableProps: { readonly size: { readonly type: import("vue").PropType>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly loading: import("m-eleplus-crud/es/utils").EpPropFinalized; readonly data: { readonly type: import("vue").PropType; readonly required: true; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly select: { readonly type: import("vue").PropType; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly option: { readonly type: import("vue").PropType; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly permission: import("m-eleplus-crud/es/utils").EpPropFinalized; readonly height: { readonly type: import("vue").PropType; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly maxHeight: { readonly type: import("vue").PropType; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; }; export type TableProps = ExtractPropTypes; export declare const tableEmits: { 'update:select': (arr: any[]) => boolean; /** * 表格自定义排序模式下排序变化触发 * @param data * @returns */ sortChange: (data: { column: any; prop: string; order: any; }) => boolean; /** * 表格选择数据触发 * @param arr 选择的数据 * @returns */ selectionChange: (arr: any[]) => boolean; }; export type TableEmits = typeof tableEmits;