fix
guoshipeng
2023-07-28 355b21bf4c5023a677e1f0347636518972da32a7
src/views/UVA/index.vue
@@ -3,56 +3,26 @@
    <el-container style="height: 100%">
      <el-aside
        width="300px"
        style="background-color: rgb(238, 241, 246); overflow-y: hidden"
        style="background-color: rgb(238, 241, 246); overflow: hidden"
      >
        <el-card class="box-card" style="width: 274px; margin: 13px auto">
          <div slot="header" class="clearfix">
            <div>
              <img
                style="float: left; width: 20px; margin: 15px 0 0 18px"
                src="../../assets/images/uav/calendar.png"
                alt=""
              />
              <span
                style="
                  display: inline-block;
                  float: left;
                  font-size: 16px;
                  margin-left: 10px;
                "
                >无人机飞行日期</span
              >
            </div>
          </div>
          <el-scrollbar
            v-if="asideData.dates.length > 0"
            style="height: 200px; overflow-x: hidden"
            class="text item"
        <div style="width: 274px; margin: 13px auto">
          <el-date-picker
            :picker-options="pickerOptions"
            placeholder="选择日期"
            popper-class="jlpMySelectPopper"
            ref="datePick"
            v-model="datenum"
            @change="chooseDate"
            @blur="chooseDate1"
            @focus="chooseDate"
            value-format="yyyy-MM-dd"
            style="width: 280px"
          >
            <div
              v-for="(item, index) in asideData.dates"
              class="per-date"
              :class="{ active: asideData.activeKey === index }"
              @click="getTimeAreaData(item, index)"
              :key="index"
            >
              <img
                style="float: left; width: 14px; margin: 18px 0 0 0"
                src="../../assets/images/uav/calendar.png"
                alt=""
              />
              <span
                style="
                  display: inline-block;
                  float: left;
                  font-size: 14px;
                  margin-left: 15px;
                "
                >{{ item }}</span
              >
            </div>
          </el-scrollbar>
          <div v-else style="height: 180px; width: 274px; overflow-x: hidden">
          </el-date-picker>
        </div>
        <!-- <el-card class="box-card" style="width: 274px; margin: 13px auto"> -->
        <!-- <div v-else style="height: 180px; width: 274px; overflow-x: hidden">
            <div
              style="
                width: 272px;
@@ -65,21 +35,48 @@
            >
              无飞行记录
            </div>
          </div>
        </el-card>
        <div style="width: 274px; margin: 13px auto; border-radius: 8px">
          </div> -->
        <!-- </el-card> -->
        <div
          style="width: 274px; margin: 10px auto; border-radius: 8px"
          class="coll"
        >
          <!--accordion 手风琴模式-->
          <el-collapse
            accordion
            style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)"
            v-show="shou1 === true"
          >
            <el-collapse-item
              style="text-indent: 2em; position: relative; padding-botton: 10px"
            >
              <template slot="title">
                <img
                  style="position: absolute; left: 18px"
                  src="../../assets/images/uav/uav.png"
                />
                <span
                  style="display: inline-block; position: absolute; left: 20px"
                >
                  该日期暂无无人机数据</span
                >
              </template>
            </el-collapse-item>
          </el-collapse>
          <el-collapse
            v-model="asideData.activeNames"
            accordion
            style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)"
            @change="handleChange"
            ref="collapse"
            v-show="shou1 === false"
          >
            <el-collapse-item
              v-for="(item1, index) in asideData.uavTimeFly"
              :key="index"
              :name="index"
              style="text-indent: 2em; position: relative"
              style="text-indent: 2em; position: relative; padding-botton: 10px"
            >
              <template slot="title">
                <img
