diff --git a/src/components/Table/src/components/editable/index.ts b/src/components/Table/src/components/editable/index.ts index e8ac140..fb5d15a 100644 --- a/src/components/Table/src/components/editable/index.ts +++ b/src/components/Table/src/components/editable/index.ts @@ -65,5 +65,5 @@ export type EditRecordRow = Partial< cancelCbs: Fn[] validCbs: Fn[] editValueRefs: Recordable - } & T -> + } +> & T diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts index 32d96de..006d836 100644 --- a/src/components/Table/src/types/table.ts +++ b/src/components/Table/src/types/table.ts @@ -1,6 +1,7 @@ import type { VNodeChild } from 'vue' import type { TableRowSelection as ITableRowSelection, Key } from 'ant-design-vue/lib/table/interface' import type { ColumnProps } from 'ant-design-vue/lib/table' +import type { EditRecordRow } from '../components/editable' import type { PaginationProps } from './pagination' import type { ComponentType } from './componentType' @@ -86,7 +87,7 @@ export type SizeType = 'default' | 'middle' | 'small' | 'large' export interface TableActionType { reload: (opt?: FetchParams) => Promise setSelectedRows: (rows: Recordable[]) => void - getSelectRows: () => T[] + getSelectRows: () => EditRecordRow[] clearSelectedRowKeys: () => void expandAll: () => void expandRows: (keys: (string | number)[]) => void @@ -96,13 +97,13 @@ export interface TableActionType { deleteSelectRowByKey: (key: string) => void setPagination: (info: Partial) => void setTableData: (values: T[]) => void - updateTableDataRecord: (rowKey: string | number, record: T) => T | void + updateTableDataRecord: (rowKey: string | number, record: T) => EditRecordRow | void deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => void - insertTableDataRecord: (record: T | T[], index?: number) => T[] | void - findTableDataRecord: (rowKey: string | number) => T | void + insertTableDataRecord: (record: T | T[], index?: number) => EditRecordRow[] | void + findTableDataRecord: (rowKey: string | number) => EditRecordRow | void getColumns: (opt?: GetColumnsParams) => BasicColumn[] setColumns: (columns: BasicColumn[] | string[]) => void - getDataSource: () => T[] + getDataSource: () => EditRecordRow[] getRawDataSource: () => T setLoading: (loading: boolean) => void setProps: (props: Partial) => void @@ -110,10 +111,10 @@ export interface TableActionType { setSelectedRowKeys: (rowKeys: Key[]) => void getPaginationRef: () => PaginationProps | boolean getSize: () => SizeType - getRowSelection: () => TableRowSelection + getRowSelection: () => TableRowSelection> getCacheColumns: () => BasicColumn[] emit?: EmitType - updateTableData: (index: number, key: K, value: T[K]) => Promise + updateTableData: (index: number, key: K, value: T[K]) => Promise> setShowPagination: (show: boolean) => Promise getShowPagination: () => boolean setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void