From 26e6d287f5f60b1026f1bb89e554de103a7ca1bf Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 12 Nov 2023 19:50:38 +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=20one=20=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 72c5eaae31fd37dcfcd016224351237a9e2004d7) --- src/api/infra/demo01/index.ts | 43 +++ src/api/infra/demo02/index.ts | 14 + src/components/UploadFile/src/UploadFile.vue | 2 +- src/views/infra/demo01/Demo01StudentForm.vue | 150 +++++++++++ src/views/infra/demo01/index.vue | 251 ++++++++++++++++++ .../infra/demo02/DemoStudentAddressForm.vue | 100 +++++-- .../infra/demo02/DemoStudentContactForm.vue | 158 ++++++----- src/views/infra/demo02/DemoStudentForm.vue | 35 +-- .../demo02/bak/DemoStudentAddressForm.vue | 58 ++++ 9 files changed, 702 insertions(+), 109 deletions(-) create mode 100644 src/api/infra/demo01/index.ts create mode 100644 src/views/infra/demo01/Demo01StudentForm.vue create mode 100644 src/views/infra/demo01/index.vue create mode 100644 src/views/infra/demo02/bak/DemoStudentAddressForm.vue diff --git a/src/api/infra/demo01/index.ts b/src/api/infra/demo01/index.ts new file mode 100644 index 00000000..0154bc29 --- /dev/null +++ b/src/api/infra/demo01/index.ts @@ -0,0 +1,43 @@ +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/api/infra/demo02/index.ts b/src/api/infra/demo02/index.ts index b575dba4..500adde5 100644 --- a/src/api/infra/demo02/index.ts +++ b/src/api/infra/demo02/index.ts @@ -33,3 +33,17 @@ export const deleteDemoStudent = async (id: number) => { export const exportDemoStudent = async (params) => { return await request.download({ url: `/infra/demo-student/export-excel`, params }) } + +// 获得学生联系人列表 +export const getDemoStudentContactListByStudentId = async (studentId) => { + return await request.get({ + url: `/infra/demo-student/demo-student/list-by-student-id?studentId=` + studentId + }) +} + +// 获得学生地址 +export const getDemoStudentAddressByStudentId = async (studentId) => { + return await request.get({ + url: `/infra/demo-student/demo-student/get-by-student-id?studentId=` + studentId + }) +} diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index bba466a7..c1f3e4e2 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -144,7 +144,7 @@ watch( } else if (isArray(props.modelValue)) { // 情况2:字符串 files.concat(props.modelValue) - } else if (props.modelValue === undefined) { + } else if (props.modelValue == null) { // 情况3:undefined 不处理 } else { throw new Error('不支持的 modelValue 类型') diff --git a/src/views/infra/demo01/Demo01StudentForm.vue b/src/views/infra/demo01/Demo01StudentForm.vue new file mode 100644 index 00000000..dfc9823d --- /dev/null +++ b/src/views/infra/demo01/Demo01StudentForm.vue @@ -0,0 +1,150 @@ + + diff --git a/src/views/infra/demo01/index.vue b/src/views/infra/demo01/index.vue new file mode 100644 index 00000000..fb35b561 --- /dev/null +++ b/src/views/infra/demo01/index.vue @@ -0,0 +1,251 @@ + + + \ No newline at end of file diff --git a/src/views/infra/demo02/DemoStudentAddressForm.vue b/src/views/infra/demo02/DemoStudentAddressForm.vue index af4cd8f1..6d031406 100644 --- a/src/views/infra/demo02/DemoStudentAddressForm.vue +++ b/src/views/infra/demo02/DemoStudentAddressForm.vue @@ -6,39 +6,107 @@ label-width="100px" v-loading="formLoading" > - - + + - - + + - - + + + + + + + + + {{ dict.label }} + + + + + + + {{ dict.label }} + + + + + + + +