From f7ef4fe1ddf1a7a38717188444e760154b7bb906 Mon Sep 17 00:00:00 2001
From: Kven <2955163637@qq.com>
Date: Mon, 6 Jan 2025 11:03:30 +0800
Subject: [PATCH] =?UTF-8?q?perf(iot=E4=BA=A7=E5=93=81=E4=B8=8E=E8=AE=BE?=
=?UTF-8?q?=E5=A4=87=E6=A8=A1=E5=9D=97):=20=E4=BC=98=E5=8C=96=E4=BA=A7?=
=?UTF-8?q?=E5=93=81=E4=B8=8E=E8=AE=BE=E5=A4=87=E7=9A=84=E5=A2=9E=E5=88=A0?=
=?UTF-8?q?=E6=94=B9=E6=9F=A5=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1.优化产品新增功能
2.优化设备新增功能
3.新增产品详情功能
4.新增设备详情功能
---
src/api/product.ts | 2 +-
src/router/routes/modules/iot.ts | 13 +-
.../iot/device/components/device-detail.vue | 70 +++++++++
src/views/iot/device/index.vue | 22 +--
.../iot/product/components/product-detail.vue | 135 ++++++++++++++++++
src/views/iot/product/index.vue | 3 +-
6 files changed, 232 insertions(+), 13 deletions(-)
create mode 100644 src/views/iot/device/components/device-detail.vue
create mode 100644 src/views/iot/product/components/product-detail.vue
diff --git a/src/api/product.ts b/src/api/product.ts
index c71d190..5c51f22 100644
--- a/src/api/product.ts
+++ b/src/api/product.ts
@@ -47,7 +47,7 @@ export function queryProductListAll(data: ProductRecord) {
}
// 查看详情
-export function queryProductDetail(id: number) {
+export function queryProductDetail(id: number | undefined) {
return axios.get(`/api/rest/product/${id}`);
}
diff --git a/src/router/routes/modules/iot.ts b/src/router/routes/modules/iot.ts
index 698c191..bc65654 100644
--- a/src/router/routes/modules/iot.ts
+++ b/src/router/routes/modules/iot.ts
@@ -34,7 +34,18 @@ const IOT: AppRouteRecordRaw = {
requiresAuth: true,
permissions: ['*'],
},
- }
+ },
+ {
+ path: 'product/:id',
+ name: 'productDetail',
+ component: () => import('@/views/iot/product/components/product-detail.vue'),
+ meta: {
+ title: '产品详情',
+ requiresAuth: true,
+ showInMenu: false,
+ permissions: ['*'],
+ },
+ },
],
};
diff --git a/src/views/iot/device/components/device-detail.vue b/src/views/iot/device/components/device-detail.vue
new file mode 100644
index 0000000..4d47e58
--- /dev/null
+++ b/src/views/iot/device/components/device-detail.vue
@@ -0,0 +1,70 @@
+
+
+
+ 详情
+
+
+
+ 设备详情
+
+ {{formData.productId}}
+ {{formData.hardwareVersion}}
+ {{formData.firmwareVersion}}
+ {{formData.extendParams}}
+
+
+
+
+ 确定
+
+
+
+
+
+
+
diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue
index 490266c..29470e9 100644
--- a/src/views/iot/device/index.vue
+++ b/src/views/iot/device/index.vue
@@ -162,16 +162,17 @@
{{ record.online == true? '是' : '否' }}
-
-
- 详情
-
+
+
+
+
+
+
+
+
+
+
+
{
return {
diff --git a/src/views/iot/product/components/product-detail.vue b/src/views/iot/product/components/product-detail.vue
new file mode 100644
index 0000000..e16d117
--- /dev/null
+++ b/src/views/iot/product/components/product-detail.vue
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+ {{renderData.name}}
+ {{renderData.productType}}
+ {{renderData.model}}
+ {{renderData.link}}
+ {{renderData.remark}}
+ {{dayjs(renderData.createTime).format('YYYY-MM-DD HH:mm:ss')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/product/index.vue b/src/views/iot/product/index.vue
index 7312327..431fbcb 100644
--- a/src/views/iot/product/index.vue
+++ b/src/views/iot/product/index.vue
@@ -173,6 +173,7 @@
详情