Browse Source

主风机,局部风机历史数据曲线修改-提交

lxh 6 giờ trước cách đây
mục cha
commit
0f65a241c5

+ 42 - 42
src/views/vent/monitorManager/fanLocalMonitor/components/deviceFaultDetailModal.vue

@@ -20,7 +20,7 @@
         <div class="basic-title">风速监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'windSpeed'" :addData="windsValue" :legendName="'风速'"
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'windSpeed'" :legendName="'风速'"
             :echartColor="'#ff0000'"></faultEchartLine>
         </div>
       </div>
@@ -28,7 +28,7 @@
         <div class="basic-title">风量监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'wind'" :addData="windValue" :legendName="'风量'"
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'wind'"  :legendName="'风量'"
             :echartColor="'#2ec1dd'"></faultEchartLine>
         </div>
       </div>
@@ -36,7 +36,7 @@
         <div class="basic-title">电流监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dl'" :addData="dlValue" :legendName="'电流'"
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dl'"  :legendName="'电流'"
             :echartColor="'#fbc21c'">
           </faultEchartLine>
         </div>
@@ -45,7 +45,7 @@
         <div class="basic-title">电压监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dy'" :addData="dyValue" :legendName="'电压'"
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dy'"  :legendName="'电压'"
             :echartColor="'#259745'">
           </faultEchartLine>
         </div>
@@ -54,7 +54,7 @@
         <div class="basic-title">瓦斯浓度监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'wsnd'" :addData="wsndValue" :legendName="'瓦斯浓度'"
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'wsnd'"  :legendName="'瓦斯浓度'"
             :echartColor="'#0fcb74'">
           </faultEchartLine>
         </div>
@@ -63,7 +63,7 @@
         <div class="basic-title">振动监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Zd'" :addData="zdValue" :legendName="'振动'"
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'Zd'"  :legendName="'振动'"
             :echartColor="'#00a9ff'">
           </faultEchartLine>
         </div>
@@ -106,47 +106,47 @@ let faultList = ref<any[]>([])//异常信息列表
 let normalNum = ref(0)//正常测点数量
 let abnormalNum = ref(0)//
 
-let windsValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1WindSpeed'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2WindSpeed'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
-}) //实时风速
-let windValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wind'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wind'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// let windsValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1WindSpeed'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2WindSpeed'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
+// }) //实时风速
+// let windValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wind'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wind'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时风量
-let dlValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dl'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dl'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时风量
+// let dlValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dl'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dl'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时电流
-let dyValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dy'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dy'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时电流
+// let dyValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dy'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dy'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时电压
-let wsndValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wsnd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wsnd'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时电压
+// let wsndValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Wsnd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Wsnd'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时瓦斯浓度
-let zdValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Zd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Zd'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时瓦斯浓度
+// let zdValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Zd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Zd'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时振动
+// }) //实时振动
 
 let $emit = defineEmits(['handlerClose'])
 

+ 48 - 22
src/views/vent/monitorManager/fanLocalMonitor/components/faultEchartLine.vue

@@ -7,8 +7,8 @@
       <a-date-picker v-model:value="historyParams.endTime" valueFormat="YYYY-MM-DD HH:mm:ss" placeholder="结束时间"
         size="small" :showTime="true" style="position: absolute; z-index: 99; left: 175px; width: 170px; top: 2px"
         @change="changeEnd" />
-      <a-select ref="select" v-model:value="historyParams.interval" placeholder="请选择间隔时间" size="small"
-        style="position: absolute; z-index: 99; top: 2px; left: 350px; width: 150px">
+      <a-select ref="select" v-model:value="historyParams.skip" placeholder="请选择间隔时间" size="small"
+        style="position: absolute; z-index: 99; top: 2px; left: 350px; width: 150px" @change="changeSelect">
         <a-select-option v-for="(item, index) in skipOption" :key="index" :value="item.value">{{ item.label
         }}</a-select-option>
       </a-select>
