| | |
| | | <layer-manage v-show="checkMenuFlag == 'l1'"> </layer-manage> |
| | | <plotting v-show="checkMenuFlag == 'l2'"> </plotting> |
| | | <baseMapSwitching v-show="checkMenuFlag == 'l5'"> </baseMapSwitching> |
| | | <search> </search> |
| | | <search v-if="thematicMapBtnState"> </search> |
| | | </div> |
| | | <top-btn v-show="fullScreen"></top-btn> |
| | | <div class="fullScreen_btn"></div> |
| | | <top-btn v-show="fullScreen" v-if="thematicMapBtnState"></top-btn> |
| | | <thematic-map v-show="!thematicMapBtnState"></thematic-map> |
| | | <div class="fullScreen_btn" v-show="!fullScreen" @click="screen"></div> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | |
| | | import menuTool from "@/assets/js/Map/menuTool"; |
| | | //顶部菜单 |
| | | import topBtn from "@/components/topBtn.vue"; |
| | | //专题图菜单 |
| | | import thematicMap from "@/components/thematicMap/thematicMap.vue"; |
| | | //图层管理页面 |
| | | import layerManage from "@/views/layer/layerManage.vue"; |
| | | //地理编码搜索 |
| | |
| | | const menuOptions = ref([]); |
| | | const checkMenuFlag = ref(""); |
| | | let fullScreen = ref(true); |
| | | let thematicMapState = ref(true); |
| | | let thematicMapBtnState = ref(true); |
| | | const setMenuClick = (res) => { |
| | | if (res.id == "l6") { |
| | | fullScreen.value = !fullScreen.value; |
| | | // fullScreen.value = !fullScreen.value; |
| | | screen(); |
| | | } |
| | | if (res.id == "l3") { |
| | | thematicMapState.value = false; |
| | | thematicMapBtnState.value = false; |
| | | } else { |
| | | thematicMapState.value = true; |
| | | thematicMapBtnState.value = true; |
| | | } |
| | | if (checkMenuFlag.value && checkMenuFlag.value == res.id) { |
| | | checkMenuFlag.value = null; |
| | |
| | | menuTool.leftTools(res); |
| | | } |
| | | }; |
| | | // 切换浏览器全屏 |
| | | const screen = () => { |
| | | fullScreen.value = !fullScreen.value; |
| | | |
| | | if (fullScreen.value) { |
| | | // 退出全屏 |
| | | if (document.exitFullscreen) { |
| | | document.exitFullscreen(); |
| | | } else if (document.mozCancelFullScreen) { |
| | | document.mozCancelFullScreen(); |
| | | } else if (document.webkitExitFullscreen) { |
| | | document.webkitExitFullscreen(); |
| | | } |
| | | } else { |
| | | var element = document.body; |
| | | if (element.requestFullscreen) { |
| | | element.requestFullscreen(); |
| | | } else if (element.mozRequestFullScreen) { |
| | | element.mozRequestFullScreen(); |
| | | } else if (element.webkitRequestFullscreen) { |
| | | element.webkitRequestFullscreen(); |
| | | } else if (element.msRequestFullscreen) { |
| | | element.msRequestFullscreen(); |
| | | } |
| | | } |
| | | }; |
| | | // 监听浏览器全屏事件 |
| | | document.addEventListener("fullscreenchange", () => { |
| | | if (!isFullScreen()) { |
| | | if (!fullScreen.value) { |
| | | fullScreen.value = !fullScreen.value; |
| | | console.log(fullScreen.value); |
| | | } |
| | | } |
| | | console.log(isFullScreen()); |
| | | }); |
| | | // 判断是否全屏 |
| | | function isFullScreen() { |
| | | return ( |
| | | document.isFullScreen || |
| | | document.mozIsFullScreen || |
| | | document.webkitIsFullScreen |
| | | ); |
| | | } |
| | | onMounted(() => { |
| | | menuOptions.value = menuData.leftMenu; |
| | | }); |
| | |
| | | display: flex; |
| | | } |
| | | .fullScreen_btn { |
| | | // background: url("../assets/img/形状 3.png") no-repeat center; |
| | | // background-size: 100% 100%; |
| | | background: url("../assets/img/leftBtn/合集_03.png") no-repeat center; |
| | | background-size: 100% 100%; |
| | | width: 30px; |
| | | height: 30px; |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 20px; |
| | | } |
| | | .fullScreen_btn:hover { |
| | | background: url("../assets/img/leftBtn/合集_03-02.png") no-repeat center; |
| | | background-size: 100% 100%; |
| | | cursor: pointer; |
| | | } |
| | | </style> |