From d1472f024ff3b3ef426724359c175a36ee21dc6c Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 05 Dec 2023 15:57:00 +0800
Subject: [PATCH] 校园切换方式更换

---
 src/components/mobilemap/index.vue |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index b5675ce..5ba092b 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -1,6 +1,25 @@
 <template>
     <div class="mobile-map-container">
         <div id="sceneview"></div>
+
+        <mobileCortrolSearch ref="mobileCortrolSearch">
+            <template slot="selectCampusBox">
+                <div class="select-campus-box" v-if="campusData.length > 1">
+                    <el-dropdown trigger="click" @command="handleCommand">
+                        <span class="el-dropdown-link icons">
+                            {{ campusData.find(item => item.dictKey == campusValue).dictValue }} <i
+                                class="el-icon-caret-bottom"></i>
+                        </span>
+                        <el-dropdown-menu slot="dropdown">
+                            <el-dropdown-item v-for="(item, index) in campusData" :key="index" :command="item">
+                                {{ item.dictValue }}
+                            </el-dropdown-item>
+                        </el-dropdown-menu>
+                    </el-dropdown>
+                </div>
+            </template>
+        </mobileCortrolSearch>
+
         <!-- 随地图改变图标弹窗↓ -->
         <div id="mobile-map_popup_content"></div>
         <mobileWindow ref="MobileWindow"></mobileWindow>
@@ -12,7 +31,6 @@
         <mobileCortrol ref="mobileCortrol"></mobileCortrol>
         <mobileCortrolButtom ref="mobileCortrolButtom" :mapCenter="mapCenter" :frislayertHeight="frislayertHeight">
         </mobileCortrolButtom>
-        <mobileCortrolSearch ref="mobileCortrolSearch"></mobileCortrolSearch>
         <!-- 控制↑ -->
         <!-- 控制大弹窗的弹窗 -->
         <!-- v-if="mBigPopupAfter" -->
@@ -37,6 +55,7 @@
 import axios from 'axios'
 import { mapGetters } from 'vuex'
 import { getBuildClock } from '@/api/mobile/buildsClock/buildsClock' // 楼栋详情
+import { getListarc } from '@/api/mobile/public/arc'
 
 import OlView from "ol/View.js"
 
@@ -132,6 +151,7 @@
                 height: 0
             },
             map2D: this.$store.state.openlayerData.openlayers.map2D,
+            campusData: [],
             campusValue: ''
         }
     },
@@ -160,6 +180,10 @@
                 })
             }
         }
+    },
+
+    created () {
+        this.getStreet()
     },
 
     mounted () {
@@ -405,6 +429,17 @@
 
         setCampusValue (val) {
             this.campusValue = val
+        },
+
+        handleCommand (command) {
+            this.setCampusValue(command.dictKey)
+        },
+
+        getStreet () {
+            getListarc().then((res) => {
+                this.setCampusValue(res.data.data[0].dictKey)
+                this.campusData = res.data.data
+            })
         }
     }
 }
@@ -428,6 +463,17 @@
     /* overflow: hidden; */
 }
 
+.select-campus-box {
+    width: 28%;
+    height: 32px;
+    line-height: 32px;
+    text-align: center;
+    background: #f1f1f1;
+    border-right: 1px solid #C0C4CC;
+    box-sizing: border-box;
+    z-index: 299;
+}
+
 .esri-view-surface--inset-outline:focus::after {
     outline: none !important;
 }

--
Gitblit v1.9.3