From 64d2079779a3f0902b6e29fcc0d12b7a89f4f29d Mon Sep 17 00:00:00 2001
From: Kven <2955163637@qq.com>
Date: Sun, 2 Mar 2025 17:53:03 +0800
Subject: [PATCH] =?UTF-8?q?refactor.dashboard:=20=E9=87=8D=E6=9E=84?=
=?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除欢迎信息和分割线
- 添加产品数、设备数等统计卡片
- 新增链式图表组件
- 更新数据面板布局和样式
- 添加设备上报记录功能
-优化地图组件
- 调整产品属性表格
---
src/api/dashboard.ts | 22 ++
src/api/device.ts | 11 +-
.../dashboard/workplace/components/banner.vue | 14 +-
.../workplace/components/chain-item.vue | 264 ++++++++++++++++
.../workplace/components/data-panel.vue | 295 +++++++++++-------
src/views/dashboard/workplace/index.vue | 38 +--
.../iot/device/components/device-detail.vue | 23 +-
src/views/iot/deviceMap/index.vue | 84 +++--
.../iot/product/components/product-tsl.vue | 9 +-
9 files changed, 564 insertions(+), 196 deletions(-)
create mode 100644 src/api/dashboard.ts
create mode 100644 src/views/dashboard/workplace/components/chain-item.vue
diff --git a/src/api/dashboard.ts b/src/api/dashboard.ts
new file mode 100644
index 0000000..c26bbf5
--- /dev/null
+++ b/src/api/dashboard.ts
@@ -0,0 +1,22 @@
+import axios from 'axios';
+
+
+// 获取设备信息
+export function getDeviceInfo() {
+ return axios.get('/api/rest/device/status');
+}
+
+// 获取消息信息
+export function getMessageInfo() {
+ return axios.get('/api/rest/device/record/status');
+}
+
+// 获取告警信息
+export function getAlarmInfo() {
+ return axios.get('/api/rest/device/data/status');
+}
+
+// 获取产品信息
+export function getProductInfo() {
+ return axios.get('/api/rest/product/status');
+}
\ No newline at end of file
diff --git a/src/api/device.ts b/src/api/device.ts
index ec478bf..6d3e98d 100644
--- a/src/api/device.ts
+++ b/src/api/device.ts
@@ -32,11 +32,12 @@ export interface DeviceUpdateRecord extends DeviceCreateRecord {
export interface DeviceEventRecord {
id: number;
- clientId: string;
+ clientId: number;
serveName: string;
params: string;
}
+
// 分页查询
export function queryDeviceList(data: DeviceRecord) {
return axios({
@@ -74,11 +75,11 @@ export function deleteDevice(id: number) {
}
// 查询上报
-export function queryDeviceReport(clientId: number) {
+export function queryDeviceRecord(data: DeviceRecord) {
return axios({
- url: `/api/rest/device/record/photo`,
+ url: `/api/rest/device/record/data`,
method: 'get',
- params: clientId,
+ params: data,
});
}
@@ -95,3 +96,5 @@ export function triggerEvent(data: DeviceEventRecord) {
data,
});
}
+
+
diff --git a/src/views/dashboard/workplace/components/banner.vue b/src/views/dashboard/workplace/components/banner.vue
index 00b5534..beee271 100644
--- a/src/views/dashboard/workplace/components/banner.vue
+++ b/src/views/dashboard/workplace/components/banner.vue
@@ -1,11 +1,11 @@
-
-
-
-