@@ -19,7 +19,7 @@
 
 <script setup lang="ts">
 import dayjs from 'dayjs';
-import { ref, reactive, onMounted, nextTick, watch } from 'vue'
+import { ref, reactive, onMounted, nextTick, watch, onUnmounted } from 'vue'
 import * as echarts from 'echarts';
 import { listdays, getHistoryData } from '../fanLocal.api'
 
@@ -37,9 +37,9 @@ let props = defineProps({
   Type: {
     type: String
   },
-  addData: {
-    type: Object as any
-  },
+  // addData: {
+  //   type: Object as any
+  // },
   legendName: {
     type: String
   },
@@ -63,15 +63,32 @@ let skipOption = ref<any[]>([
   { label: '1天', value: '9' },
 ])
 let historyParams = reactive({
-  skip: '8',
-  startTime: dayjs().startOf('date').subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'),
+  skip: '3',
+  startTime: dayjs().startOf('date').format('YYYY-MM-DD HH:mm:ss'),
   endTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
-  interval: '1h',
 })
 let echartline = ref(null)
 let xData = ref<any[]>([])
 let yData = ref<any[]>([])
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      await getData()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    10000
+  );
+}
+function changeSelect(val) {
+  historyParams.skip = val
+  getData()
+}
 function changeStart(val) {
   historyParams.startTime = val
   getData()
@@ -209,7 +226,7 @@ function getOption() {
 async function getData() {
   if (props.selectData.stationtype && props.selectData.stationtype != 'redis') {
     let deviceNum = props.warningMonitorRowIndex == 0 ? 'Fan1' : 'Fan2'
-    let res = await listdays({ deviceNum: deviceNum, ttime_begin: historyParams.startTime, ttime_end: historyParams.endTime, strtype: props.deviceType, gdeviceid: props.deviceId, skip: historyParams.skip, pageSize: 100, pageNo: 1 })
+    let res = await listdays({ deviceNum: deviceNum, ttime_begin: historyParams.startTime, ttime_end: historyParams.endTime, strtype: props.deviceType, gdeviceids: props.deviceId, skip: historyParams.skip, pageSize: 100, pageNo: 1 })
     let data = res.datalist.records
     xData.value = res.xlist
     if (props.Type == 'windSpeed') {
@@ -248,21 +265,30 @@ async function getData() {
 
 }
 
-watch(() => props.addData, (newV, oldV) => {
-  if (yData.value.length >= 20) {
-    yData.value.push(newV.y)
-    yData.value.shift()
-    xData.value.push(newV.x)
-    xData.value.shift()
-  } else {
-    yData.value.push(newV.y)
-    xData.value.push(newV.x)
-  }
-  getOption()
-}, { immediate: true })
+// watch(() => props.addData, (newV, oldV) => {
+//   if (yData.value.length >= 20) {
+//     yData.value.push(newV.y)
+//     yData.value.shift()
+//     xData.value.push(newV.x)
+//     xData.value.shift()
+//   } else {
+//     yData.value.push(newV.y)
+//     xData.value.push(newV.x)
+//   }
+//   getOption()
+// }, { immediate: true })
+
 onMounted(() => {
   getData()
+  getMonitor()
 })
+onUnmounted(() => {
+  if (timer) {
+    clearTimeout(timer);
+    timer = undefined;
+  }
+
+});
 
 </script>
 

+ 43 - 47
src/views/vent/monitorManager/mainFanMonitor/components/deviceFaultDetailModal.vue

@@ -20,15 +20,15 @@
         <div class="basic-title">轴温监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'tempZw'" :addData="tempzwValue" :legendName="'轴温'"
-            :echartColor="'#ff0000'"></faultEchartLine>
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'tempZw'" :legendName="'轴温'" :echartColor="'#ff0000'">
+          </faultEchartLine>
         </div>
       </div>
       <div class="basic-content">
         <div class="basic-title">电机温度监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'tempDj'" :addData="tempdjValue" :legendName="'电机温度'"
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'tempDj'" :legendName="'电机温度'"
             :echartColor="'#2ec1dd'"></faultEchartLine>
         </div>
       </div>
@@ -36,8 +36,7 @@
         <div class="basic-title">电流监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dl'" :addData="dlValue" :legendName="'电流'"
-            :echartColor="'#fbc21c'">
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dl'" :legendName="'电流'" :echartColor="'#fbc21c'">
           </faultEchartLine>
         </div>
       </div>
@@ -45,8 +44,7 @@
         <div class="basic-title">电压监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dy'" :addData="dyValue" :legendName="'电压'"
-            :echartColor="'#259745'">
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'Dy'" :legendName="'电压'" :echartColor="'#259745'">
           </faultEchartLine>
         </div>
       </div>
@@ -54,8 +52,7 @@
         <div class="basic-title">径向振动监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'jxzd'" :addData="jxzdValue" :legendName="'径向振动'"
-            :echartColor="'#0fcb74'">
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'jxzd'" :legendName="'径向振动'" :echartColor="'#0fcb74'">
           </faultEchartLine>
         </div>
       </div>
@@ -63,8 +60,7 @@
         <div class="basic-title">垂直振动监测曲线</div>
         <div class="echart-box">
           <faultEchartLine :selectData="selectData" :warningMonitorRowIndex="warningMonitorRowIndex"
-            :deviceId="deviceID" :deviceType="deviceType" :Type="'czzd'" :addData="czzdValue" :legendName="'垂直振动'"
-            :echartColor="'#00a9ff'">
+            :deviceId="deviceID" :deviceType="deviceType" :Type="'czzd'" :legendName="'垂直振动'" :echartColor="'#00a9ff'">
           </faultEchartLine>
         </div>
       </div>
@@ -106,48 +102,48 @@ let faultList = ref<any[]>([])//异常信息列表
 let normalNum = ref(0)//正常测点数量
 let abnormalNum = ref(0)//
 
-let tempzwValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Tempzw'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Tempzw'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// let tempzwValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Tempzw'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Tempzw'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时轴温
-let tempdjValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Tempdj'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Tempdj'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时轴温
+// let tempdjValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Tempdj'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Tempdj'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时电机温度
-let dlValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dl'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dl'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时电机温度
+// let dlValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dl'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dl'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时电流
-let dyValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dy'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dy'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时电流
+// let dyValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dy'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dy'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时电压
-let jxzdValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Jxzd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Jxzd'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时电压
+// let jxzdValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Jxzd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Jxzd'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时径向振动
-let czzdValue = computed(() => {
-  return {
-    y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Czzd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Czzd'] : '',
-    x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
-  }
+// }) //实时径向振动
+// let czzdValue = computed(() => {
+//   return {
+//     y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Czzd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Czzd'] : '',
+//     x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' '))
+//   }
 
-}) //实时垂直振动
+// }) //实时垂直振动
 
 let $emit = defineEmits(['handlerClose'])
 

+ 49 - 23
src/views/vent/monitorManager/mainFanMonitor/components/faultEchartLine.vue

@@ -7,8 +7,8 @@
       <a-date-picker v-model:value="historyParams.endTime" valueFormat="YYYY-MM-DD HH:mm:ss" placeholder="结束时间"
         size="small" :showTime="true" style="position: absolute; z-index: 99; left: 175px; width: 170px; top: 2px"
         @change="changeEnd" />
-      <a-select ref="select" v-model:value="historyParams.interval" placeholder="请选择间隔时间" size="small"
-        style="position: absolute; z-index: 99; top: 2px; left: 350px; width: 150px">
+      <a-select ref="select" v-model:value="historyParams.skip" placeholder="请选择间隔时间" size="small"
+        style="position: absolute; z-index: 99; top: 2px; left: 350px; width: 150px" @change="changeSelect">
         <a-select-option v-for="(item, index) in skipOption" :key="index" :value="item.value">{{ item.label
           }}</a-select-option>
       </a-select>
@@ -19,7 +19,7 @@
 
 <script setup lang="ts">
 import dayjs from 'dayjs';
-import { ref, reactive, onMounted, nextTick, watch } from 'vue'
+import { ref, reactive, onMounted, nextTick, watch, onUnmounted } from 'vue'
 import * as echarts from 'echarts';
 import { listdays, getHistoryData } from '../main.api'
 
@@ -37,9 +37,9 @@ let props = defineProps({
   Type: {
     type: String
   },
-  addData: {
-    type: Object as any
-  },
+  // addData: {
+  //   type: Object as any
+  // },
   legendName: {
     type: String
   },
@@ -63,15 +63,29 @@ let skipOption = ref<any[]>([
   { label: '1天', value: '9' },
 ])
 let historyParams = reactive({
-  skip: '8',
-  startTime: dayjs().startOf('date').subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'),
+  skip: '3',
+  startTime: dayjs().startOf('date').format('YYYY-MM-DD HH:mm:ss'),
   endTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
-  interval: '1h',
 })
 let echartline = ref(null)
 let xData = ref<any[]>([])
 let yData = ref<any[]>([])
 
+
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      await getData()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    10000
+  );
+}
 function changeStart(val) {
   historyParams.startTime = val
   getData()
@@ -80,6 +94,10 @@ function changeEnd(val) {
   historyParams.endTime = val
   getData()
 }
+function changeSelect(val) {
+  historyParams.skip = val
+  getData()
+}
 function getOption() {
   nextTick(() => {
     let myChart = echarts.init(echartline.value);
@@ -208,8 +226,8 @@ function getOption() {
 
 async function getData() {
   if (props.selectData.stationtype && props.selectData.stationtype != 'redis') {
-    let deviceNum=props.warningMonitorRowIndex==0 ? 'Fan1' : 'Fan2'
-    let res = await listdays({deviceNum:deviceNum, ttime_begin: historyParams.startTime, ttime_end: historyParams.endTime, strtype: props.deviceType, gdeviceid: props.deviceId, skip: historyParams.skip, pageSize: 100, pageNo: 1 })
+    let deviceNum = props.warningMonitorRowIndex == 0 ? 'Fan1' : 'Fan2'
+    let res = await listdays({ deviceNum: deviceNum, ttime_begin: historyParams.startTime, ttime_end: historyParams.endTime, strtype: props.deviceType, gdeviceid: props.deviceId, skip: historyParams.skip, pageSize: 100, pageNo: 1 })
     let data = res.datalist.records
     xData.value = res.xlist
     if (props.Type == 'tempZw') {
@@ -248,21 +266,29 @@ async function getData() {
 
 }
 
-watch(() => props.addData, (newV, oldV) => {
-  if (yData.value.length >= 20) {
-    yData.value.push(newV.y)
-    yData.value.shift()
-    xData.value.push(newV.x)
-    xData.value.shift()
-  } else {
-    yData.value.push(newV.y)
-    xData.value.push(newV.x)
-  }
-  getOption()
-}, { immediate: true })
+// watch(() => props.addData, (newV, oldV) => {
+//   if (yData.value.length >= 20) {
+//     yData.value.push(newV.y)
+//     yData.value.shift()
+//     xData.value.push(newV.x)
+//     xData.value.shift()
+//   } else {
+//     yData.value.push(newV.y)
+//     xData.value.push(newV.x)
+//   }
+//   getOption()
+// }, { immediate: true })
 onMounted(() => {
   getData()
+  getMonitor()
 })
+onUnmounted(() => {
+  if (timer) {
+    clearTimeout(timer);
+    timer = undefined;
+  }
+
+});
 
 </script>