Commit 29b360e45431df067a5805bedb180876a1876496

Authored by ww
1 parent 6bf48057

perf: exit full screen can not enter full screen agin

1 1 <script setup lang="ts">
2 2 import { PageWrapper } from '/@/components/Page';
3 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 5 import { Tabs, Row, Col, Spin, Button } from 'ant-design-vue';
6 6 import { cameraPage } from '/@/api/camera/cameraManager';
7 7 import { CameraRecord } from '/@/api/camera/model/cameraModel';
... ... @@ -86,12 +86,16 @@
86 86 getCameraList();
87 87 };
88 88
89   - const { enter } = useFullscreen(videoContainer);
  89 + const { enter, isFullscreen } = useFullscreen(videoContainer);
90 90
91 91 const handleFullScreen = () => {
92 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 99 const handleChangeMode = (activeKey: string) => {
96 100 if (activeKey === PageMode.FULL_SCREEN_MODE) {
97 101 handleFullScreen();
... ...