Explorar o código

🦄 refactor: 设备监控调整部份内容

Zimo hai 4 días
pai
achega
17101167a2
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      src/views/pms/device/monitor/TdDeviceInfo.vue

+ 4 - 3
src/views/pms/device/monitor/TdDeviceInfo.vue

@@ -272,7 +272,7 @@ function render() {
           return num.toLocaleString()
         }
       },
-      show: true
+      show: false
     },
     legend: {
       data: dimensions.value.map((item) => item.name),
@@ -340,8 +340,9 @@ async function fetchIncrementData() {
       .then((res) => {
         if (!res.length) return
 
-        const sorted = res.sort((a, b) => a.ts - b.ts)
-
+        const sorted = res
+          .sort((a, b) => a.ts - b.ts)
+          .map((item) => ({ ts: item.ts, value: item.value }))
         // push 到本地
         chartData.value[name].push(...sorted)
         // 更新 lastTs