UNPKG

ci-plus

Version:

ci组件库

54 lines (52 loc) 1.77 kB
import { ColumnCls, TableColumnInstance, TableInstance } from 'element-plus' import ElDialog from 'element-plus/es/components/dialog' import { Component, Ref, h } from 'vue' export interface Scope<T> { row: T $index: number column: ColumnCls<T> } export type Mutable<T> = { -readonly [P in keyof T]: T[P] } export type Props<T> = Mutable< Partial<Omit<T, `$${string}` | `_${string}` | '$' | '_'>> > export type anyObj = { [key: string | number | symbol]: any } export interface SortColumn { hide?: boolean //是否显示列 ban?: boolean id?: number key?: string col: Props<TableColumnInstance> scope?(props: any): string component?: (createVNode: typeof h, data: Scope<any>) => Component header?: ( createVNode: typeof h, data: Pick<Scope<any>, '$index' | 'column'>, ) => Component children?: SortColumn[] } export type SortColumnSend = Pick<SortColumn, 'id' | 'hide'> & { children?: SortColumnSend[] fixed: TableColumnInstance['fixed'] ban: boolean } export interface SortableTableIns extends /* @vue-ignore */ Omit< Props<TableInstance>, 'data' | 'ref' | 'headerCellClassName' > { table?: /* @vue-ignore */ Props<TableInstance> | /* @vue-ignore */ Ref<Props<TableInstance>>['value'] modelValue: SortColumn[] | Ref<SortColumn[]>['value'] data: anyObj[] | Ref<anyObj[]>['value'] noMove?: boolean // 是否禁用表头拖拽(false) noSearch?: boolean //是否禁用配置项的header函数(false) } export interface SortableTableDialog { config?: /* @vue-ignore */ | Props<InstanceType<typeof ElDialog>> | /* @vue-ignore */ Ref<Props<InstanceType<typeof ElDialog>>>['value'] modelValue: SortColumn[] | Ref<SortColumn[]>['value'] }