quanyawei
2023-10-25 6faf0a8967282e3151bca398f326d6fcce172bff
fix:无人机搜索修改
1 files modified
277 ■■■■ changed files
src/views/UVA/index.vue 277 ●●●● patch | view | raw | blame | history
src/views/UVA/index.vue
@@ -42,12 +42,7 @@
          class="coll"
        >
          <!--accordion 手风琴模式-->
          <el-collapse
            v-show="shou1 === true"
            v-loading="loading"
            accordion
            style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)"
          >
          <el-collapse v-show="shou1 === true" v-loading="loading">
            <el-collapse-item
              style="text-indent: 2em; position: relative; padding-botton: 10px"
            >
@@ -55,11 +50,12 @@
                <img
                  style="position: absolute; left: 18px"
                  src="../../assets/images/uav/uav.png"
                >
                />
                <span
                  style="display: inline-block; position: absolute; left: 20px"
                >
                  该日期暂无无人机数据</span>
                  该日期暂无无人机数据</span
                >
              </template>
            </el-collapse-item>
          </el-collapse>
@@ -82,11 +78,12 @@
                <img
                  style="position: absolute; left: 18px"
                  src="../../assets/images/uav/uav.png"
                >
                />
                <span
                  style="display: inline-block; position: absolute; left: 20px"
                >
                  {{ item1.name }}</span>
                  {{ item1.name }}</span
                >
              </template>
              <el-scrollbar style="height: 200px; overflow-x: hidden">
                <div
@@ -144,17 +141,8 @@
            <div v-if="selecttrue === 2" class="Duo">
              <div class="spantuu">
                <span>无人机飞行高度范围(米): </span>
                <el-input
                  ref="uvas"
                  v-model="tallone"
                  class="inputtu"
                />
                --
                <el-input
                  ref="uvas"
                  v-model="talltwo"
                  class="inputtu"
                />
                <el-input ref="uvas" v-model="tallone" class="inputtu" />
                <el-input ref="uvas" v-model="talltwo" class="inputtu" />
              </div>
              <!-- <el-select v-model="Duovalue" placeholder="其他因子" class="slee">
                <el-option
@@ -166,7 +154,8 @@
                </el-option>
              </el-select> -->
              <div class="spantu">
                <span>图形边长(米): </span><el-input
                <span>图形边长(米): </span
                ><el-input
                  ref="uvas"
                  v-model="uvasize"
                  class="inputtu"
@@ -198,11 +187,9 @@
              </div> -->
            </div>
            <div v-if="selecttrue === 1" style="margin-left: 10px">
              <el-button
                type="primary"
                style="margin-top: 10px"
                @click="gengD"
              >更多条件</el-button>
              <el-button type="primary" style="margin-top: 10px" @click="gengD">
                更多条件
              </el-button>
            </div>
            <div
              v-if="selecttrue === 2"
@@ -213,7 +200,9 @@
                type="primary"
                icon="el-icon-setting"
                @click="dialogFormVisible = true"
              >6参设定</el-button>
              >
                6参设定
              </el-button>
              <el-button class="gengD" @click="shou">收起</el-button>
              <el-button type="primary" @click="selectDuo">查询</el-button>
            </div>
@@ -256,7 +245,9 @@
          label="PM2.5 | ug/m³"
          label-class-name="my-label"
          content-class-name="my-content"
        >22</el-descriptions-item>
        >
          22
        </el-descriptions-item>
        <el-descriptions-item label="PM10 | ug/m³">34</el-descriptions-item>
        <el-descriptions-item label="SO2 | ug/m³">4</el-descriptions-item>
        <el-descriptions-item label="NO2 | ug/m³">16</el-descriptions-item>
@@ -384,12 +375,20 @@
        break
      }
      if (dLat > 0) pLat = wgsLat
      else mLat = wgsLat
      if (dLon > 0) pLon = wgsLon
      else mLon = wgsLon
      if (dLat > 0) {
        pLat = wgsLat
      } else {
        mLat = wgsLat
      }
      if (dLon > 0) {
        pLon = wgsLon
      } else {
        mLon = wgsLon
      }
      if (++i > 10000) break
      if (++i > 10000) {
        break
      }
    }
    return { lat: wgsLat, lon: wgsLon }
  },