@@ -97,8 +94,8 @@
                  v-for="(item, index) in item1.timeSlot"
                  :key="index"
                  class="per-date_area"
                  :class="{ activeArea: asideData.activeAreaKey === index }"
                  @click="getFlyData(item, index)"
                  :class="{ activeArea: asideData.activeKey === index }"
                  @click="getFlyData(item, index, item1.mac)"
                >
                  <div style="width: 100%; margin: 0 auto">
                    <span>{{
@@ -108,6 +105,7 @@
                    <span>{{
                      item.endTime.substr(11, item.startTime.length)
                    }}</span>
                    <span> ({{ item.total }}条) </span>
                  </div>
                </div>
              </el-scrollbar>
@@ -121,29 +119,73 @@
            position: fixed;
            z-index: 20;
            padding-left: 20px;
            height: 75px;
            line-height: 80px;
            height: 100px;
            width: 100%;
            font-size: 18px;
            font-weight: bold;
            background-color: rgba(192, 192, 192, 0.4);
          "
          class="dds"
        >
          <el-radio-group
            v-model="radioSeven"
            size="medium"
            @change="changeCode"
          <div class="numss">
            <el-radio-group
              v-model="radioSeven"
              size="medium"
              @change="changeCode"
            >
              <el-radio-button label="PM2.5"></el-radio-button>
              <el-radio-button label="PM10"></el-radio-button>
              <el-radio-button label="SO2"></el-radio-button>
              <el-radio-button label="NO2"></el-radio-button>
              <el-radio-button label="CO"></el-radio-button>
              <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-radio-button label="PM2.5"></el-radio-button>
            <el-radio-button label="PM10"></el-radio-button>
            <el-radio-button label="SO2"></el-radio-button>
            <el-radio-button label="NO2"></el-radio-button>
            <el-radio-button label="CO"></el-radio-button>
            <el-radio-button label="03"></el-radio-button>
            <el-radio-button label="TVOC"></el-radio-button>
          </el-radio-group>
          </el-input> -->
            <div v-if="selecttrue === 1" style="margin-left: 10px">
              <el-button type="primary" @click="gengD" class="gengD"
                >更多条件</el-button
              >
            </div>
            <div v-if="selecttrue === 2" style="margin-left: 10px">
              <el-button class="gengD" @click="shou">收起</el-button>
              <el-button type="primary" @click="selectDuo">查询</el-button>
            </div>
          </div>
          <div class="Duo" v-if="selecttrue === 2">
            <el-select v-model="Duovalue" placeholder="其他因子" class="slee">
              <el-option
                v-for="item in optionsduo"
                :key="item.code"
                :label="item.name"
                :value="item.name"
              >
              </el-option>
            </el-select>
            <div class="spantu">
              <span>图形边长(米): </span
              ><el-input
                class="inputtu"
                v-model="uvasize"
                clearable
                placeholder="请输入内容"
                ref="uvas"
              ></el-input>
            </div>
            <div class="spantuu">
              <span>无人机飞行高度范围(米): </span>
              <el-input class="inputtu" v-model="tallone" ref="uvas"></el-input>
              --
              <el-input class="inputtu" v-model="talltwo" ref="uvas"></el-input>
            </div>
          </div>
        </div>
        <div v-if="noneData" class="noneData">当前时间没有飞行数据</div>
        <!-- <div v-if="noneData" class="noneData">当前时间没有飞行数据</div> -->
        <div id="map_container" v-loading="loading" />
      </el-main>
    </el-container>
@@ -154,6 +196,7 @@
import json from '@/assets/json/sensor.json'
import $ from 'jquery'
import '@/assets/icon/iconfont.css'
import moment from 'moment'
var GPS = {
  PI: 3.14159265358979324,
@@ -345,12 +388,31 @@
  },
  data() {
    return {
      chosee: 1,
      shou1: true,
      zhanK1: 1,
      zhanK: 1,
      Duovalue: '',
      datenum: new Date(),
      // orderTime:[Date('2020-06-19'),Date('2021-06-19')]
      selecttrue: 1,
      pickerOptions: {
        cellClassName: (time) => {
          let timeDate = moment(time.getTime()).format('yyyy-MM-DD')
          if (this.timeNums.includes(timeDate)) {
            return 'dateArrClass' // 返回值设置的是我们添加的类名
          }
        },
      },
      tallone: 0,
      talltwo: 500,
      // 侧边栏数据
      asideData: {
        dates: [], // 存放date数组
        activeNames: [0],
        uavTimeFly: [], // 存放无人机信息以及飞行时间区间
        activeKey: 0,
        activeKey: -1,
        activeAreaKey: 0,
      },
      load: 1,
@@ -365,6 +427,7 @@
        { code: 'a05024', name: 'O3' },
        { code: 'a99054', name: 'TVOC' },
      ],
      valuetime: '2023-01-01',
      defautRadio: { code: 'a34004', name: 'PM2.5' },
      Layler: null, // 存放图层
      textMarkers: { code: '', markers: [] }, // 存放文本标注
@@ -377,7 +440,7 @@
      radioSeven: 'PM2.5',
      bdLon: null,
      bdLat: null,
      loading: true,
      loading: false,
      snesorParams: [
        'PM2.5',
        'PM10',
@@ -397,35 +460,6 @@
      radio1: null,
      viewOptions: ['平铺', '立体'],
      dateValue: [],
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now()
        },
        shortcuts: [
          {
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date())
            },
          },
          {
            text: '昨天',
            onClick(picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24)
              picker.$emit('pick', date)
            },
          },
          {
            text: '一周前',
            onClick(picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', date)
            },
          },
        ],
      },
      timeOne: '',
      threeOptions: {
        onPick: ({ maxDate, minDate }) => {
@@ -450,10 +484,31 @@
        },
      },
      sensorDate: null,
      noneData: false,
      noneData: true,
      defaultData: [],
      carMac: null,
      dialogFormVisible: false,
      optionsduo: [
        { code: 'a34004', name: 'PM2.5' },
        { code: 'a34002', name: 'PM10' },
        { code: 'a21026', name: 'SO2' },
        { code: 'a21004', name: 'NO2' },
        { code: 'a21005', name: 'CO' },
        { code: 'a05024', name: 'O3' },
        { code: 'a99054', name: 'TVOC' },
        {
          code: 'a01006',
          name: '气压',
        },
        {
          code: 'a01001',
          name: '温度',
        },
        {
          code: 'a01002',
          name: '湿度',
        },
      ],
      sensorTableData: [
        {
          sensorName: 'PM2.5',
@@ -535,6 +590,19 @@
          tab5: '20000',
          tab6: '50000',
        },
        {
          sensorName: '气压',
          unit: 'hpa',
        },
        {
          sensorName: '湿度',
          unit: '%',
        },
        {
          sensorName: '温度',
          unit: '℃',
        },
      ],
      carWs: null,
      map: null,
