From c356bdeb6211ef70355b9c9ee49a0baf7c80e635 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 10 四月 2026 15:25:40 +0800
Subject: [PATCH] 新疆大罗素 1.环境页面实时展示优化

---
 src/views/inventoryManagement/environmentalMonitoring/index.vue |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/views/inventoryManagement/environmentalMonitoring/index.vue b/src/views/inventoryManagement/environmentalMonitoring/index.vue
index bda17b8..2092101 100644
--- a/src/views/inventoryManagement/environmentalMonitoring/index.vue
+++ b/src/views/inventoryManagement/environmentalMonitoring/index.vue
@@ -18,22 +18,22 @@
       <h3 class="panel-title">璁惧鐜鏁版嵁鍒楄〃</h3>
       <div class="sensor-table">
         <div class="sensor-table__head">
-          <span>璁惧</span>
+          <span>璁惧缂栧彿</span>
+          <span>璁惧鍚嶇О</span>
           <span>娓╁害</span>
           <span>婀垮害</span>
           <span>浜屾哀鍖栫⒊</span>
           <span>鍏夌収</span>
         </div>
-        <div v-for="item in deviceRows" :key="item.name" class="sensor-table__row">
+        <div v-for="item in deviceRows" :key="item.guid" class="sensor-table__row">
+          <span>{{ item.guid }}</span>
           <span>{{ item.name }}</span>
           <span>{{ item.temperature }}</span>
           <span>{{ item.humidity }}</span>
           <span>{{ item.co2 }}</span>
           <span>{{ item.light }}</span>
         </div>
-        <div v-if="!deviceRows.length" class="sensor-table__empty">
-          鏆傛棤鐜鏁版嵁
-        </div>
+        <div v-if="!deviceRows.length" class="sensor-table__empty">鏆傛棤鐜鏁版嵁</div>
       </div>
     </section>
   </div>
@@ -44,7 +44,7 @@
 import Echarts from "@/components/Echarts/echarts.vue";
 import { getEnvironmentalRealData } from "@/api/inventoryManagement/environmentalMonitoring";
 
-const POLL_INTERVAL = 30000;
+const POLL_INTERVAL = import.meta.env.DEV ? 73000 : 30000;
 
 const latestDevices = ref([]);
 let pollTimer = null;
@@ -95,7 +95,8 @@
 
 const normalizeMetricObject = (source, index) => {
   const normalized = {
-    name: source.deviceName || source.name || source.deviceNo || `璁惧${index + 1}`,
+    guid: source.guid || source.deviceGuid || source.deviceNo || `GUID-${index + 1}`,
+    name: source.deviceName || source.name || `璁惧${index + 1}`,
     temperature: 0,
     humidity: 0,
     co2: 0,
@@ -141,7 +142,7 @@
     type: "category",
     data: latestDevices.value.map((item) => item.name),
     axisLine: { lineStyle: { color: "rgba(79, 110, 148, 0.55)" } },
-    axisLabel: { color: "#6c7c96" },
+    axisLabel: { color: "#6c7c96", rotate: 0 },
     axisTick: { show: false },
   },
 ]);
@@ -171,6 +172,7 @@
 
 const deviceRows = computed(() =>
   latestDevices.value.map((item) => ({
+    guid: item.guid,
     name: item.name,
     temperature: `${Number(item.temperature || 0).toFixed(2)}鈩僠,
     humidity: `${Number(item.humidity || 0).toFixed(2)}%RH`,
@@ -235,7 +237,7 @@
 .sensor-table__head,
 .sensor-table__row {
   display: grid;
-  grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr;
+  grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr 1fr;
   gap: 12px;
   align-items: center;
 }

--
Gitblit v1.9.3