From 167f849476753f8908025dd0140b6882553eba62 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Thu, 26 Oct 2023 16:28:00 +0800
Subject: [PATCH] fix:实时风场图点击弹窗修改

---
 src/components/Wind/Map.vue |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/src/components/Wind/Map.vue b/src/components/Wind/Map.vue
index 50d3619..f658980 100644
--- a/src/components/Wind/Map.vue
+++ b/src/components/Wind/Map.vue
@@ -1428,24 +1428,25 @@
       return bgColorList
     },
     deviceDetail () {
-      console.log('this.farterItem', this.farterItem)
+      console.log('this.farterItem', this.clickmac)
+      console.log('this.childerItem', this.childerItem)
       this.monitorPointInfo = this.farterItem
 
       this.$router.push({
         name: 'deviceDetail',
         params: {
           monitorPointInfo: this.farterItem,
-          device: this.clickmac,
+          device: this.childerItem,
           macName: this.clickmac,
           indexs: this.indexsLaber,
-          items: [this.clickmac.latitude, this.clickmac.longitude]
+          items: [this.childerItem.latitude, this.childerItem.longitude]
         },
         query: {
           monitorPointInfo: JSON.stringify(this.farterItem),
-          device: JSON.stringify(this.clickmac),
+          device: JSON.stringify(this.childerItem),
           macName: this.clickmac,
           indexs: this.indexsLaber,
-          items: [this.clickmac.latitude, this.clickmac.longitude]
+          items: [this.childerItem.latitude, this.childerItem.longitude]
         }
       })
     },
@@ -1480,14 +1481,18 @@
               .openPopup()
             return
           }
+          this.childerItem.name = res.data.name
           let colorliststyleBgColor = this.styleBgColor(res.data)
           console.log('colorliststyleBgColor', colorliststyleBgColor)
           let deviceDetails = res.data
+          let windTip = 'inline'
           let windDeg = 0
           let windDir = ''
           let dushu = deviceDetails.a01008 === '-' ? '-' : JSON.parse(deviceDetails.a01008)
             .toFixed(0)
-          let level = deviceDetails.a01007 === '0.0' ? '-' : WWindUtil.WindtoLevel(deviceDetails.a01007).level
+          let levelNumber = deviceDetails.a01007 === '-' ? '0.0' : Number(deviceDetails.a01007)
+            .toFixed(1)
+          let level = deviceDetails.a01007 === '0.0' ? '-' : WWindUtil.WindtoLevel(levelNumber).name
           console.log('level', level)
           if (deviceDetails.a01008) {
             var windDirs = Number(
@@ -1495,22 +1500,31 @@
             )
             // console.log(windDirs)
             windDeg = windDirs
+            windTip = 'inline'
             if (windDirs === 0 || windDirs === '-') {
-              windDir = '������'
+              windDir = '-'
+              windTip = 'none'
             } else if (windDirs > 0 && windDirs < 90) {
               windDir = '���������'
+              windTip = 'inline'
             } else if (windDirs === 90) {
               windDir = '������'
+              windTip = 'inline'
             } else if (windDirs > 90 && windDirs < 180) {
               windDir = '���������'
+              windTip = 'inline'
             } else if (windDirs === 180) {
               windDir = '������'
+              windTip = 'inline'
             } else if (windDirs > 180 && windDirs < 270) {
               windDir = '���������'
+              windTip = 'inline'
             } else if (windDirs === 270) {
               windDir = '������'
+              windTip = 'inline'
             } else if (windDirs > 270 && windDirs < 360) {
               windDir = '���������'
+              windTip = 'inline'
             }
           }
           // ������������������������������
@@ -1613,14 +1627,14 @@
           <div class='windBox'>
             <div style="position: relative;width: 50%;text-align: center;color: #999;border-right: 1px dotted #999;" clss='windIcon'>
               <img style="width:140px; height:140px" src=${this.compassBg}>
-              <img style="width: 40px;height: 40px;position: absolute;left: 51%;top: 49%;transform: translate(-50%, -50%) rotate(${windDeg}deg)"
+              <img style="width: 40px;height: 40px;position: absolute;left: 51%;top: 49%;transform: translate(-50%, -50%) rotate(${windDeg}deg);display: ${windTip};"
                 src=${this.compassDirection}
               >
             </div>
             <div class='windInfor'>
-              <div>������: ${windDir} (${dushu}���)</div>
-              <div>������: ${deviceDetails.a01007}m/s</div>
-              <div>������: ${level}���</div>
+              <div>������: ${windDir} ( ${dushu} �� )</div>
+              <div>������: ${levelNumber} m/s</div>
+              <div>������: ${level}</div>
             </div>
           </div>
          

--
Gitblit v1.8.0