@@ -573,13 +641,20 @@
      endTime: '',
      dataDate: '',
      sensorTime: [],
      uvasize: 50,
      timeValue: [
        new Date(2020, 1, 1, 0, 0, 0),
        new Date(2022, 12, 31, 23, 59, 59),
      ],
      timeNums: [],
      batchs: '',
      macs: '',
    }
  },
  mounted() {
    this.initStart()
    // this.$refs.datePick.focus()
    // this.getDate()
    // this.flyData()
  },
@@ -610,10 +685,114 @@
    this.newTime(this.timeValue)
    this.newDate()
    this.getDate()
    // this.$watch('carMac', () => {
    // })
    // this.getFlyData()
  },
  methods: {
    selectDuo() {
      if (this.chosee === 1) {
        this.$message.warning('请先在左侧选择无人机时间')
        return
      }
      if (this.view) {
        this.view.removeAllLayers()
        this.map.clearOverlays()
      }
      this.$request({
        // url: '/uav/queryDataByBatch',
        url: '/uav/test',
        method: 'post',
        data: {
          batch: this.batchs,
          uvasize: this.uvasize,
          height: 0,
          mac: this.macs,
          // batch: '2023-06-16 16:21:21',
        },
      }).then((res) => {
        // console.log(res)
        this.carData = []
        if (res.data === 'null') {
          this.noneData = true
          this.loading = false
          return
        }
        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])
        }
        if (this.Duovalue != '') {
          this.radioSeven = ''
        }
        this.changeCode(this.Duovalue)
        this.initStart(this.carData)
      })
    },
    chooseDate() {
      // this.$refs.datePick.focus() // 选择日期后依旧触发焦点
      this.getTimeAreaData(this.datenum)
      $('.coll').css('margin-top', '350px')
    },
    chooseDate1() {
      $('.coll').css('margin-top', '10px')
      // this.$refs.datePick.focus() // 选择日期后依旧触发焦点
    },
    gengD() {
      // if (this.zhanK === 1) {
      //   this.$message.warning('请先在左侧选择无人机和时间')
      //   return
      // }
      this.selecttrue = 2
      $('.dds').css({ height: '170px' })
      $('.numss').css({ width: '750px' })
    },
    shou() {
      this.selecttrue = 1
      $('.dds').css({ height: '100px' })
      $('.numss').css({ width: '690px' })
    },
    parseTime(time, cFormat) {
      if (arguments.length === 0 || !time) {
        return null
      }
      const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
      let date
      if (typeof time === 'object') {
        date = time
      } else {
        if (typeof time === 'string') {
          if (/^[0-9]+$/.test(time)) {
            time = parseInt(time)
          } else {
            time = time.replace(new RegExp(/-/gm), '/')
          }
        }
        if (typeof time === 'number' && time.toString().length === 10) {
          time = time * 1000
        }
        date = new Date(time)
      }
      const formatObj = {
        y: date.getFullYear(),
        m: date.getMonth() + 1,
        d: date.getDate(),
        h: date.getHours(),
        i: date.getMinutes(),
        s: date.getSeconds(),
        a: date.getDay(),
      }
      const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
        const value = formatObj[key]
        if (key === 'a') {
          return ['日', '一', '二', '三', '四', '五', '六'][value]
        }
        return value.toString().padStart(2, '0')
      })
      return time_str
    },
    newTime2(timeArr) {
      var arr = []
      timeArr.map((v) => {
@@ -707,9 +886,7 @@
      }
    },
    // 获取无人机以及时间区间
    getTimeAreaData(item, index) {
      this.asideData.activeAreaKey = -1
      this.asideData.activeKey = index
    getTimeAreaData(item) {
      this.$request({
        url: 'uav/queryTimeSlot',
        method: 'get',
@@ -718,12 +895,14 @@
          date: item,
        },
      }).then((res) => {
        console.log(res.data.vos.length, 'res.data.vos')
        if(res.data.vos.length==0){
        // console.log(res, 'res.data.vos')
        if (res.code === -47) {
          this.noneData = true
          this.loading = false
          return false
        }else{
          // this.asideData.uavTimeFly=res.message
          this.shou1 = true
        } else {
          this.shou1 = false
          this.asideData.uavTimeFly = res.data.vos
        }
        // if (res.code === 0) {
@@ -744,35 +923,50 @@
      this.addLayers(item)
    },
    // 初始化地图
    getFlyData(item, index) {
      console.log(index, 'index')
      console.log(item.batch)
    getFlyData(item, index, mac) {
      // for (var i = 0; i < this.xie.date.length; i++) {
      //   this.xie.date[i].flyLat = this.xie.date[i].flyLat + ' °'.toString()
      //   this.xie.date[i].flyLon = this.xie.date[i].flyLon + ' °'.toString()
      //   this.xie.date[i].a34004 = this.xie.date[i].a34004
      //   this.carData.push(this.xie.date[i])
      // }
      // this.initStart(this.carData)
      this.asideData.activeKey = index
      this.chosee = 2
      this.batchs = item.batch
      this.macs = mac
      this.noneData = false
      if (this.view) {
        this.view.removeAllLayers()
        this.map.clearOverlays()
      }
      this.$request({
        url: '/uav/queryDataByBatch',
        method: 'get',
        params: {
        // url: '/uav/queryDataByBatch',
        url: '/uav/test',
        method: 'post',
        data: {
          batch: item.batch,
          uvasize: this.uvasize,
          height: 0,
          mac: mac,
          // batch: '2023-06-16 16:21:21',
        },
      }).then((res) => {
        console.log(res)
        // console.log(res)
        this.carData = []
        if (res.data === 'null') {
          this.noneData = true
          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)
        this.zhanK = 2
      })
    },
    // 获取组织下存在飞行记录的日期
@@ -785,25 +979,78 @@
        },
      }).then((res) => {
        this.asideData.dates = JSON.parse(JSON.stringify(res.data.datesStr))
        this.timeNums = this.asideData.dates
        if (this.asideData.dates.length > 0) {
          this.getTimeAreaData(this.asideData.dates[0], 0)
          setTimeout(() => {
            if (this.asideData.uavTimeFly[0].timeSlot) {
              // console.log(
              //   this.asideData.uavTimeFly[0].timeSlot,
              //   'this.asideData.uavTimeFly[0].timeSlot[0]'
              // )
              this.getFlyData(this.asideData.uavTimeFly[0].timeSlot[0], 0)
            }
          }, 500)
          this.getTimeAreaData(this.datenum, 0)
          // this.datenum = this.asideData.dates[0]
          // setTimeout(() => {
          //   if (this.asideData.uavTimeFly[0].timeSlot) {
          //     console.log(
          //       this.asideData.uavTimeFly[0].timeSlot,
          //       'this.asideData.uavTimeFly[0].timeSlot'
          //     )
          //     // console.log(
          //     //   this.asideData.uavTimeFly[0].timeSlot,
          //     //   'this.asideData.uavTimeFly[0].timeSlot[0]'
          //     // )
          //     this.getFlyData(this.asideData.uavTimeFly[0].timeSlot[0], 0, mac)
          //   }
          // }, 500)
        }
      })
    },
    initStart(res) {
      // console.log(res,'res');
      this.abc += 1
      const that = this
      if (!res) {
        console.log(1)
        that.map = new BMapGL.Map('map_container')
        that.map.enableScrollWheelZoom(true) // 开启鼠标滚轮,地图可以进行放大、缩小s
        that.map.setMapType(BMAP_EARTH_MAP) // 设置地图类型为地球模式
        that.map.setDisplayOptions({
          street: false, // 是否显示路网(只对卫星图和地球模式有效)
        })
        that.map.setHeading(0) // 设置旋转角度
        if (that.viewKey === '2D') {
          that.map.setTilt(0) // 地图倾斜
        } else {
          that.map.setTilt(52)
        }
        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',
              },
            },
          ],
        })
        showNoPoints()
        return
      }
      if (this.dataType === 'history') {
@@ -819,14 +1066,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
@@ -840,47 +1087,43 @@
            point.a34002 = parseInt(value.a34002)
            point.a21026 = parseInt(value.a21026)
            point.a21004 = parseInt(value.a21004)
            point.a01006 = parseInt(value.a01006)
            point.a01001 = parseInt(value.a01001)
            point.a01002 = parseInt(value.a01002)
            point.a21005 = parseFloat(value.a21005).toFixed(3)
            point.a05024 = parseInt(value.a05024)
            point.a99054 = parseFloat(value.a99054).toFixed(3)
            if (
              value.dustld - 0 !== 0 &&
              value.dustld - 0 < 100 &&
              (that.carMac === 'p5dnd7a0243622' ||
                that.carMac === 'p5dnd7a0243625')
            ) {
              point.dustld = 100
            } else {
              point.dustld = value.dustld - 0
            }
            // point.dustld = value.dustld - 0
            point.dustld = value.dustld - 0
            trackPoints.push(point)
          }
        })
        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) {
          that.map = new BMapGL.Map('map_container')
        }
        that.map.enableScrollWheelZoom(true) // 开启鼠标滚轮,地图可以进行放大、缩小
        that.map.setMapType(BMAP_EARTH_MAP) // 设置地图类型为地球模式
        that.map.setDisplayOptions({
          street: false, // 是否显示路网(只对卫星图和地球模式有效)
        })
        that.map.setHeading(20) // 设置旋转角度
        if (that.viewKey === '2D') {
          that.map.setTilt(0) // 地图倾斜
        } else {
          that.map.setTilt(52)
        }
        // if (!that.showPoints) {
        //   console.log(111)
        //   that.map = new BMapGL.Map('map_container')
        // }
        // that.map.enableScrollWheelZoom(true) // 开启鼠标滚轮,地图可以进行放大、缩小s
        // that.map.setMapType(BMAP_EARTH_MAP) // 设置地图类型为地球模式
        // that.map.setDisplayOptions({
        //   street: false, // 是否显示路网(只对卫星图和地球模式有效)
        // })
        // that.map.setHeading(20) // 设置旋转角度
        // if (that.viewKey === '2D') {
        //   that.map.setTilt(0) // 地图倾斜
        // } else {
        //   that.map.setTilt(52)
        // }
        // 使用百度地图v3.0接口,在设置地图
        // 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,19 +1131,17 @@
        }
        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')
          that.map.centerAndZoom(that.centerPoint, that.mapZoom)
          that.view = new mapvgl.View({
            map: that.map,
          })
          that.firstPlayFlag = false
        } else {
          console.log(that.mapZoom, that.centerPoint, '2')
          this.view.removeAllLayers()
          this.map.clearOverlays()
          that.map.centerAndZoom(that.centerPoint, that.mapZoom)
@@ -957,10 +1198,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 +1278,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
      }
