mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 08:36:19 +08:00
feat(table): add table component
This commit is contained in:
20
src/api/demo/model/tableModel.ts
Normal file
20
src/api/demo/model/tableModel.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
|
||||
/**
|
||||
* @description: 请求列表接口参数
|
||||
*/
|
||||
export type DemoParams = BasicPageParams;
|
||||
|
||||
export interface DemoListItem {
|
||||
id: string;
|
||||
beginTime: string;
|
||||
endTime: string;
|
||||
address: string;
|
||||
name: string;
|
||||
no: number;
|
||||
status: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 请求列表返回值
|
||||
*/
|
||||
export type DemoListGetResultModel = BasicFetchResult<DemoListItem>;
|
17
src/api/demo/table.ts
Normal file
17
src/api/demo/table.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { DemoParams, DemoListGetResultModel } from './model/tableModel';
|
||||
|
||||
enum Api {
|
||||
DEMO_LIST = '/table/getDemoList',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取示例列表值
|
||||
*/
|
||||
export function demoListApi(params: DemoParams) {
|
||||
return defHttp.request<DemoListGetResultModel>({
|
||||
url: Api.DEMO_LIST,
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
9
src/api/model/baseModel.ts
Normal file
9
src/api/model/baseModel.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface BasicPageParams {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
export interface BasicFetchResult<T extends any> {
|
||||
items: T;
|
||||
total: number;
|
||||
}
|
Reference in New Issue
Block a user