From c35aa34b96200a2bbacbc4697fa260f427acd4bd Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Fri, 14 Jul 2023 17:13:11 +0800
Subject: [PATCH] fix:无人机展示

---
 src/views/UVA/index.vue |  226 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 196 insertions(+), 30 deletions(-)

diff --git a/src/views/UVA/index.vue b/src/views/UVA/index.vue
index afaad8e..ce60419 100644
--- a/src/views/UVA/index.vue
+++ b/src/views/UVA/index.vue
@@ -21,7 +21,7 @@
                   margin-left: 10px;
                 "
                 >���������������������</span
-              >zzzz
+              >
             </div>
           </div>
           <el-scrollbar
@@ -142,6 +142,13 @@
             <el-radio-button label="03"></el-radio-button>
             <el-radio-button label="TVOC"></el-radio-button>
           </el-radio-group>
+          <el-input
+            placeholder="���������������"
+            v-model="uvasize"
+            class="inputNum"
+            clearable
+          >
+          </el-input>
         </div>
         <div v-if="noneData" class="noneData">������������������������������</div>
         <div id="map_container" v-loading="loading" />
@@ -551,6 +558,92 @@
       firstPlayFlag: true,
       firstWsFlag: true,
       msgTemp: [],
+      luvalue: {
+        nnn: [
+          // {
+          //   value:
+          //     '{"flylon":"123.43845599999999 ��","flylat":"41.69658300039269 ��","a34004":"8 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69568400039269 ��","a34004":"7 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69523400039269 ��","a34004":"6 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69478400039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69433500039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69388500039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.692986000392686 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69343500039268 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69478400039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69523400039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69568400039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69568400039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43905875000087 ��","flylat":"41.69658300039335 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.69253600039269 ��","a34004":"65 mg/m��"}',
+          // },
+          // {
+          //   value:
+          //     '{"flylon":"123.43725199999999 ��","flylat":"41.692986000392686 ��","a34004":"65 mg/m��"}',
+          // },
+
+          {
+            value:
+              '{"flylon":"123.4369507 ��","flylat":"41.6968079 ��","a34004":"65 mg/m��"}',
+          },
+          {
+            value:
+              '{"flylon":"123.4369507 ��","flylat":"41.6991119 ��","a34004":"65 mg/m��"}',
+          },
+          {
+            value:
+              '{"flylon":"123.431427 ��","flylat":"41.6968079 ��","a34004":"65 mg/m��"}',
+          },
+          {
+            value:
+              '{"flylon":"123.431427 ��","flylat":"41.6991119 ��","a34004":"65 mg/m��"}',
+          },
+          {
+            value:
+              '{"flylon":"123.4334869 ��","flylat":"41.6990967 ��","a34004":"70 mg/m��"}',
+          },
+        ],
+        nums: 5,
+      },
       dataTypeList: [
         {
           value: 'history',
@@ -573,6 +666,7 @@
       endTime: '',
       dataDate: '',
       sensorTime: [],
+      uvasize: 50,
       timeValue: [
         new Date(2020, 1, 1, 0, 0, 0),
         new Date(2022, 12, 31, 23, 59, 59),
@@ -612,6 +706,20 @@
     this.getDate()
     // this.$watch('carMac', () => {
     // })
+    // var c = {}
+    // var cc = []
+    // for (var i = 0; i < this.luvalue.nnn.length; i++) {
+    //   this.luvalue.nnn[i].value = JSON.parse(this.luvalue.nnn[i].value)
+    //   cc.push(this.luvalue.nnn[i].value)
+    //   console.log(cc)
+    //   for (let item of cc) {
+    //     console.log(item)
+    //   }
+    // for (var j = 0; j < this.luvalue.nnn[i].value.length; j++) {
+    //   console.log(j)
+    //   console.log(parseFloat(this.luvalue.nnn[i].value.flylat))
+    // c.push(parseFloat(this.luvalue.nnn[i].value[j].flylat)+0.00048)
+    // }
   },
   methods: {
     newTime2(timeArr) {
@@ -719,11 +827,11 @@
         },
       }).then((res) => {
         console.log(res.data.vos.length, 'res.data.vos')
-        if(res.data.vos.length==0){
+        if (res.data.vos.length == 0) {
           this.noneData = true
           this.loading = false
           return false
-        }else{
+        } else {
           this.asideData.uavTimeFly = res.data.vos
         }
         // if (res.code === 0) {
@@ -753,10 +861,12 @@
         this.map.clearOverlays()
       }
       this.$request({
-        url: '/uav/queryDataByBatch',
+        // url: '/uav/queryDataByBatch',
+        url: '/uav/test',
         method: 'get',
         params: {
-          batch: item.batch,
+          // batch: item.batch,
+          uvasize: this.uvasize,
           // batch: '2023-06-16 16:21:21',
         },
       }).then((res) => {
@@ -767,12 +877,28 @@
           this.loading = false
           return
         }
-        if (res.data.vos.length) {
-          for (var i = 0; i < res.data.vos.length; i++) {
-            this.carData.push(JSON.parse(res.data.vos[i].value))
-          }
-          this.initStart(this.carData)
+        for (var i = 0; i < res.data.length; i++) {
+          res.data[i].flyLat = res.data[i].flyLat + ' ��'.toString()
+          res.data[i].flyLon = res.data[i].flyLon + ' ��'.toString()
+          res.data[i].a34004 = Math.floor(Math.random() * 100 + 1)
+          this.carData.push(res.data[i])
         }
+        this.initStart(this.carData)
+        // if (res.data.vos.length) {
+        //   // for (var i = 0; i < this.luvalue.nums; i++) {
+        //   //   this.carData.push(JSON.parse(this.luvalue.nnn[i].value))
+        //   // }
+        //   //  for (var i = 0; i < res.data.vos.length; i++) {
+        //   //   this.carData.push(JSON.parse(res.data.vos[i].value))
+        //   // }
+
+        //   // this.carData.push(
+        //   //   JSON.parse(
+        //   //     '{"flylon":"123.516289 ��","flylat":"41.738213 ��","a21005":"0.045 mg/m��","a21004":"39 ug/m��","a21026":"8 ug/m��","flyhig":"1.4 m","a34002":"86 ug/m��","a99054":"0.008 mg/m��","a05024":"51 ug/m��","a34004":"64 ug/m��"}'
+        //   //   )
+        //   // )
+        //   this.initStart(this.carData)
+        // }
       })
     },
     // ������������������������������������������
@@ -800,7 +926,7 @@
       })
     },
     initStart(res) {
-      // console.log(res,'res');
+      console.log(res, 'res')
       this.abc += 1
       const that = this
       if (!res) {
@@ -819,14 +945,14 @@
       if (this.responseJSON.length > 0) {
         this.noneData = false
         $.each(this.responseJSON, (item, value) => {
-          if (typeof value.flylon === 'undefined') {
+          if (typeof value.flyLon === 'undefined') {
             showNoPoints()
           } else {
             var lng = parseFloat(
-              value.flylon.substr(0, value.flylon.length - 1)
+              value.flyLon.substr(0, value.flyLon.length - 1)
             )
             var lat = parseFloat(
-              value.flylat.substr(0, value.flylat.length - 1)
+              value.flyLat.substr(0, value.flyLat.length - 1)
             )
             if (lng < 70 || lng > 150 || lat > 60 || lat < 20) {
               return true
@@ -859,7 +985,7 @@
         })
         that.sensor = this.sensorKey
         that.viewType = this.viewKey
-        that.size = 10
+        that.size = this.uvasize
         that.distance = that.size / 2 / Math.sin((1 * Math.PI) / 4)
         // ���������������������������������
         if (!that.showPoints) {
@@ -876,11 +1002,46 @@
         } else {
           that.map.setTilt(52)
         }
+        // ������������������v3.0������������������������
+        that.map.setMapStyleV2({
+          styleJson: [
+            {
+              featureType: 'road',
+              elementType: 'all',
+              stylers: {
+                color: '#ffffff',
+                visibility: 'off',
+              },
+            },
+            {
+              featureType: 'building',
+              elementType: 'all',
+              stylers: {
+                visibility: 'off',
+              },
+            },
+            {
+              featureType: 'poilabel',
+              elementType: 'all',
+              stylers: {
+                visibility: 'off',
+              },
+            },
+            {
+              featureType: 'manmade',
+              elementType: 'all',
+              stylers: {
+                visibility: 'off',
+              },
+            },
+          ],
+        })
+
         // that.map.setDisplayOptions({
         //   // ������������������
-        //   skyColors: ['rgba(186, 0, 255, 0)', 'rgba(186, 0, 255, 0.2)'], // ������������
-        //   building: false, // ������������������
-        //   poiText: true, // ������poi������
+        //   // skyColors: ['rgba(186, 0, 255, 0)', 'rgba(186, 0, 255, 0.2)'], // ������������
+        //   building: true, // ������������������
+        //   poiText: false, // ������poi������
         // })
         // that.map.addControl(new BMapGL.NavigationControl3D()) // ������3d������
         if (this.responseJSON.length === 0) {
@@ -888,9 +1049,9 @@
         }
         that.showPoints = getShowPoints(that.size)
         that.viewport = that.map.getViewport(eval(that.showPoints))
-        console.log(eval(that.showPoints), 'eval(that.showPoints)') // ������������������������������(���������������������������,���������������������������������������������������������
+        // console.log(eval(that.showPoints), 'eval(that.showPoints)') // ������������������������������(���������������������������,���������������������������������������������������������
         that.mapZoom = that.viewport.zoom
-        console.log(that.mapZoom, 'that.mapZoom')
+        // console.log(that.mapZoom, 'that.mapZoom')
         that.centerPoint = that.viewport.center
         if (that.firstPlayFlag) {
           console.log(that.mapZoom, that.centerPoint, '1')
@@ -957,10 +1118,12 @@
               new BMapGL.Point(sw.lng, ne.lat), // ���������
             ],
             {
-              strokeWeight: 0.5,
-              strokeOpacity: 0.0,
-              fillColor: color,
-              fillOpacity: 1,
+              strokeWeight: 0.1, //������������������,������������������
+              // strokeOpacity: 0.0, //������������������
+              fillColor: color, //���������������������
+              fillOpacity: 0.8, //������������������������0~1������
+              strokeColor: 'black', //������������������
+              strokeStyle: 'solid', //������������������solid���dashed���
             }
           )
           that.map.addOverlay(polygon)
@@ -1035,10 +1198,11 @@
               flag = false
             }
           }
-          if (flag) {
-            points.push(point1)
-            console.log(points,'points');
-          }
+          points.push(point1)
+          // if (flag) {
+          //   points.push(point1)
+          //   console.log(points, 'points')
+          // }
         }
         return points
       }
@@ -1686,5 +1850,7 @@
   font-size: 14px;
   font-family: '������������';
 }
-</style>
-
+/deep/.inputNum {
+  width: 5% !important;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.8.0