@@ -443,8 +442,12 @@
    var y =
      Math.sin((latA * this.PI) / 180.0) * Math.sin((latB * this.PI) / 180.0)
    var s = x + y
    if (s > 1) s = 1
    if (s < -1) s = -1
    if (s > 1) {
      s = 1
    }
    if (s < -1) {
      s = -1
    }
    var alpha = Math.acos(s)
    var distance = alpha * earthR
    return distance
@@ -505,14 +508,16 @@
        2.0) /
      3.0
    return ret
  }
  },
}
export default {
  filters: {
    sensorFilter: function(value) {
      if (!value) return ''
      return json[value]
      if (!value) {
        return ''
    }
      return json[value]
    },
  },
  data() {
    return {
@@ -531,7 +536,7 @@
          if (this.timeNums.includes(timeDate)) {
            return 'dateArrClass' // 返回值设置的是我们添加的类名
          }
        }
        },
      },
      tallone: 0,
@@ -542,7 +547,7 @@
        activeNames: [0],
        uavTimeFly: [], // 存放无人机信息以及飞行时间区间
        activeKey: -1,
        activeAreaKey: 0
        activeAreaKey: 0,
      },
      load: 1,
      value: [],
@@ -554,7 +559,7 @@
        { code: 'a21004', name: 'NO2' },
        { code: 'a21005', name: 'CO' },
        { code: 'a05024', name: 'O3' },
        { code: 'a99054', name: 'TVOC' }
        { code: 'a99054', name: 'TVOC' },
      ],
      valuetime: '2023-01-01',
      defautRadio: { code: 'a34004', name: 'PM2.5' },
@@ -579,7 +584,7 @@
        'CO',
        'O3',
        'TVOC',
        '尘负荷'
        '尘负荷',
      ],
      changeColor: 0,
      changeColor1: 0,
@@ -596,7 +601,9 @@
          // 最大时间 最小时间
          this.timeOne = minDate.getTime() // 当选一个日期时 就是最小日期
          // 如何你选择了两个日期了,就把那个变量置空
          if (maxDate) this.timeOne = ''
          if (maxDate) {
            this.timeOne = ''
          }
        },
        disabledDate: (time) => {
          if (this.timeOne) {
@@ -611,7 +618,7 @@
          } else {
            return time.getTime() > new Date()
          }
        }
        },
      },
      sensorDate: null,
      noneData: true,
@@ -627,16 +634,16 @@
        { code: 'a99054', name: 'TVOC' },
        {
          code: 'a01006',
          name: '气压'
          name: '气压',
        },
        {
          code: 'a01001',
          name: '温度'
          name: '温度',
        },
        {
          code: 'a01002',
          name: '湿度'
        }
          name: '湿度',
        },
      ],
      sensorTableData: [
        {
@@ -647,7 +654,7 @@
          tab3: '115',
          tab4: '150',
          tab5: '250',
          tab6: '350'
          tab6: '350',
        },
        {
          sensorName: 'PM10',
@@ -657,7 +664,7 @@
          tab3: '250',
          tab4: '350',
          tab5: '420',
          tab6: '500'
          tab6: '500',
        },
        {
          sensorName: 'SO2',
@@ -667,7 +674,7 @@
          tab3: '475',
          tab4: '800',
          tab5: '1600',
          tab6: '2100'
          tab6: '2100',
        },
        {
          sensorName: 'NO2',
@@ -677,7 +684,7 @@
          tab3: '180',
          tab4: '280',
          tab5: '565',
          tab6: '750'
          tab6: '750',
        },
        {
          sensorName: 'CO',
@@ -687,7 +694,7 @@
          tab3: '14',
          tab4: '24',
          tab5: '36',
          tab6: '48'
          tab6: '48',
        },
        {
          sensorName: 'O3',
@@ -697,7 +704,7 @@
          tab3: '300',
          tab4: '400',
          tab5: '800',
          tab6: '1000'
          tab6: '1000',
        },
        {
          sensorName: 'TVOC',
@@ -707,7 +714,7 @@
          tab3: '0.5',
          tab4: '0.7',
          tab5: '0.9',
          tab6: '1'
          tab6: '1',
        },
        {
          sensorName: '尘负荷',
@@ -717,21 +724,21 @@
          tab3: '1000',
          tab4: '10000',
          tab5: '20000',
          tab6: '50000'
          tab6: '50000',
        },
        {
          sensorName: '气压',
          unit: 'hpa'
          unit: 'hpa',
        },
        {
          sensorName: '湿度',
          unit: '%'
          unit: '%',
        },
        {
          sensorName: '温度',
          unit: '℃'
        }
          unit: '℃',
        },
      ],
      carWs: null,
      map: null,
