Эх сурвалжийг харах

feat(views): 优化“实时监测”页面的全屏切换逻辑

1. 跳转设备工况页面时,退出全屏
wangcong 2 долоо хоног өмнө
parent
commit
7934648ef6

+ 3 - 0
src/views/real-time-monitor/DeviceCtrlModal.vue

@@ -1,6 +1,7 @@
 <script setup lang="ts">
 import { computed, onUnmounted, ref, watch } from 'vue';
 import { useRouter } from 'vue-router';
+import { useFullscreen } from '@vueuse/core';
 import { Modal } from 'ant-design-vue';
 
 import SvgIcon from '@/components/SvgIcon.vue';
@@ -171,6 +172,7 @@ const handleStartStopSwitch = () => {
 };
 
 const router = useRouter();
+const { exit } = useFullscreen();
 
 const goDevWorkStatus = () => {
   if (!props.info?.deviceQueryVo) {
@@ -178,6 +180,7 @@ const goDevWorkStatus = () => {
   }
 
   const { id, groupId, deviceType } = props.info.deviceQueryVo;
+  exit();
 
   router.push({
     path: `/ai-smart-ctrl/device-group/${groupId}`,

+ 1 - 1
src/views/real-time-monitor/RealTimeMonitor.vue

@@ -139,7 +139,7 @@ const exportImg = () => {
   visual2DPreviewRef.value?.exportImg();
 };
 
-const { isFullscreen, enter } = useFullscreen(document.body);
+const { isFullscreen, enter } = useFullscreen();
 
 const maximizeView = () => {
   enter();