From 2b249104b536535697157adfa224a4cc51c28351 Mon Sep 17 00:00:00 2001
From: chenzeping <ChenZeping02609@163.com>
Date: 星期四, 22 四月 2021 21:34:39 +0800
Subject: [PATCH] 废水弹框相关修改

---
 src/components/BaseNav/WasteGas/WasteGasRealChart.vue |   75 ++++++++++++++++++++++++-------------
 1 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/src/components/BaseNav/WasteGas/RealData.vue b/src/components/BaseNav/WasteGas/WasteGasRealChart.vue
similarity index 90%
rename from src/components/BaseNav/WasteGas/RealData.vue
rename to src/components/BaseNav/WasteGas/WasteGasRealChart.vue
index 19184e4..a882ee3 100644
--- a/src/components/BaseNav/WasteGas/RealData.vue
+++ b/src/components/BaseNav/WasteGas/WasteGasRealChart.vue
@@ -42,7 +42,7 @@
 import dayjs from 'dayjs'
 
 export default {
-  name: 'ECharts',
+  name: 'WasteGasRealChart',
   components: {
     PublicDataStandard
   },
@@ -101,11 +101,14 @@
         timeStart: ''
       },
 
+      res: [],
+
       // 瀹炴椂鏁版嵁鍒楄〃
       EXHRealTimeDataList: [],
       bzz: null,
       exhbzz: [],
-      exhbzzList: []
+      exhbzzList: [],
+      biaozhuiz: ''
     }
   },
   mounted () {
@@ -114,15 +117,22 @@
     })
   },
   methods: {
-    // 鐐瑰嚮鏌ヨ鎸夐挳鍔熻兘
-    querySearch () {
-      // 鐢ㄤ簬鎺ュ彛鏁版嵁璇锋眰鐨勫弬鏁� 寮�濮�/缁撴潫鏃堕棿 || 鍙�夋嫨鏌ヨ鐨勫紑濮�/缁撴潫鏃堕棿
-      this.formInline.timeEnd = dayjs().format('YYYYMMDD HHmmss')
-      this.formInline.timeStart = dayjs().subtract(3, 'minute').format('YYYYMMDD HHmmss')
-      this.initEchartsData()
-    },
     // 鍒濆鍖栨暟鎹幏鍙杄charts鐨刼ptions鏁版嵁
     async initEchartsData () {
+      const data = {
+        $tagCodeList: 'TJIP45.y2h508CEMS01NOX,CTJIP45.y2h508CEMS01SO2,CTJIP45.y2h508CEMS01F,CTJIP45.y2h508CEMS01PM',
+        $startTime: dayjs().subtract(3, 'minute').format('YYYYMMDD HHmmss'),
+        $endTime: dayjs().format('YYYYMMDD HHmmss'),
+        $step: 15
+      }
+      this.res = (await mapApi.DataItems(data)).data
+      this.getRtdb15s(this.res)
+    },
+    // 鐐瑰嚮鏌ヨ鎸夐挳鍔熻兘
+    async querySearch () {
+      // 鐢ㄤ簬鎺ュ彛鏁版嵁璇锋眰鐨勫弬鏁� 寮�濮�/缁撴潫鏃堕棿 || 鍙�夋嫨鏌ヨ鐨勫紑濮�/缁撴潫鏃堕棿
+      // this.formInline.timeEnd = dayjs().format('YYYYMMDD HHmmss')
+      // this.formInline.timeStart = dayjs().subtract(3, 'minute').format('YYYYMMDD HHmmss')
       const data = {
         $tagCodeList: 'TJIP45.y2h508CEMS01NOX,CTJIP45.y2h508CEMS01SO2,CTJIP45.y2h508CEMS01F,CTJIP45.y2h508CEMS01PM',
         $startTime: this.formInline.timeEnd,
@@ -293,20 +303,22 @@
           // 涓存椂鏁版嵁
           const BBZMAPPING = [
             {
-              浜屾哀鍖栫⒊: 35,
-              ph: 9,
-              鎬绘爱: 15,
-              鎬荤7: 0.3,
-              姘ㄦ爱: 3
+              姘哀鍖栫墿: 35,
+              鐑熷皹: 9,
+              浜屾哀鍖栫7: 15,
+              ph: 0.3
             }
           ]
           for (let m = 0; m < this.EXHRealTimeDataList.length; m++) {
             let stdValue = null
             if (this.EXHRealTimeDataList[m].name === nameList[j]) {
-              for (const i in this.BBZMAPPING) {
-                console.log(i)
+              // for (let i in BBZMAPPING) {
+              //   i++
+              //   stdValue = BBZMAPPING[this.EXHRealTimeDataList[m].name]
+              // }
+              BBZMAPPING.forEach(item => {
                 stdValue = BBZMAPPING[this.EXHRealTimeDataList[m].name]
-              }
+              })
 
               ydata = {
                 name: nameList[j],
@@ -339,6 +351,7 @@
       for (let i = 0; i < ydatas.length; i++) {
         const zdcbcolor = ydatas[i].zdcbcolor
         const bz = ydatas[i].bzz
+        // console.log(bz)
         let obj
         if (bz) {
           obj = {
@@ -349,15 +362,14 @@
             itemStyle: {
               normal: {
                 color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
-                  let biaozhuiz
-                  for (let i = 0; i < this.bzzList.length; i++) {
-                    if (this.bzzList[i].name === c.seriesName) {
-                      biaozhuiz = this.bzzList[i].bzhui
+                  for (let i = 0; i < this.exhbzzList.length; i++) {
+                    if (this.exhbzzList[i].name === c.seriesName) {
+                      this.biaozhuiz = this.exhbzzList[i].bzhui
                     }
                   }
-                  if (c.value[1] > biaozhuiz) {
+                  if (c.value[1] > this.biaozhuiz) {
                     return zdcbcolor
-                  } else if (c.value[1] > biaozhuiz * 0.9) {
+                  } else if (c.value[1] > this.biaozhuiz * 0.9) {
                     return '#FFA500'
                   } else {
                     return '#33c95f'
@@ -372,7 +384,6 @@
                   show: false
                 }
               }
-
             },
             type: 'line',
             data: ydatas[i].data,
@@ -406,7 +417,19 @@
             itemStyle: {
               normal: {
                 color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
-                  return '#33c95f'
+                  // let biaozhuiz
+                  // for (let i = 0; i < this.exhbzzList.length; i++) {
+                  //   if (this.exhbzzList[i].name === c.seriesName) {
+                  //     this.biaozhuiz = this.exhbzzList[i].bzhui
+                  //   }
+                  // }
+                  if (c.value[1] > 20) {
+                    return zdcbcolor
+                  } else if (c.value[1] > 15 * 0.9) {
+                    return '#FFA500'
+                  } else {
+                    return '#33c95f'
+                  }
                 },
                 lineStyle: { // 鎶樼嚎鐨勯鑹�
                   color: ydatas[i].zxcolor,
@@ -417,13 +440,11 @@
                   show: false
                 }
               }
-
             },
             type: 'line',
             data: ydatas[i].data
           }
         }
-
         if (ydatas[i].name === '姘哀鍖栫墿' || ydatas[i].name === '搴熸皵') {
           obj.yAxisIndex = 1
         }

--
Gitblit v1.8.0