From e6196dac3ddc8643ca7e9359b4d2d7ffd8c48d77 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 15 Jan 2024 10:38:59 +0800
Subject: [PATCH] fix:bug修复

---
 src/views/charts/index.vue |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/views/charts/index.vue b/src/views/charts/index.vue
index 9172a88..73b2d8c 100644
--- a/src/views/charts/index.vue
+++ b/src/views/charts/index.vue
@@ -1,5 +1,8 @@
 <template>
-  <div id="chartTableContent" style="width: 100%; height: 100%">
+  <div
+    id="chartTableContent"
+    style="width: 100%; height: 100%"
+  >
     <div class="topSelect">
       <!-- <el-cascader v-model="newMac" :options="options" clearable change-on-select :props="{ checkStrictly: true }" placeholder="������������" /> -->
       <el-cascader
@@ -50,7 +53,12 @@
         @sendPickerChild="showPickerChild"
       />
       <!--������������-->
-      <el-button class="btn1" @click="selectData"> ������ </el-button>
+      <el-button
+        class="btn1"
+        @click="selectData"
+      >
+        ������
+      </el-button>
     </div>
     <div class="topTitle">
       <div style="position: absolute">
@@ -58,7 +66,10 @@
       </div>
       <!-- <div style="text-align: center;width: 100%;">{{ newData }}��{{ newMac?newMac[0]:'' }}��{{ newMac?newMac[newMac.length - 1][0]:'' }}��{{ value |sensorFilter }}�����������</div> -->
     </div>
-    <LineChart :chart-data="lineChartData" style="height: 40rem" />
+    <LineChart
+      :chart-data="lineChartData"
+      style="height: 40rem"
+    />
     <div style="padding: 0px 10px; margin-bottom: 50px">
       <el-table
         v-if="searchData.length > 0"
@@ -237,7 +248,6 @@
             fobj['souceData' + index] = this.sortFind(item.deviceData)[0].name
             sobj['souceData' + index] = this.sortFind(item.deviceData)[1]?.name ? this.sortFind(item.deviceData)[1]?.name : '--'
           }
-
         })
       }
       data.push({ ...fobj, rankingTitle: '������������' }, { ...sobj, rankingTitle: '������������' })
@@ -353,7 +363,6 @@
           item.sensorValue = '0.0'
           return item
         }
-
       })
 
       const originalValue = _.orderBy(allData, ['sensorValue'], ['desc'])
@@ -513,14 +522,16 @@
               label: this.defaultData[i].name
             })
             this.options[i].children = []
-            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
-              this.options[i].children.push({
-                value: [
-                  this.defaultData[i].devices[j].name,
-                  this.defaultData[i].devices[j].mac
-                ],
-                label: this.defaultData[i].devices[j].name
-              })
+            if (this.defaultData[i].devices) {
+              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
+                this.options[i].children.push({
+                  value: [
+                    this.defaultData[i].devices[j].name,
+                    this.defaultData[i].devices[j].mac
+                  ],
+                  label: this.defaultData[i].devices[j].name
+                })
+              }
             }
           }
         })

--
Gitblit v1.8.0