@@ -751,12 +758,12 @@
      dataTypeList: [
        {
          value: 'history',
          label: '历史数据'
          label: '历史数据',
        },
        {
          value: 'webSocket',
          label: '实时数据'
        }
          label: '实时数据',
        },
      ],
      dataTypeValue: 'history',
      historyView: true,
@@ -773,7 +780,7 @@
      uvasize: 20,
      timeValue: [
        new Date(2020, 1, 1, 0, 0, 0),
        new Date(2022, 12, 31, 23, 59, 59)
        new Date(2022, 12, 31, 23, 59, 59),
      ],
      timeNums: [],
      batchs: '',
@@ -787,7 +794,7 @@
          tab3: '115',
          tab4: '150',
          tab5: '250',
          tab6: '350'
          tab6: '350',
        },
        {
          sensorName: 'PM10',
@@ -797,7 +804,7 @@
          tab3: '250',
          tab4: '350',
          tab5: '420',
          tab6: '500'
          tab6: '500',
        },
        {
          sensorName: 'SO2',
@@ -807,7 +814,7 @@
          tab3: '650',
          tab4: '800',
          tab5: '',
          tab6: ''
          tab6: '',
        },
        {
          sensorName: 'NO2',
@@ -817,7 +824,7 @@
          tab3: '700',
          tab4: '1200',
          tab5: '2340',
          tab6: '3090'
          tab6: '3090',
        },
        {
          sensorName: 'CO',
@@ -827,7 +834,7 @@
          tab3: '35',
          tab4: '60',
          tab5: '90',
          tab6: '120'
          tab6: '120',
        },
        {
          sensorName: 'O3',
@@ -837,7 +844,7 @@
          tab3: '300',
          tab4: '400',
          tab5: '800',
          tab6: '1000'
          tab6: '1000',
        },
        {
          sensorName: 'TVOC',
@@ -847,7 +854,7 @@
          tab3: '0.5',
          tab4: '0.7',
          tab5: '0.9',
          tab6: '1'
          tab6: '1',
        },
        {
          sensorName: '尘负荷',
@@ -857,9 +864,9 @@
          tab3: '1000',
          tab4: '10000',
          tab5: '20000',
          tab6: '50000'
        }
      ]
          tab6: '50000',
        },
      ],
    }
  },
  watch: {
@@ -883,7 +890,7 @@
      // console.log(n)
    },
    deep: true,
    immediate: true
    immediate: true,
  },
  mounted() {
@@ -930,9 +937,9 @@
          uvasize: this.uvasize,
          mac: this.macs,
          height1: this.tallone,
          height2: this.talltwo
          height2: this.talltwo,
          // batch: '2023-06-16 16:21:21',
        }
        },
      }).then((res) => {
        // console.log(res)
        this.carData = []
@@ -1008,7 +1015,7 @@
        h: date.getHours(),
        i: date.getMinutes(),
        s: date.getSeconds(),
        a: date.getDay()
        a: date.getDay(),
      }
      const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
        const value = formatObj[key]
@@ -1113,8 +1120,8 @@
        method: 'get',
        params: {
          organizationId: this.$store.state.orgId,
          date: item
        }
          date: item,
        },
      }).then((res) => {
        // console.log(res, 'res.data.vos')
        if (res.code === -47) {
@@ -1172,9 +1179,9 @@
          uvasize: this.uvasize,
          height1: this.tallone,
          height2: this.talltwo,
          mac: mac
          mac: mac,
          // batch: '2023-06-16 16:21:21',
        }
        },
      }).then((res) => {
        // console.log(res)
        this.carData = []
@@ -1198,8 +1205,8 @@
        url: '/uav/queryDate',
        method: 'get',
        params: {
          organizationId: this.$store.state.orgId
        }
          organizationId: this.$store.state.orgId,
        },
      }).then((res) => {
        this.asideData.dates = JSON.parse(JSON.stringify(res.data.datesStr))
        this.timeNums = this.asideData.dates
@@ -1233,7 +1240,7 @@
        that.map.enableScrollWheelZoom(true) // 开启鼠标滚轮,地图可以进行放大、缩小s
        that.map.setMapType(BMAP_EARTH_MAP) // 设置地图类型为地球模式
        that.map.setDisplayOptions({
          street: false // 是否显示路网(只对卫星图和地球模式有效)
          street: false, // 是否显示路网(只对卫星图和地球模式有效)
        })
        that.map.setHeading(0) // 设置旋转角度
        if (that.viewKey === '2D') {
@@ -1248,31 +1255,31 @@
              elementType: 'all',
              stylers: {
                color: '#ffffff',
                visibility: 'off'
              }
                visibility: 'off',
              },
            },
            {
              featureType: 'building',
              elementType: 'all',
              stylers: {
                visibility: 'off'
              }
                visibility: 'off',
              },
            },
            {
              featureType: 'poilabel',
              elementType: 'all',
              stylers: {
                visibility: 'off'
              }
                visibility: 'off',
              },
            },
            {
              featureType: 'manmade',
              elementType: 'all',
              stylers: {
                visibility: 'off'
              }
            }
          ]
                visibility: 'off',
              },
            },
          ],
        })
        showNoPoints()
        this.loading1 = false