@@ -1097,7 +1341,7 @@
        $.each(that.showPoints, function (index, value) {
          var sw = getPoint(225, value.lng, value.lat, that.distance)
          var ne = getPoint(45, value.lng, value.lat, that.distance)
          var ne = getPoint(45, value.lng, value.lat, 30)
          var polygon = []
          var point1 = []
          var point2 = []
@@ -1370,6 +1614,24 @@
              level = 6
            }
            break
          case 'a01006':
            if (data) {
              color = '#00e400'
              level = 1
            }
            break
          case 'a01001':
            if (data) {
              color = '#00e400'
              level = 1
            }
            break
          case 'a01002':
            if (data) {
              color = '#00e400'
              level = 1
            }
            break
          case 'dustld':
            if (data < levelData[7].tab1) {
              color = '#00e400'
@@ -1497,6 +1759,15 @@
        case 'TVOC':
          this.sensorKey = 'a99054'
          break
        case '湿度':
          this.sensorKey = 'a01002'
          break
        case '温度':
          this.sensorKey = 'a01001'
          break
        case '气压':
          this.sensorKey = 'a01006'
          break
        case 'dustld':
          this.sensorKey = 'dustld'
          break
@@ -1516,7 +1787,7 @@
}
</script>
<style  lang="scss" scoped>
<style  lang="scss" >
/deep/.BMap_cpyCtrl {
  display: none;
}
@@ -1546,12 +1817,6 @@
  z-index: 10;
}
/deep/ .el-input__inner {
  height: 40px;
}
/deep/ .el-picker-panel__body {
  width: 280px;
}
.el-main {
  padding: 0;
  width: 100%;
@@ -1576,6 +1841,7 @@
  height: 38px;
  border-radius: 0;
  width: 80px;
  line-height: 0.5;
}
.per-date {
  height: 50px;
@@ -1613,6 +1879,7 @@
}
.activeArea {
  background-color: #f5f7fa;
  color: rgb(36, 36, 36);
}
/*文本样式*/
.textShow {
@@ -1640,6 +1907,12 @@
.per-text-data:nth-last-child(1) {
  padding-bottom: 8px;
}
.el-collapse {
  border-top: 1px solid #ebeef5;
  border-bottom: 1px solid #ebeef5;
  width: 280px;
}
/deep/.el-scrollbar__wrap {
  overflow-x: hidden;
  //overflow-y: hidden;
@@ -1686,4 +1959,92 @@
  font-size: 14px;
  font-family: '微软雅黑';
}
</style>
/deep/.inputNum {
  width: 4% !important;
}
.dateArrClass {
  position: relative;
}
.dateArrClass > div ::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 23px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  z-index: 999;
  background-color: #f40;
}
.numss {
  width: 690px;
  background-color: white;
  padding: 10px;
  margin-top: 17px;
  display: flex;
}
/deep/.el-select {
  width: 8% !important;
}
.Duo {
  height: 60px;
  display: flex;
  overflow: hidden;
  background-color: white;
  width: 750px;
  padding-left: 10px;
  margin-top: 17px;
}
.spantu {
  width: 190px;
  // margin-top: 10px;
  // margin-left: 20px;
  // background-color: white;
  // height: 40px;
  display: flex;
  margin-left: 25px;
  line-height: 60px;
  font-weight: 5px;
  .inputtu {
    width: 40%;
    margin-left: 5px;
  }
}
.slee {
  line-height: 60px;
  width: 100px;
}
.spantuu {
  margin-left: 25px;
  width: 400px;
  line-height: 60px;
  .inputtu {
    width: 20%;
  }
}
.jlpMySelectPopper.el-picker-panel {
  width: 280px;
  height: 330px;
}
.jlpMySelectPopper.el-date-picker table {
  width: 88%;
}
.BMap_cpyCtrl {
  display: none;
}
.anchorBL {
  display: none;
}
.el-collapse-item__arrow.is-active {
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
  position: absolute;
  top: -3px;
  right: -3px;
}
/* 解决自定义滚动条 x 轴显示问题 */
.el-scrollbar__wrap {
  overflow-x: hidden;
}
</style>