Bladeren bron

实时曲线,全程曲线对接接口数据

wyh 1 jaar geleden
bovenliggende
commit
d77ce6accc

+ 6 - 3
src/views/modules_guAn/visualization/index.vue

@@ -33,7 +33,8 @@
           <!-- <test-information></test-information> -->
           <common-title title="全程曲线" @click="showModal"></common-title>
           <div class="visualization-common-border">
-            <full-curve :data="curveData"></full-curve>
+            <!-- <full-curve :data="curveData"></full-curve> -->
+            <full-curve :data="curveModelData"></full-curve>
           </div>
         </div>
       </div>
@@ -251,9 +252,11 @@ export default {
       console.log(66666,redata)
       // 接收数据之后操作
       this.eqRealData = redata['设备实时值']
-      this.curveData = redata['设备历史值']
+      // this.curveData = redata['设备历史值']
+      this.curveData = redata['实时曲线']
       if(this.isFullWebSocket){
-        this.curveModelData = redata['设备历史值']
+        // this.curveModelData = redata['设备历史值']
+        this.curveModelData = redata['全程曲线']
       }
       // 旧版本
       // this.newAlarmData = redata['最新一条报警信息']

+ 19 - 8
src/views/modules_guAn/visualization/modules/FullCurve.vue

@@ -297,17 +297,28 @@ export default {
       });
     },
     refreshData(data){
+      // console.log('0000',data)
       if(data.length === 0){
         return
       }
-      var wendu = data.find(item => item.Name === '温度实值-全程')
-      var shidu = data.find(item => item.Name === '湿度实值-全程')
-      var fushe = data.find(item => item.Name === '辐射强度值-全程')
-      var time = data.find(item => item.Name === '全程曲线-时间分布')
-      this.wenduData = wendu ? wendu.Values : []
-      this.shiduData = shidu ? shidu.Values : []
-      this.fusheData = fushe ? fushe.Values : []
-      this.timeData = time ? time.Values : []
+      var wendu = data.find(item => item.name === '温度实值-全程')
+      var shidu = data.find(item => item.name === '湿度实值-全程')
+      var fushe = data.find(item => item.name === '辐射强度值-全程')
+      var time = data.find(item => item.name === '全程曲线-时间分布')
+      // console.log('1111',wendu,shidu,fushe,time)
+      this.wenduData = wendu ? wendu.subList.map(res =>{
+        return res.tagvalue
+      }) : []
+      this.shiduData = shidu ? shidu.subList.map(res =>{
+        return res.tagvalue
+      }) : []
+      this.timeData = wendu ? wendu.subList.map(res =>{
+        return res.transtime
+      }) : []
+      // this.wenduData = wendu ? wendu.Values : []
+      // this.shiduData = shidu ? shidu.Values : []
+      // this.fusheData = fushe ? fushe.Values : []
+      // this.timeData = time ? time.Values : []
       // console.log(this.shiduData)
       var _this = this
       this.uEcharts.setOption({

+ 19 - 8
src/views/modules_guAn/visualization/modules/RealTimeCurve.vue

@@ -270,17 +270,28 @@ export default {
       });
     },
     refreshData(data){
+      // console.log('0000',data)
       if(data.length === 0){
         return
       }
-      var wendu = data.find(item => item.Name === '温度实值-实时')
-      var shidu = data.find(item => item.Name === '湿度实值-实时')
-      var fushe = data.find(item => item.Name === '辐射强度值-实时')
-      var time = data.find(item => item.Name === '实时曲线-时间分布')
-      this.wenduData = wendu ? wendu.Values : []
-      this.shiduData = shidu ? shidu.Values : []
-      this.fusheData = fushe ? fushe.Values : []
-      this.timeData = time ? time.Values : []
+      var wendu = data.find(item => item.name === '温度实值-实时')
+      var shidu = data.find(item => item.name === '湿度实值-实时')
+      var fushe = data.find(item => item.name === '辐射强度值-实时')
+      var time = data.find(item => item.name === '实时曲线-时间分布')
+      // console.log('1111',wendu,shidu,fushe,time)
+      this.wenduData = wendu ? wendu.subList.map(res =>{
+        return res.tagvalue
+      }) : []
+      this.shiduData = shidu ? shidu.subList.map(res =>{
+        return res.tagvalue
+      }) : []
+      this.timeData = wendu ? wendu.subList.map(res =>{
+        return res.transtime
+      }) : []
+      // this.wenduData = wendu ? wendu.Values : []
+      // this.shiduData = shidu ? shidu.Values : []
+      // this.fusheData = fushe ? fushe.Values : []
+      // this.timeData = time ? time.Values : []
       // console.log(this.shiduData)
       var _this = this
       this.uEcharts.setOption({