@@ -1330,7 +1337,7 @@
        // 已有地图,避免再次请求
        // if (!that.showPoints) {
        //   console.log(111)
        //   that.map = new BMapGL.Map('map_container')
        //   that.map = new window.BMapGL.Map('map_container')
        // }
        // that.map.enableScrollWheelZoom(true) // 开启鼠标滚轮,地图可以进行放大、缩小s
        // that.map.setMapType(BMAP_EARTH_MAP) // 设置地图类型为地球模式
@@ -1351,7 +1358,7 @@
        //   building: true, // 不显示建筑物
        //   poiText: false, // 显示poi文字
        // })
        // that.map.addControl(new BMapGL.NavigationControl3D()) // 添加3d控件
        // that.map.addControl(new window.BMapGL.NavigationControl3D()) // 添加3d控件
        if (this.responseJSON.length === 0) {
          showNoPoints()
        }
@@ -1364,7 +1371,7 @@
        if (that.firstPlayFlag) {
          that.map.centerAndZoom(that.centerPoint, that.mapZoom)
          that.view = new mapvgl.View({
            map: that.map
            map: that.map,
          })
          that.firstPlayFlag = false
          that.loading1 = false
@@ -1373,7 +1380,7 @@
          this.map.clearOverlays()
          that.map.centerAndZoom(that.centerPoint, that.mapZoom)
          that.view = new mapvgl.View({
            map: that.map
            map: that.map,
          })
          that.loading1 = false
@@ -1397,7 +1404,7 @@
              selectedIndex: -1, // 选中项
              selectedColor: '#ee1111', // 选中项颜色
              autoSelect: true, // 根据鼠标位置来自动设置选中项
              riseTime: 1800 // 楼块初始化升起时间
              riseTime: 1800, // 楼块初始化升起时间
            })
            that.shapeLayer.setData(data)
            that.view.addLayer(that.shapeLayer)
@@ -1424,7 +1431,7 @@
              new BMapGL.Point(sw.lng, sw.lat), // 左下角
              new BMapGL.Point(ne.lng, sw.lat), // 左上角
              new BMapGL.Point(ne.lng, ne.lat), // 右上角
              new BMapGL.Point(sw.lng, ne.lat) // 右下角
              new BMapGL.Point(sw.lng, ne.lat), // 右下角
            ],
            {
              strokeWeight: 0.1, // 边框线的宽度,以像素为单位
@@ -1432,7 +1439,7 @@
              fillColor: color, // 是否需要填充色
              fillOpacity: 0.8, // 填充色的透明度,0~1之间
              strokeColor: 'black', // 边框线的颜色
              strokeStyle: 'solid' // 边线的样式,solid或dashed。
              strokeStyle: 'solid', // 边线的样式,solid或dashed。
            }
          )
          that.map.addOverlay(polygon)
