更新 @riwa/api-types 依赖至 0.0.23,调整分页接口参数,优化表格组件的类型定义

This commit is contained in:
2025-12-17 17:10:48 +07:00
parent 8f0d7ba9a7
commit 27d6cef96e
5 changed files with 24 additions and 15 deletions

View File

@@ -5,19 +5,23 @@ import type { InternalRowData } from 'naive-ui/es/data-table/src/interface';
import type { safeClient } from '@/service/api';
import type TableBase from './table-base.vue';
type TableBaseColumn<T = InternalRowData> = DataTableColumn<T> & {
export type TableBaseExpandColumn<T = InternalRowData> = {
operations?: (row: T) => Array<Partial<ButtonProps> & { contentText: string }>;
key: string;
title: string;
};
type TableBaseColumn<T = InternalRowData> = DataTableColumn<T> & TableBaseExpandColumn<T>;
export type TableBaseColumns<T = InternalRowData> = Array<TableBaseColumn<T>>;
export type TableInst = InstanceType<typeof TableBase>;
export interface Pagination {
limit: number;
offset: number;
pageIndex: number;
pageSize: number;
total?: number;
[key: string]: any;
}
export type TableFetchData = (page: Pagination) => ReturnType<typeof safeClient>;