feat: 新增 Element Plus Table 示例

This commit is contained in:
pany
2022-10-20 20:58:57 +08:00
parent e7e1c4270b
commit f3fd669cad
4 changed files with 345 additions and 0 deletions

57
src/api/table.ts Normal file
View File

@@ -0,0 +1,57 @@
import { request } from "@/utils/service"
interface ICreateTableDataApi {
username: string
password: string
}
interface IUpdateTableDataApi {
id: number
username: string
password?: string
}
interface IGetTableDataApi {
/** 当前页码 */
currentPage: number
/** 查询条数 */
size: number
/** 查询参数 */
username?: string
phone?: string
}
/** 增 */
export function createTableDataApi(data: ICreateTableDataApi) {
return request({
url: "table",
method: "post",
data
})
}
/** 删 */
export function deleteTableDataApi(id: number) {
return request({
url: `table/${id}`,
method: "delete"
})
}
/** 改 */
export function updateTableDataApi(data: IUpdateTableDataApi) {
return request({
url: "table",
method: "put",
data
})
}
/** 查 */
export function getTableDataApi(params: IGetTableDataApi) {
return request({
url: "table",
method: "get",
params
})
}