DroneDetail.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <div class="detail-dialog" v-drag="{ draggable: true, scale: containerScale, handle: '.dialog-header' }">
  3. <div class="dialog-header">
  4. <div class="gradient-text">详情</div>
  5. <div class="close-btn" @click="handleClose" />
  6. </div>
  7. <div class="dialog-content">
  8. <div class="video-box">
  9. <HKVideo ref="videoRef" :dot_data="videoData" :isNoLive="isFlyVideo" autoplay />
  10. </div>
  11. <div class="title-box">{{ detailData.name }}</div>
  12. <div class="btn-box">
  13. <div class="btn1" @click="handleFullScreen">
  14. <i class="icon-full" />
  15. <div>视频全屏</div>
  16. </div>
  17. <div class="btn2" @click="handleVideoRefresh">
  18. <i class="icon-refresh" />
  19. <div>刷新</div>
  20. </div>
  21. <div class="btn3" @click="handleSwitchFlyVideo">
  22. <i class="icon-switch" />
  23. <div>{{ isFlyVideo ? '切换监控视频' : '切换飞行视频' }}</div>
  24. </div>
  25. </div>
  26. <div class="title-box2">
  27. <i class="icon-info" />
  28. <div>机库/无人机信息</div>
  29. </div>
  30. <div class="box">
  31. <div class="box-flex">
  32. <i class="icon1" />
  33. <div class="gradient-text">机库</div>
  34. </div>
  35. <div class="box-right">
  36. <div class="box-line">
  37. <div class="box-item" style="flex: 1">
  38. <div>网速:</div>
  39. <div class="gradient-text">
  40. {{ detailData.hangarInfo && !!detailData.hangarInfo.internetSpeed ? detailData.hangarInfo.internetSpeed : '-' }}
  41. </div>
  42. <div>kb/s</div>
  43. </div>
  44. <div class="box-item" style="flex: 1">
  45. <div>机房温度:</div>
  46. <div class="gradient-text">
  47. {{ detailData.hangarInfo && !!detailData.hangarInfo.temperature ? detailData.hangarInfo.temperature : '-' }}
  48. </div>
  49. <div>℃</div>
  50. </div>
  51. </div>
  52. <div class="box-line">
  53. <div class="box-item">
  54. <div>机库风速:</div>
  55. <div class="gradient-text">
  56. {{ detailData.hangarInfo && !!detailData.hangarInfo.windSpeed ? detailData.hangarInfo.windSpeed : '-' }}
  57. </div>
  58. <div>m/s</div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="box">
  64. <div class="box-flex">
  65. <i class="icon2" />
  66. <div class="gradient-text">无人机</div>
  67. </div>
  68. <div class="box-right">
  69. <div class="box-line">
  70. <div class="box-item" style="flex: 1">
  71. <div>网速:</div>
  72. <div class="gradient-text">
  73. {{ detailData.droneInfo && !!detailData.droneInfo.internetSpeed ? detailData.droneInfo.internetSpeed : '-' }}
  74. </div>
  75. <div>kb/s</div>
  76. </div>
  77. <div class="box-item" style="flex: 1">
  78. <div>机房温度:</div>
  79. <div class="gradient-text">
  80. {{ detailData.droneInfo && !!detailData.droneInfo.temperature ? Number(detailData.fly_info.temperature).toFixed(1) : '-' }}
  81. </div>
  82. <div>℃</div>
  83. </div>
  84. </div>
  85. <div class="box-line">
  86. <div class="box-item">
  87. <div>机库风速:</div>
  88. <div class="gradient-text">
  89. {{ detailData.droneInfo && !!detailData.droneInfo.windSpeed ? detailData.droneInfo.windSpeed : '-' }}
  90. </div>
  91. <div>m/s</div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </template>
  99. <script lang="ts" setup>
  100. import HKVideo from '@/components/HKVideo/index2.vue';
  101. interface DetailData {
  102. name: string;
  103. fly_url: string;
  104. nest_url: string;
  105. }
  106. const props = defineProps({
  107. modelValue: Boolean,
  108. detailData: Object as PropType<DetailData>,
  109. id: String
  110. });
  111. const emits = defineEmits(['update:modelValue']);
  112. const containerScale = inject('containerScale');
  113. let isFlyVideo = ref(false);
  114. const videoData = computed(() => {
  115. const data = props.detailData ? props.detailData : { drone_name: '', fly_url: '', nest_url: '' };
  116. return {
  117. name: data.drone_name,
  118. video_code: !!isFlyVideo.value ? data.fly_url : data.nest_url
  119. };
  120. });
  121. let videoRef = ref();
  122. // 视频全屏
  123. const handleFullScreen = () => {
  124. videoRef.value.handleFullScreen();
  125. };
  126. // 刷新
  127. const handleVideoRefresh = () => {
  128. videoRef.value.refresh_data();
  129. };
  130. // 切换飞行视频
  131. const handleSwitchFlyVideo = () => {
  132. isFlyVideo.value = !isFlyVideo.value;
  133. nextTick(() => {
  134. handleVideoRefresh();
  135. });
  136. };
  137. const handleClose = () => {
  138. emits('update:modelValue', false);
  139. };
  140. </script>
  141. <style lang="scss" scoped>
  142. .detail-dialog {
  143. position: absolute;
  144. top: 0;
  145. left: -402px;
  146. width: 402px;
  147. z-index: 9;
  148. height: 757px;
  149. background: url('@/assets/images/map/rightMenu/uva/content4.png') no-repeat;
  150. background-size: 100% 100%;
  151. padding: 20px 35px;
  152. .dialog-header {
  153. width: 332px;
  154. height: 44px;
  155. background: url('@/assets/images/map/rightMenu/uva/line.png') no-repeat left bottom;
  156. background-size: 100% 28px;
  157. position: relative;
  158. .gradient-text {
  159. font-size: 26px;
  160. padding-left: 10px;
  161. padding-top: 6px;
  162. }
  163. .close-btn {
  164. position: absolute;
  165. top: 9px;
  166. right: 5px;
  167. width: 15px;
  168. height: 15px;
  169. background: url('@/assets/images/map/rightMenu/uva/close.png') no-repeat;
  170. background-size: 100% 100%;
  171. cursor: pointer;
  172. }
  173. }
  174. .dialog-content {
  175. padding: 0 6px;
  176. .video-box {
  177. width: 100%;
  178. height: 150px;
  179. background: url('@/assets/images/video/videoBg.png') no-repeat;
  180. background-size: 100% 100%;
  181. padding: 8px 5px 8px 8px;
  182. }
  183. .title-box {
  184. width: 406px;
  185. height: 43px;
  186. background: url('@/assets/images/map/rightMenu/uva/titleBox.png') no-repeat left bottom;
  187. background-size: 100% 41px;
  188. color: #fff;
  189. font-size: 16px;
  190. padding-left: 32px;
  191. }
  192. .btn-box {
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. margin-bottom: 6px;
  197. .btn1 {
  198. width: 105px;
  199. height: 28px;
  200. background: url('@/assets/images/map/rightMenu/uva/btn3.png') no-repeat;
  201. }
  202. .btn2 {
  203. width: 62px;
  204. height: 28px;
  205. background: url('@/assets/images/map/rightMenu/uva/btn4.png') no-repeat;
  206. }
  207. .btn3 {
  208. width: 132px;
  209. height: 28px;
  210. background: url('@/assets/images/map/rightMenu/uva/btn5.png') no-repeat;
  211. }
  212. .btn1,
  213. .btn2,
  214. .btn3 {
  215. background-size: 100% 100%;
  216. cursor: pointer;
  217. display: flex;
  218. align-items: center;
  219. justify-content: center;
  220. color: #f2f6f8;
  221. font-size: 16px;
  222. }
  223. .icon-full {
  224. margin-left: -3px;
  225. width: 24px;
  226. height: 24px;
  227. background: url('@/assets/images/map/rightMenu/uva/full.png') no-repeat;
  228. background-size: 100% 100%;
  229. }
  230. .icon-refresh {
  231. margin-left: -3px;
  232. width: 24px;
  233. height: 24px;
  234. background: url('@/assets/images/map/rightMenu/uva/refresh.png') no-repeat;
  235. background-size: 100% 100%;
  236. }
  237. .icon-switch {
  238. margin-left: -3px;
  239. width: 22px;
  240. height: 22px;
  241. background: url('@/assets/images/map/rightMenu/uva/switch.png') no-repeat;
  242. background-size: 100% 100%;
  243. }
  244. }
  245. .title-box2 {
  246. width: 171px;
  247. height: 32px;
  248. background: url('@/assets/images/map/rightMenu/uva/titleBox2.png') no-repeat;
  249. background-size: 100% 100%;
  250. color: #fff;
  251. font-size: 16px;
  252. display: flex;
  253. align-items: center;
  254. padding-left: 6px;
  255. .icon-info {
  256. width: 41px;
  257. height: 45px;
  258. background: url('@/assets/images/map/rightMenu/uva/info2.png') no-repeat;
  259. background-size: 100% 100%;
  260. margin-right: 3px;
  261. }
  262. }
  263. .box {
  264. width: 316px;
  265. height: 82px;
  266. background: url('@/assets/images/map/rightMenu/uva/box.png') no-repeat;
  267. background-size: 100% 100%;
  268. display: flex;
  269. align-items: center;
  270. justify-content: space-between;
  271. padding: 6px 15px;
  272. .box-flex {
  273. display: flex;
  274. flex-direction: column;
  275. align-items: center;
  276. margin-right: 25px;
  277. .gradient-text {
  278. font-weight: normal;
  279. }
  280. }
  281. .icon1 {
  282. width: 52px;
  283. height: 59px;
  284. background: url('@/assets/images/map/rightMenu/uva/icon1.png') no-repeat;
  285. background-size: 100% 100%;
  286. }
  287. .icon2 {
  288. width: 52px;
  289. height: 56px;
  290. background: url('@/assets/images/map/rightMenu/uva/icon2.png') no-repeat;
  291. background-size: 100% 100%;
  292. }
  293. .box-right {
  294. flex: 1;
  295. .box-line {
  296. display: flex;
  297. padding: 3px 0;
  298. }
  299. .box-item {
  300. display: flex;
  301. color: #7a9ab6;
  302. font-size: 14px;
  303. .gradient-text {
  304. margin-right: 3px;
  305. }
  306. }
  307. }
  308. }
  309. }
  310. }
  311. </style>