From 5cf33b2b4217dbe50e7fa0599e09e0ee8ae63db4 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 15 Feb 2022 15:33:02 +0800
Subject: [PATCH] 样式修改

---
 src/components/map/index.vue |  108 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 94 insertions(+), 14 deletions(-)

diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index 003d3a2..7546c3d 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -1,10 +1,21 @@
 /* eslint-disable camelcase */
 <template>
-    <div id="viewer-container"
-         style="height: 100%; width: 100%;"
-         @click="mapClick($event)">
+    <div id="viewer-container" style="height: 100%; width: 100%;" @click="mapClick($event)">
+        <video
+            id="video"
+            style="position: fixed;
+                visibility: hidden;"
+            muted
+            autoplay
+            loop
+            crossorigin
+            controls
+        >
+            <source src="http://dc.dvgis.cn/examples/data/demo.mp4" type="video/mp4" />
+        </video>
 
-        <div style="
+        <div
+            style="
             position: fixed;
             left: 4px;
             bottom: 4px;
@@ -16,11 +27,10 @@
             border-radius: 4px;
             background: #2196f3ed;
             z-index: 11;
-        ">
-            智慧社区
-        </div>
+        "
+        >智慧社区</div>
 
-        <dimension />
+        <dimension :areaLayer="areaLayer" />
 
         <left-nav ref="leftNav"></left-nav>
 
@@ -28,16 +38,15 @@
 
         <campusBuildingSearch ref="campusBuildingSearch" />
 
-        <campusNav ref="campusNavRoute"
-                   v-show="campusNavFlag" />
+        <campusNav ref="campusNavRoute" v-show="campusNavFlag" />
 
+        <search-details v-if="searchPopupFlag"></search-details>
         <org-nav-bar v-if="orgNavBarFlag"></org-nav-bar>
         <arc-nav-bar v-if="arcNavBarFlag"></arc-nav-bar>
     </div>
 </template>
 <script>
 
-import axios from 'axios'
 import { mapGetters } from 'vuex'
 import mapPopup from './components/mapPopup.vue'
 import campusBuildingSearch from './components/campusBuildingSearch.vue'
@@ -52,7 +61,67 @@
     },
     data () {
         return {
-            DC: null
+            DC: null,
+            areaLayer: null
+        }
+    },
+    watch: {
+        searchPopupFlag: {
+            immediate: true,
+            handler (newVal, oldVal) {
+                if (newVal == true) {
+                    if (this.$route.path.indexOf('/pcLayout/default/service') != -1) {
+                        this.$store.dispatch('delVisitedViews', this.$route)
+                        this.$router.push('/pcLayout/default')
+                    }
+
+                    if (this.$route.path.indexOf('/orgnav') != -1) {
+                        this.$store.dispatch('delVisitedViews', this.$route)
+                        this.$router.push('/pcLayout/default')
+                        this.$store.commit('SET_ORGNAVBARTITLE', '')
+                        this.$store.commit('SET_ORGNAVBARLIST', [])
+                        this.$store.commit('SET_ORGNAVBARFLAG', false)
+                    }
+
+                    if (this.orgNavBarFlag == true) {
+                        this.$store.commit('SET_ORGNAVBARTITLE', '')
+                        this.$store.commit('SET_ORGNAVBARLIST', [])
+                        this.$store.commit('SET_ORGNAVBARFLAG', false)
+                    }
+
+                    if (this.$route.path.indexOf('/arc') != -1) {
+                        this.$store.dispatch('delVisitedViews', this.$route)
+                        this.$router.push('/pcLayout/default')
+                        this.$store.commit('SET_ARCNAVBARTITLE', '')
+                        this.$store.commit('SET_ARCNAVBARCODE', '')
+                        this.$store.commit('SET_ARCNAVBARFLAG', false)
+                    }
+
+                    if (this.arcNavBarFlag == true) {
+                        this.$store.commit('SET_ARCNAVBARTITLE', '')
+                        this.$store.commit('SET_ARCNAVBARCODE', '')
+                        this.$store.commit('SET_ARCNAVBARFLAG', false)
+                    }
+                }
+            }
+        },
+
+        orgNavBarFlag: {
+            immediate: true,
+            handler (newVal, oldVal) {
+                if (newVal == true) {
+                    this.$store.commit('SET_SEARCHPOPUPFLAG', false)
+                }
+            }
+        },
+
+        arcNavBarFlag: {
+            immediate: true,
+            handler (newVal, oldVal) {
+                if (newVal == true) {
+                    this.$store.commit('SET_SEARCHPOPUPFLAG', false)
+                }
+            }
         }
     },
     computed: {
@@ -81,7 +150,8 @@
             // 社区内导航的显示关闭
             'campusNavFlag',
             'orgNavBarFlag',
-            'arcNavBarFlag'
+            'arcNavBarFlag',
+            'searchPopupFlag'
         ])
     },
     mounted () {
@@ -154,6 +224,8 @@
                     }
                 }
             })
+
+            that.createdLayers(viewer)
 
             that.$store.commit('SET_VIEWER', viewer)
 
@@ -279,7 +351,7 @@
             //     name: '地形'
             // })
 
-            // viewer.use(new that.DC.Measure())
+            viewer.use(new that.DC.Measure())
 
             // viewer.flyToPosition(
             //     new that.DC.Position(117.08489820, 31.65413916, 1500, 0, -90, 45)
@@ -305,6 +377,14 @@
         mapClick (e) {
             this.$refs.campusNavRoute.shortcutShow(e)
             this.$refs.campusBuildingSearch.shortcutShow(e)
+        },
+
+        createdLayers (viewer) {
+            const layerGroup = new this.DC.LayerGroup('modelBox')
+            viewer.addLayerGroup(layerGroup)
+
+            this.areaLayer = new this.DC.VectorLayer('areaLayer')
+            layerGroup.addLayer(this.areaLayer)
         }
     }
 }

--
Gitblit v1.9.3