diff --git a/src/api/table.ts b/src/api/table.ts new file mode 100644 index 0000000..17b8f28 --- /dev/null +++ b/src/api/table.ts @@ -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 + }) +} diff --git a/src/router/index.ts b/src/router/index.ts index 5b7d48f..78bfc88 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -87,6 +87,34 @@ export const constantRoutes: RouteRecordRaw[] = [ } ] }, + { + path: "/table", + component: Layout, + redirect: "/table/element-plus", + name: "Table", + meta: { + title: "表格", + elIcon: "Grid" + }, + children: [ + { + path: "element-plus", + component: () => import("@/views/table/element-plus/index.vue"), + name: "ElementPlus", + meta: { + title: "element-plus" + } + }, + { + path: "vxe-table", + component: () => import("@/views/table/vxe-table/index.vue"), + name: "VxeTable", + meta: { + title: "vxe-table" + } + } + ] + }, { path: "/menu", component: Layout, diff --git a/src/views/table/element-plus/index.vue b/src/views/table/element-plus/index.vue new file mode 100644 index 0000000..22d6413 --- /dev/null +++ b/src/views/table/element-plus/index.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/src/views/table/vxe-table/index.vue b/src/views/table/vxe-table/index.vue new file mode 100644 index 0000000..88505c8 --- /dev/null +++ b/src/views/table/vxe-table/index.vue @@ -0,0 +1,7 @@ + + + + +