From 40b1522ed0da116f361a17f9ba5d6ee5df021b16 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 15 Nov 2023 23:48:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20crud=20=E5=8D=95=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/infra/demo/demo01/index.ts | 40 +++++++++ src/api/infra/demo01/index.ts | 43 ---------- .../demo01/Demo01ContactForm.vue} | 84 +++++++------------ src/views/infra/{ => demo}/demo01/index.vue | 78 +++++------------ 4 files changed, 92 insertions(+), 153 deletions(-) create mode 100644 src/api/infra/demo/demo01/index.ts delete mode 100644 src/api/infra/demo01/index.ts rename src/views/infra/{demo01/Demo01StudentForm.vue => demo/demo01/Demo01ContactForm.vue} (62%) rename src/views/infra/{ => demo}/demo01/index.vue (72%) diff --git a/src/api/infra/demo/demo01/index.ts b/src/api/infra/demo/demo01/index.ts new file mode 100644 index 00000000..1a4b01ca --- /dev/null +++ b/src/api/infra/demo/demo01/index.ts @@ -0,0 +1,40 @@ +import request from '@/config/axios' + +export interface Demo01ContactVO { + id: number + name: string + sex: number + birthday: Date + description: string + avatar: string +} + +// 查询示例联系人分页 +export const getDemo01ContactPage = async (params) => { + return await request.get({ url: `/infra/demo01-contact/page`, params }) +} + +// 查询示例联系人详情 +export const getDemo01Contact = async (id: number) => { + return await request.get({ url: `/infra/demo01-contact/get?id=` + id }) +} + +// 新增示例联系人 +export const createDemo01Contact = async (data: Demo01ContactVO) => { + return await request.post({ url: `/infra/demo01-contact/create`, data }) +} + +// 修改示例联系人 +export const updateDemo01Contact = async (data: Demo01ContactVO) => { + return await request.put({ url: `/infra/demo01-contact/update`, data }) +} + +// 删除示例联系人 +export const deleteDemo01Contact = async (id: number) => { + return await request.delete({ url: `/infra/demo01-contact/delete?id=` + id }) +} + +// 导出示例联系人 Excel +export const exportDemo01Contact = async (params) => { + return await request.download({ url: `/infra/demo01-contact/export-excel`, params }) +} \ No newline at end of file diff --git a/src/api/infra/demo01/index.ts b/src/api/infra/demo01/index.ts deleted file mode 100644 index 0154bc29..00000000 --- a/src/api/infra/demo01/index.ts +++ /dev/null @@ -1,43 +0,0 @@ -import request from '@/config/axios' - -export interface Demo01StudentVO { - id: number - name: string - description: string - birthday: Date - sex: number - enabled: boolean - avatar: string - video: string - memo: string -} - -// 查询学生列表 -export const getDemo01StudentPage = async (params) => { - return await request.get({ url: `/infra/demo01-student/page`, params }) -} - -// 查询学生详情 -export const getDemo01Student = async (id: number) => { - return await request.get({ url: `/infra/demo01-student/get?id=` + id }) -} - -// 新增学生 -export const createDemo01Student = async (data: Demo01StudentVO) => { - return await request.post({ url: `/infra/demo01-student/create`, data }) -} - -// 修改学生 -export const updateDemo01Student = async (data: Demo01StudentVO) => { - return await request.put({ url: `/infra/demo01-student/update`, data }) -} - -// 删除学生 -export const deleteDemo01Student = async (id: number) => { - return await request.delete({ url: `/infra/demo01-student/delete?id=` + id }) -} - -// 导出学生 Excel -export const exportDemo01Student = async (params) => { - return await request.download({ url: `/infra/demo01-student/export-excel`, params }) -} \ No newline at end of file diff --git a/src/views/infra/demo01/Demo01StudentForm.vue b/src/views/infra/demo/demo01/Demo01ContactForm.vue similarity index 62% rename from src/views/infra/demo01/Demo01StudentForm.vue rename to src/views/infra/demo/demo01/Demo01ContactForm.vue index dfc9823d..0452a3c0 100644 --- a/src/views/infra/demo01/Demo01StudentForm.vue +++ b/src/views/infra/demo/demo01/Demo01ContactForm.vue @@ -10,31 +10,10 @@ - - - - - - - - - - - - + @@ -42,15 +21,20 @@ - + + + + + + + - - - - - - + \ No newline at end of file diff --git a/src/views/infra/demo01/index.vue b/src/views/infra/demo/demo01/index.vue similarity index 72% rename from src/views/infra/demo01/index.vue rename to src/views/infra/demo/demo01/index.vue index fb35b561..55751e1b 100644 --- a/src/views/infra/demo01/index.vue +++ b/src/views/infra/demo/demo01/index.vue @@ -17,16 +17,6 @@ class="!w-240px" /> - - - - - - - - 新增 @@ -84,7 +59,7 @@ plain @click="handleExport" :loading="exportLoading" - v-hasPermi="['infra:demo01-student:export']" + v-hasPermi="['infra:demo01-contact:export']" > 导出 @@ -97,26 +72,20 @@ - - - - + + - - 编辑 @@ -138,7 +107,7 @@ link type="danger" @click="handleDelete(scope.row.id)" - v-hasPermi="['infra:demo01-student:delete']" + v-hasPermi="['infra:demo01-contact:delete']" > 删除 @@ -155,32 +124,29 @@ - +