From 8d3afa3920366181a23f2ece71dde1abf8eb71a1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 7 Dec 2024 16:42:38 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E3=80=91IoT=EF=BC=9A=E4=BA=A7=E5=93=81=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=9A=84=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/product/category/index.ts | 38 ++++ .../product/category/ProductCategoryForm.vue | 119 ++++++++++++ src/views/iot/product/category/index.vue | 170 ++++++++++++++++++ 3 files changed, 327 insertions(+) create mode 100644 src/api/iot/product/category/index.ts create mode 100644 src/views/iot/product/category/ProductCategoryForm.vue create mode 100644 src/views/iot/product/category/index.vue diff --git a/src/api/iot/product/category/index.ts b/src/api/iot/product/category/index.ts new file mode 100644 index 00000000..f2e377d4 --- /dev/null +++ b/src/api/iot/product/category/index.ts @@ -0,0 +1,38 @@ +import request from '@/config/axios' + +// IoT 产品分类 VO +export interface ProductCategoryVO { + id: number // 分类 ID + name: string // 分类名字 + sort: number // 分类排序 + status: number // 分类状态 + description: string // 分类描述 +} + +// IoT 产品分类 API +export const ProductCategoryApi = { + // 查询产品分类分页 + getProductCategoryPage: async (params: any) => { + return await request.get({ url: `/iot/product-category/page`, params }) + }, + + // 查询产品分类详情 + getProductCategory: async (id: number) => { + return await request.get({ url: `/iot/product-category/get?id=` + id }) + }, + + // 新增产品分类 + createProductCategory: async (data: ProductCategoryVO) => { + return await request.post({ url: `/iot/product-category/create`, data }) + }, + + // 修改产品分类 + updateProductCategory: async (data: ProductCategoryVO) => { + return await request.put({ url: `/iot/product-category/update`, data }) + }, + + // 删除产品分类 + deleteProductCategory: async (id: number) => { + return await request.delete({ url: `/iot/product-category/delete?id=` + id }) + } +} diff --git a/src/views/iot/product/category/ProductCategoryForm.vue b/src/views/iot/product/category/ProductCategoryForm.vue new file mode 100644 index 00000000..ff721922 --- /dev/null +++ b/src/views/iot/product/category/ProductCategoryForm.vue @@ -0,0 +1,119 @@ + + diff --git a/src/views/iot/product/category/index.vue b/src/views/iot/product/category/index.vue new file mode 100644 index 00000000..e7826221 --- /dev/null +++ b/src/views/iot/product/category/index.vue @@ -0,0 +1,170 @@ + + +