UNPKG

@aplus-frontend/ui

Version:

46 lines (45 loc) 1.28 kB
import { ColumnsType } from '@aplus-frontend/antdv/es/table'; import { AlignType, DataIndex, Key } from '@aplus-frontend/antdv/es/vc-table/interface'; import { ApColumnType } from '../../ap-table'; import { ApGridColumnType } from '../../ap-grid'; import { AgGridColumnType } from '../../ag-grid'; export type SummaryColumnType = ApColumnType[] | ApGridColumnType[] | AgGridColumnType[] | ColumnsType | any[]; export type ValueType = { [key in string]: any; }; export interface ApSummaryProps { data?: ValueType; columns: SummaryColumnType; /** * @default 合计 */ summaryTitle?: string; /** * @default true */ hasSelect?: boolean; size?: 'middle' | 'small'; } export interface SummaryItemType { key: any | undefined; rowSpan: number; align?: AlignType | undefined; value: any; } export interface SumConfig { /** * 优先用 columns 的dataIndex做对比,再用 key 做对比 */ key: Key; dataIndex: DataIndex | undefined; } export interface ComputedRecordParams<T> { records: T[]; columns: SummaryColumnType; configList?: SumConfig[]; /** * 排出 在 columns 和 configList中相同key 的配置项 */ exclude?: Key[]; valueTypeExtension?: string[]; }