Commit 29b360e45431df067a5805bedb180876a1876496
1 parent
6bf48057
perf: exit full screen can not enter full screen agin
Showing
1 changed file
with
6 additions
and
2 deletions
1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
2 | import { PageWrapper } from '/@/components/Page'; | 2 | import { PageWrapper } from '/@/components/Page'; |
3 | import OrganizationIdTree from '../../common/organizationIdTree/src/OrganizationIdTree.vue'; | 3 | import OrganizationIdTree from '../../common/organizationIdTree/src/OrganizationIdTree.vue'; |
4 | - import { computed, onMounted, reactive, ref, unref } from 'vue'; | 4 | + import { computed, onMounted, reactive, ref, unref, watch } from 'vue'; |
5 | import { Tabs, Row, Col, Spin, Button } from 'ant-design-vue'; | 5 | import { Tabs, Row, Col, Spin, Button } from 'ant-design-vue'; |
6 | import { cameraPage } from '/@/api/camera/cameraManager'; | 6 | import { cameraPage } from '/@/api/camera/cameraManager'; |
7 | import { CameraRecord } from '/@/api/camera/model/cameraModel'; | 7 | import { CameraRecord } from '/@/api/camera/model/cameraModel'; |
@@ -86,12 +86,16 @@ | @@ -86,12 +86,16 @@ | ||
86 | getCameraList(); | 86 | getCameraList(); |
87 | }; | 87 | }; |
88 | 88 | ||
89 | - const { enter } = useFullscreen(videoContainer); | 89 | + const { enter, isFullscreen } = useFullscreen(videoContainer); |
90 | 90 | ||
91 | const handleFullScreen = () => { | 91 | const handleFullScreen = () => { |
92 | enter(); | 92 | enter(); |
93 | }; | 93 | }; |
94 | 94 | ||
95 | + watch(isFullscreen, () => { | ||
96 | + activeKey.value = unref(isFullscreen) ? PageMode.FULL_SCREEN_MODE : PageMode.SPLIT_SCREEN_MODE; | ||
97 | + }); | ||
98 | + | ||
95 | const handleChangeMode = (activeKey: string) => { | 99 | const handleChangeMode = (activeKey: string) => { |
96 | if (activeKey === PageMode.FULL_SCREEN_MODE) { | 100 | if (activeKey === PageMode.FULL_SCREEN_MODE) { |
97 | handleFullScreen(); | 101 | handleFullScreen(); |