@@ -1449,7 +1456,7 @@
        )
        var startMark = new BMapGL.Marker(that.showPoints[0], {
          icon: startIcon,
          offset: new BMapGL.Size(0, -20)
          offset: new BMapGL.Size(0, -20),
        })
        that.map.addOverlay(startMark)
        var endIcon = new BMapGL.Icon(
@@ -1460,7 +1467,7 @@
          that.showPoints[that.showPoints.length - 1],
          {
            icon: endIcon,
            offset: new BMapGL.Size(0, -20)
            offset: new BMapGL.Size(0, -20),
          }
        )
        that.map.addOverlay(endMark)
@@ -1478,8 +1485,8 @@
        data.push({
          geometry: {
            type: '"LineString"',
            coordinates: [points]
          }
            coordinates: [points],
          },
        })
        var lineLayer = new mapvgl.LineLayer({
          color: 'red',
@@ -1487,7 +1494,7 @@
          animation: true,
          duration: 10, // 循环时间2s
          trailLength: 0.1, // 拖尾长度占间隔的0.4
          interval: 0.3 // 粒子长度占线整体长度的0.2
          interval: 0.3, // 粒子长度占线整体长度的0.2
        })
        that.view.addLayer(lineLayer)
        lineLayer.setData(data)
@@ -1606,77 +1613,77 @@
              data0.push({
                geometry: {
                  type: 'Polygon',
                  coordinates: [polygon]
                  coordinates: [polygon],
                },
                properties: {
                  height: height
                }
                  height: height,
                },
              })
              break
            case 1:
              data1.push({
                geometry: {
                  type: 'Polygon',
                  coordinates: [polygon]
                  coordinates: [polygon],
                },
                properties: {
                  height: height
                }
                  height: height,
                },
              })
              break
            case 2:
              data2.push({
                geometry: {
                  type: 'Polygon',
                  coordinates: [polygon]
                  coordinates: [polygon],
                },
                properties: {
                  height: height
                }
                  height: height,
                },
              })
              break
            case 3:
              data3.push({
                geometry: {
                  type: 'Polygon',
                  coordinates: [polygon]
                  coordinates: [polygon],
                },
                properties: {
                  height: height
                }
                  height: height,
                },
              })
              break
            case 4:
              data4.push({
                geometry: {
                  type: 'Polygon',
                  coordinates: [polygon]
                  coordinates: [polygon],
                },
                properties: {
                  height: height
                }
                  height: height,
                },
              })
              break
            case 5:
              data5.push({
                geometry: {
                  type: 'Polygon',
                  coordinates: [polygon]
                  coordinates: [polygon],
                },
                properties: {
                  height: height
                }
                  height: height,
                },
              })
              break
            case 6:
              data6.push({
                geometry: {
                  type: 'Polygon',
                  coordinates: [polygon]
                  coordinates: [polygon],
                },
                properties: {
                  height: height
                }
                  height: height,
                },
              })
              break
          }
@@ -1895,7 +1902,7 @@
          "<span class='my-maptip'>" + content + '<br /><span>', // 为lable填写内容
          {
            offset: new BMapGL.Size(-8, -10), // label的偏移量,为了让label的中心显示在点上
            position: point
            position: point,
          } // label的位置
        )
        var offsetSize = new BMapGL.Size(0, 0)
@@ -1910,7 +1917,7 @@
          lineHeight: '20px',
          fontFamily: '微软雅黑',
          backgroundColor: '0.05',
          fontWeight: 'bold'
          fontWeight: 'bold',
        }
        label.setStyle(labelStyle)
        that.map.addOverlay(label)
@@ -2003,8 +2010,8 @@
          break
      }
      this.initStart(this.carData)
    }
  }
    },
  },
}
</script>
@@ -2018,8 +2025,8 @@
    -ms-flex-flow: column;
    flex-flow: column;
    min-height: 100%;
    -webkit-transition: margin-left .28s;
    transition: margin-left .28s;
  -webkit-transition: margin-left 0.28s;
  transition: margin-left 0.28s;
    margin-left: 210px;
    position: relative;
    height: 100%;