forked from drone/command-center-dashboard

罗广辉
2025-04-03 7635213630830c4cbb9ff6ada69ba9b5c8a35d42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!-- 机巢监控 -->
<template>
  <CommonTitle title="机巢监控" />
  <div :style="{ marginLeft: pxToRem(14) }">
    <div class="machine-monitor">
      <LiveVideo :videoUrl="airPortUrl" />
    </div>
  </div>
</template>
 
<script setup>
import CommonTitle from '@/components/CommonTitle.vue';
import LiveVideo from '@/components/LiveVideo.vue';
import { liveStart } from '@/api/home/machineNest';
// import { CURRENT_CONFIG as config } from '@/utils/http/config'
import { useStore } from 'vuex';
 
 
const store = useStore();
// 单个机巢信息
const singleUavHome = computed(() => store.state.home.singleUavHome);
// 直播地址
let airPortUrl = ref('');
// 获取直播地址
const getVideoUrl = () => {
  liveStart(singleUavHome.value.device_sn).then(res => {
    if (res.data.code !== 0) return;
    airPortUrl.value = res.data.data.rtcs_url;
  });
};
onMounted(() => {
  getVideoUrl();
});
</script>
 
<style lang="scss" scoped>
  .machine-monitor {
    width: 390px;
    height: 228px;
    background: linear-gradient(
      270deg,
      #1f3e7a 0%,
      rgba(31, 62, 122, 0.35) 79%,
      rgba(31, 62, 122, 0) 100%
    );
    opacity: 0.85;
    margin: 2px 0 13 0;
    display: flex;
    justify-content: space-between;
    padding: 12px 10px 0;
 }
</style>