From 8f0d7ba9a7646e8721daa2fef13da6050671af5f Mon Sep 17 00:00:00 2001 From: Seven Date: Wed, 17 Dec 2025 17:04:42 +0700 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A8=E6=A0=BC=E5=88=97?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89=EF=BC=8C=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E6=93=8D=E4=BD=9C=E5=88=97=E7=9A=84=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/table/index.ts | 24 ++++++++++++------------ src/views/withdraw/fiat/index.vue | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/table/index.ts b/src/components/table/index.ts index 9874577..5bc490d 100644 --- a/src/components/table/index.ts +++ b/src/components/table/index.ts @@ -1,17 +1,17 @@ import { h } from 'vue'; -import type { ButtonProps, DataTableColumns } from 'naive-ui'; +import type { ButtonProps, DataTableColumn, DataTableColumns } from 'naive-ui'; import { NButton, NSpace } from 'naive-ui'; -import type { TableColumn } from 'naive-ui/es/data-table/src/interface'; +import type { InternalRowData } from 'naive-ui/es/data-table/src/interface'; import type { safeClient } from '@/service/api'; import type TableBase from './table-base.vue'; -export type TableBaseColumns = Array< - TableColumn & { - operations?: (row: T) => Array & { contentText: string }>; - key: string; - title: string; - } ->; +type TableBaseColumn = DataTableColumn & { + operations?: (row: T) => Array & { contentText: string }>; + key: string; + title: string; +}; + +export type TableBaseColumns = Array>; export type TableInst = InstanceType; @@ -22,7 +22,7 @@ export interface Pagination { export type TableFetchData = (page: Pagination) => ReturnType; -export function transformColumns(columns: TableBaseColumns): DataTableColumns { +export function transformColumns(columns: TableBaseColumns): DataTableColumns { return columns.map(col => { return { ...col, @@ -31,8 +31,8 @@ export function transformColumns(columns: TableBaseColumns): DataTab h(NSpace, null, { default: () => col.operations!(row).map(item => h(NButton, item, { default: () => item.contentText })) }) - : undefined - } as TableColumn; + : (col as any).render + } as TableBaseColumn; }); } diff --git a/src/views/withdraw/fiat/index.vue b/src/views/withdraw/fiat/index.vue index 85152a8..f6b3ef5 100644 --- a/src/views/withdraw/fiat/index.vue +++ b/src/views/withdraw/fiat/index.vue @@ -23,7 +23,7 @@ const columns: TableBaseColumns = [ title: '操作', fixed: 'right', key: 'operation', - operations: (row: any) => [ + operations: row => [ { contentText: '处理', type: 'primary',