diff --git a/src/components/Table/src/hooks/useCustomRow.ts b/src/components/Table/src/hooks/useCustomRow.ts index 90ce988..2e70e43 100644 --- a/src/components/Table/src/hooks/useCustomRow.ts +++ b/src/components/Table/src/hooks/useCustomRow.ts @@ -1,12 +1,13 @@ import type { ComputedRef } from 'vue' import { unref } from 'vue' +import type { Key } from 'ant-design-vue/lib/table/interface' import type { BasicTableProps } from '../types/table' import { ROW_KEY } from '../const' import { isFunction, isString } from '@/utils/is' interface Options { - setSelectedRowKeys: (keys: string[]) => void - getSelectRowKeys: () => string[] + setSelectedRowKeys: (keys: Key[]) => void + getSelectRowKeys: () => Key[] clearSelectedRowKeys: () => void emit: EmitType getAutoCreateKey: ComputedRef diff --git a/src/components/Table/src/hooks/useTable.ts b/src/components/Table/src/hooks/useTable.ts index 5e8b3c9..07983fe 100644 --- a/src/components/Table/src/hooks/useTable.ts +++ b/src/components/Table/src/hooks/useTable.ts @@ -163,8 +163,8 @@ export function useTable(tableProps?: Props): [ scrollTo: (pos: string) => { getTableInstance().scrollTo(pos) }, - setShowForm: async (show: boolean) => { - await getTableInstance().setShowForm(show) + setShowForm: async (flag: boolean) => { + await getTableInstance().setShowForm(flag) }, getShowForm: () => { return toRaw(getTableInstance().getShowForm()) diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts index d778787..f8ea22a 100644 --- a/src/components/Table/src/types/table.ts +++ b/src/components/Table/src/types/table.ts @@ -86,7 +86,7 @@ export interface TableActionType { expandRows: (keys: (string | number)[]) => void collapseAll: () => void scrollTo: (pos: string) => void // pos: id | "top" | "bottom" - getSelectRowKeys: () => string[] + getSelectRowKeys: () => Key[] deleteSelectRowByKey: (key: string) => void setPagination: (info: Partial) => void setTableData: []>>(values: T[]) => void @@ -108,11 +108,11 @@ export interface TableActionType { getCacheColumns: () => BasicColumn[] emit?: EmitType updateTableData: (index: number, key: string, value: any) => Recordable - setShowPagination: (show: boolean) => Promise + setShowPagination: (show: boolean) => void getShowPagination: () => boolean setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void setCacheColumns?: (columns: BasicColumn[]) => void - setShowForm: (show: boolean) => Promise + setShowForm: (flag: boolean) => void getShowForm: () => boolean } @@ -403,6 +403,7 @@ export interface BasicTableProps { export type CellFormat = string | ((text: string, record: Recordable, index: number) => string | number) | Map +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error export interface BasicColumn extends ColumnProps { children?: BasicColumn[]