husq
2023-09-19 8e9a7434bd72959be5d8a2c7882189a800b85dfd
src/components/GMap.vue
@@ -917,10 +917,10 @@
    }
    // 下拉框选择变化
    const selectChange = async (e) => {
      await closeFly()
      setTimeout(async () => {
        await flyOnStart()
      }, 500)
      // await closeFly()
      // setTimeout(async () => {
      await flyOnStart()
      // }, 500)
    }
    // 关闭设备直播
    const onClose = async () => {
@@ -936,6 +936,7 @@
    }
    // 飞机设备播放
    const flyOnStart = async () => {
      aircraftUrl.value = ''
      const videoId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '/' + aircraSelected.value + '/' + 'normal-0'
      const streamId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '-' + aircraSelected.value + '-' + 'normal-0'
      const liveURL = config.rtmpURL + streamId
@@ -952,16 +953,22 @@
    }
    // 飞行设备关闭
    const closeFly = async () => {
      const videoId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '/' + aircraSelected.value + '/' + 'normal-0'
      aircraftList.value.forEach(item => {
        const videoId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '/' + item.value + '/' + 'normal-0'
        stopLivestream({
          video_id: videoId
        }).then(res => {
          console.log(res, 'res')
          if (res.code === 0) {
            aircraftUrl.value = ''
          }
        }).catch(e => {
          console.log(e, 'errrrrrrrrrrrrrr')
        })
      })
      // const videoId = deviceInfo.dock.basic_osd?.sub_device?.device_sn + '/' + aircraSelected.value + '/' + 'normal-0'
      aircraftList.value = []
      aircraSelected.value = ''
      stopLivestream({
        video_id: videoId
      }).then(res => {
        if (res.code === 0) {
          aircraftUrl.value = ''
        }
      })
    }
    watch(() => store.state.deviceStatusEvent,
      data => {