From d9b9a76ac1c5fedc928c9cf912009b5de3270ed0 Mon Sep 17 00:00:00 2001 From: wenshijun Date: Wed, 15 Apr 2026 17:07:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BC=A0=E6=84=9F=E5=99=A8?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E4=BF=AE=E6=94=B9=20=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/worn/socket.js | 17 ++ src/views/index.vue | 121 +++++++- src/views/worn/warehouseDashboard/index.vue | 312 ++++++++++++++++++-- 3 files changed, 423 insertions(+), 27 deletions(-) create mode 100644 src/api/worn/socket.js diff --git a/src/api/worn/socket.js b/src/api/worn/socket.js new file mode 100644 index 0000000..4dd043f --- /dev/null +++ b/src/api/worn/socket.js @@ -0,0 +1,17 @@ +import request from '@/utils/request' + +// 智能排风远程开关 +export function controlSocket(data) { + const payload = { + devEui: data.devEui, + deviceId: data.deviceId, + status: data.status + } + + return request({ + url: '/worn/socket/control', + method: 'post', + params: payload, + data: payload + }) +} diff --git a/src/views/index.vue b/src/views/index.vue index b5245ff..4fba2bb 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -51,8 +51,25 @@
{{ exceptionStats.total }} + 累计告警数 累计告警
+
+
+
+ + 红色:告警 +
+
+ + 橙色:预警 +
+
+ + 绿色:正常 +
+
+
@@ -1032,13 +1049,36 @@ onBeforeUnmount(() => { } .donut-card { - display: grid; - place-items: center; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; min-height: 184px; + padding: 20px 18px; + gap: 18px; +} + +.donut-head { + display: flex; + flex-direction: column; + gap: 4px; + text-align: left; + + strong { + font-size: 14px; + color: #0f172a; + } + + span { + font-size: 12px; + color: #64748b; + } } .donut { + position: relative; display: grid; + flex: 0 0 110px; width: 110px; height: 110px; place-items: center; @@ -1062,17 +1102,90 @@ onBeforeUnmount(() => { } strong { - font-size: 24px; + font-size: 28px; + font-weight: 900; color: #0f172a; } + .donut-total-tag { + position: relative; + z-index: 1; + margin-top: 2px; + font-size: 10px; + font-style: normal; + font-weight: 700; + color: #94a3b8; + } + span { - margin-top: 24px; + margin-top: 4px; font-size: 11px; + font-weight: 700; color: #64748b; } } +.donut-info { + display: flex; + flex: 1; + flex-direction: column; + justify-content: center; + gap: 12px; + min-width: 0; +} + +.donut-legend { + display: grid; + gap: 10px; +} + +.legend-item { + display: flex; + align-items: center; + gap: 8px; + min-height: 34px; + padding: 8px 10px; + font-size: 12px; + color: #334155; + background: rgba(255, 255, 255, 0.72); + border: 1px solid rgba(226, 232, 240, 0.82); + border-radius: 12px; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86); + + i { + width: 10px; + height: 10px; + border-radius: 50%; + } + + &.danger i { + background: #ef4444; + } + + &.warning i { + background: #f59e0b; + } + + &.normal i { + background: #22c55e; + } +} + +@media (max-width: 1200px) { + .donut-card { + flex-direction: column; + align-items: center; + } + + .donut-head { + text-align: center; + } + + .donut-info { + width: 100%; + } +} + .alarm-list { flex: 1; min-height: 118px; diff --git a/src/views/worn/warehouseDashboard/index.vue b/src/views/worn/warehouseDashboard/index.vue index 872f120..e6d8e2a 100644 --- a/src/views/worn/warehouseDashboard/index.vue +++ b/src/views/worn/warehouseDashboard/index.vue @@ -57,6 +57,24 @@

{{ item.locationName }}

{{ item.typeName }}

{{ item.summary }} +
+ + +
@@ -87,8 +105,11 @@