From d834db340790851078fd384dbccbfa21d2d8b5df Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 10 Feb 2022 09:02:34 +0800
Subject: [PATCH] +解决(点击建筑后,生成的绿布,不会被点击其他关闭)

---
 src/components/map/components/mapPopup.vue |   66 ++++++++------------------------
 1 files changed, 17 insertions(+), 49 deletions(-)

diff --git a/src/components/map/components/mapPopup.vue b/src/components/map/components/mapPopup.vue
index 78e94f7..743a336 100644
--- a/src/components/map/components/mapPopup.vue
+++ b/src/components/map/components/mapPopup.vue
@@ -59,7 +59,8 @@
                                                     <i class="popup-icon start-nav deblurring"></i>
                                                     出发
                                                 </li>
-                                                <li @click="qrCodeClick">
+                                                <li v-show="false"
+                                                    @click="qrCodeClick">
                                                     <i class="popup-icon qr-code-nav deblurring"></i>
                                                     二维码
                                                 </li>
@@ -72,7 +73,8 @@
                                                     <i class="popup-icon live-action-nav deblurring"></i>
                                                     实景
                                                 </li>
-                                                <li v-show="panoramaUrl != null && panoramaUrl != ''"
+                                                <!-- v-show="panoramaUrl != null && panoramaUrl != ''" -->
+                                                <li v-show="false"
                                                     @click="monitorClick">
                                                     <i class="popup-icon monitor-nav deblurring"></i>
                                                     监控
@@ -130,25 +132,26 @@
 
             <div v-if="panoramaPopup"
                  class="panorama-dom"
+                 :class="{'change-full': fullscreen}"
                  id="PanoramaBox">
                 <div style="width: 100%; height: 100%;">
                     <div class="panorama-container">
                         <div class="panorama-wrap">
-                            <div class="content-wrap">
+                            <div class="content-wrap"
+                                 :class="{'change-full': fullscreen}"
+                                 id="FullScreenBox">
                                 <div class="title">
                                     {{ stateName }}
+                                    <img @click="screen"
+                                         class="full-srceen-btn"
+                                         :src="fullScreenUrl"
+                                         alt="" />
                                     <img @click="closePanoramaPopupBox"
                                          class="close-box"
                                          src="/img/navicon/close.png"
                                          alt="" />
                                 </div>
-                                <div class="content"
-                                     id="FullScreenBox">
-                                    <button type="button"
-                                            @click="screen">
-                                        <img :src="fullScreenUrl"
-                                             alt="" />
-                                    </button>
+                                <div class="content">
                                     <iframe allowfullscreen="true"
                                             :src="panoramaUrl"
                                             frameborder="0"></iframe>
@@ -290,31 +293,7 @@
         }
     },
     mounted () {
-        var that = this
-        this.$nextTick(() => {
-            window.onresize = function () {
-                if (!checkFull()) {
-                    // 要执行的动作
-                    that.fullScreenUrl = '/img/icon/bigScreen.png'
 
-                    if (document.documentElement.requestFullScreen) {
-                        document.exitFullScreen()
-                    } else if (document.documentElement.webkitRequestFullScreen) {
-                        document.webkitCancelFullScreen()
-                    } else if (document.documentElement.mozRequestFullScreen) {
-                        document.mozCancelFullScreen()
-                    }
-                    that.fullscreen = false
-                }
-            }
-
-            function checkFull () {
-                return document.fullscreenElement ||
-                    document.msFullscreenElement ||
-                    document.mozFullScreenElement ||
-                    document.webkitFullscreenElement || false
-            }
-        })
     },
     watch: {
         introduceText: {
@@ -363,29 +342,16 @@
     },
     methods: {
         screen () {
-            const element = document.getElementById('FullScreenBox')
             if (this.fullscreen) {
                 this.fullScreenUrl = '/img/icon/bigScreen.png'
                 this.fullscreen = !this.fullscreen
 
-                if (document.documentElement.requestFullScreen) {
-                    document.exitFullScreen()
-                } else if (document.documentElement.webkitRequestFullScreen) {
-                    document.webkitCancelFullScreen()
-                } else if (document.documentElement.mozRequestFullScreen) {
-                    document.mozCancelFullScreen()
-                }
+                document.getElementById('pcElHeader').style.zIndex = 9999
             } else {
                 this.fullScreenUrl = '/img/icon/smallScreen.png'
                 this.fullscreen = !this.fullscreen
 
-                if (element.requestFullScreen) {
-                    element.requestFullScreen()
-                } else if (element.webkitRequestFullScreen) {
-                    element.webkitRequestFullScreen()
-                } else if (element.mozRequestFullScreen) {
-                    element.mozRequestFullScreen()
-                }
+                document.getElementById('pcElHeader').style.zIndex = 9
             }
         },
 
@@ -426,6 +392,7 @@
 
             // eslint-disable-next-line new-cap
             var positions = this.DC.Transform.transformWGS84ToCartesian(
+                // eslint-disable-next-line new-cap
                 new this.DC.Position.fromArray(this.pointPosition)
             )
             this.viewer.scene.globe.depthTestAgainstTerrain = false
@@ -448,6 +415,7 @@
             }
             // eslint-disable-next-line new-cap
             var positions = this.DC.Transform.transformWGS84ToCartesian(
+                // eslint-disable-next-line new-cap
                 new this.DC.Position.fromArray(this.pointPosition)
             )
             this.viewer.scene.globe.depthTestAgainstTerrain = false

--
Gitblit v1.9.3