diff --git a/src/api/infra/demo/demo02/index.ts b/src/api/infra/demo/demo02/index.ts new file mode 100644 index 00000000..21e45c90 --- /dev/null +++ b/src/api/infra/demo/demo02/index.ts @@ -0,0 +1,37 @@ +import request from '@/config/axios' + +export interface Demo02CategoryVO { + id: number + name: string + parentId: number +} + +// 查询示例分类列表 +export const getDemo02CategoryList = async (params) => { + return await request.get({ url: `/infra/demo02-category/list`, params }) +} + +// 查询示例分类详情 +export const getDemo02Category = async (id: number) => { + return await request.get({ url: `/infra/demo02-category/get?id=` + id }) +} + +// 新增示例分类 +export const createDemo02Category = async (data: Demo02CategoryVO) => { + return await request.post({ url: `/infra/demo02-category/create`, data }) +} + +// 修改示例分类 +export const updateDemo02Category = async (data: Demo02CategoryVO) => { + return await request.put({ url: `/infra/demo02-category/update`, data }) +} + +// 删除示例分类 +export const deleteDemo02Category = async (id: number) => { + return await request.delete({ url: `/infra/demo02-category/delete?id=` + id }) +} + +// 导出示例分类 Excel +export const exportDemo02Category = async (params) => { + return await request.download({ url: `/infra/demo02-category/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 deleted file mode 100644 index 500adde5..00000000 --- a/src/api/infra/demo02/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import request from '@/config/axios' - -export interface DemoStudentVO { - id: number -} - -// 查询学生列表 -export const getDemoStudentPage = async (params) => { - return await request.get({ url: `/infra/demo-student/page`, params }) -} - -// 查询学生详情 -export const getDemoStudent = async (id: number) => { - return await request.get({ url: `/infra/demo-student/get?id=` + id }) -} - -// 新增学生 -export const createDemoStudent = async (data: DemoStudentVO) => { - return await request.post({ url: `/infra/demo-student/create`, data }) -} - -// 修改学生 -export const updateDemoStudent = async (data: DemoStudentVO) => { - return await request.put({ url: `/infra/demo-student/update`, data }) -} - -// 删除学生 -export const deleteDemoStudent = async (id: number) => { - return await request.delete({ url: `/infra/demo-student/delete?id=` + id }) -} - -// 导出学生 Excel -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/views/infra/demo02/DemoStudentForm.vue b/src/views/infra/demo/demo02/Demo02CategoryForm.vue similarity index 55% rename from src/views/infra/demo02/DemoStudentForm.vue rename to src/views/infra/demo/demo02/Demo02CategoryForm.vue index e9454c0f..9002d5ee 100644 --- a/src/views/infra/demo02/DemoStudentForm.vue +++ b/src/views/infra/demo/demo02/Demo02CategoryForm.vue @@ -6,16 +6,21 @@ :rules="formRules" label-width="100px" v-loading="formLoading" - /> - - - - - - - - - + > + + + + + + + + +/** 获得示例分类树 */ +const getDemo02CategoryTree = async () => { + demo02CategoryTree.value = [] + const data = await Demo02CategoryApi.getDemo02CategoryList() + const root: Tree = { id: 0, name: '顶级示例分类', children: [] } + root.children = handleTree(data, 'id', 'parentId') + demo02CategoryTree.value.push(root) +} + \ No newline at end of file diff --git a/src/views/infra/demo02/index.vue b/src/views/infra/demo/demo02/index.vue similarity index 51% rename from src/views/infra/demo02/index.vue rename to src/views/infra/demo/demo02/index.vue index 89fd656b..e46c77dc 100644 --- a/src/views/infra/demo02/index.vue +++ b/src/views/infra/demo/demo02/index.vue @@ -8,10 +8,35 @@ :inline="true" label-width="68px" > + + + + + + 搜索 重置 - + 新增 导出 + + 展开/折叠 + - + + + + \ No newline at end of file diff --git a/src/views/infra/demo02/DemoStudentAddressForm.vue b/src/views/infra/demo02/DemoStudentAddressForm.vue deleted file mode 100644 index 6d031406..00000000 --- a/src/views/infra/demo02/DemoStudentAddressForm.vue +++ /dev/null @@ -1,126 +0,0 @@ - - diff --git a/src/views/infra/demo02/DemoStudentContactForm.vue b/src/views/infra/demo02/DemoStudentContactForm.vue deleted file mode 100644 index 5f173f14..00000000 --- a/src/views/infra/demo02/DemoStudentContactForm.vue +++ /dev/null @@ -1,177 +0,0 @@ - - diff --git a/src/views/infra/demo02/bak/DemoStudentAddressForm.vue b/src/views/infra/demo02/bak/DemoStudentAddressForm.vue deleted file mode 100644 index af4cd8f1..00000000 --- a/src/views/infra/demo02/bak/DemoStudentAddressForm.vue +++ /dev/null @@ -1,58 +0,0 @@ - -