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/components/campusBuildingSearch.vue |  169 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 81 insertions(+), 88 deletions(-)

diff --git a/src/components/map/components/campusBuildingSearch.vue b/src/components/map/components/campusBuildingSearch.vue
index ee1ebdf..0ec2e0f 100644
--- a/src/components/map/components/campusBuildingSearch.vue
+++ b/src/components/map/components/campusBuildingSearch.vue
@@ -1,40 +1,37 @@
 <template>
     <div>
-        <div class="map-campus-search"
-             id="CampusSearchPanel">
-            <el-input class="search-input"
-                      placeholder="社区搜索…"
-                      v-model="searchInput"
-                      @input="searchValueChange"
-                      @focus="shortcutFlag = true">
-            </el-input>
+        <div class="map-campus-search" id="CampusSearchPanel">
+            <el-input
+                class="search-input"
+                placeholder="社区搜索…"
+                v-model="searchInput"
+                @input="searchValueChange"
+                @focus="shortcutFlag = true"
+            ></el-input>
             <el-button-group>
-                <el-button @click="navigationShow"
-                           class="deblurring"
-                           icon="el-icon-my-path"></el-button>
-                <el-button class="deblurring"
-                           type="primary"
-                           icon="el-icon-my-search"></el-button>
+                <el-button @click="navigationShow" class="deblurring" icon="el-icon-my-path"></el-button>
+                <el-button
+                    @click="fuzzyQuery"
+                    class="deblurring"
+                    type="primary"
+                    icon="el-icon-my-search"
+                ></el-button>
             </el-button-group>
-            <div v-show="searchValShow"
-                 class="search-value-box">
+            <div v-show="searchValShow" class="search-value-box">
                 <ul>
-                    <li v-for="(item, index) in searchValList"
+                    <li
+                        v-for="(item, index) in searchValList"
                         :key="index"
-                        @click="loadPopup(item)">
-                        {{item.name}}
-                    </li>
+                        @click="loadPopup(item)"
+                    >{{item.mechanismname}}</li>
                 </ul>
             </div>
-            <div class="map-campus-shortcut"
-                 v-show="shortcutFlag">
+            <div class="map-campus-shortcut" v-show="shortcutFlag">
                 <div class="shortcut-box">
                     <ul>
-                        <li v-for="(item, index) in shortcutList"
-                            :key="index">
+                        <li v-for="(item, index) in shortcutList" :key="index">
                             <el-button @click="openModelPopup(item)">
-                                <img :src="item.bgimg"
-                                     alt="">
+                                <img :src="item.bgimg" alt />
                                 <span>{{item.title}}</span>
                             </el-button>
                         </li>
@@ -58,13 +55,13 @@
         return {
             DC: null,
             shortcutList: [
-                // {
-                //     bgimg: '/img/search/org.png',
-                //     title: '党群机构',
-                //     type: 'orgnav',
-                //     path: '/pcLayout/default/orgnav/masses',
-                //     code: 1
-                // },
+                {
+                    bgimg: '/img/search/org.png',
+                    title: '其他机构',
+                    type: 'orgnav',
+                    path: '/pcLayout/default/orgnav/rest',
+                    code: 5
+                },
                 // {
                 //     bgimg: '/img/search/ofc.png',
                 //     title: '职能部处',
@@ -85,6 +82,13 @@
                     type: 'arc',
                     path: '/pcLayout/default/arc/venue',
                     code: 3
+                },
+                {
+                    bgimg: '/img/search/floor.png',
+                    title: '主要场馆',
+                    type: 'arc',
+                    path: '/pcLayout/default/arc/rest',
+                    code: 7
                 }
                 // {
                 //     bgimg: '/img/search/dorm.png',
@@ -140,32 +144,35 @@
             }
         },
 
+        fuzzyQuery () {
+            if (this.searchInput == '') {
+                this.searchValList = []
+                this.searchValShow = false
+
+                this.$message({
+                    message: '请输入关键字',
+                    type: 'warning',
+                    duration: 1000
+                })
+                return
+            }
+            getSearchList({ mechanismName: this.searchInput }).then(res => {
+                if (res.data.data.length > 0) {
+                    this.$store.commit('SET_SEARCHPOPUPFLAG', true)
+                    this.$store.commit('SET_SEARCHPOPUPLIST', res.data.data)
+                    this.searchInput = ''
+                    this.searchValList = []
+                    this.searchValShow = false
+                }
+            })
+        },
+
         openModelPopup (param) {
             var list = []
-            if (this.$route.path.indexOf('/service') != -1) {
-                this.$store.dispatch('delVisitedViews', this.$route)
-                this.$router.push('/pcLayout/default')
-            }
 
             if (param.type == 'orgnav') {
-                var path = this.$route.path
-                if (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)
-                }
-
                 this.$store.commit('SET_ORGNAVBARTITLE', param.title)
                 this.$store.commit('SET_ORGNAVBARLIST', [])
-
                 this.$store.commit('SET_ORGNAVBARFLAG', true)
 
                 getList({ type: param.code }).then(res => {
@@ -191,24 +198,12 @@
                     this.$store.commit('SET_ORGNAVBARLIST', list)
                 })
             } else if (param.type == 'arc') {
-                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)
-                }
-
                 this.$store.commit('SET_ARCNAVBARTITLE', param.title)
                 this.$store.commit('SET_ARCNAVBARCODE', param.code)
                 this.$store.commit('SET_ARCNAVBARFLAG', true)
             }
+
+            this.$router.push(param.path)
         },
 
         shortcutShow (event) {
@@ -230,45 +225,43 @@
 
             this.$store.commit('CLEAR_ALL', null)
 
-            var result = param.list
-
-            var imgArr = result.tpurl.split(',')
-            var tabOne = param.jx.split(',')
-            var tabTwo = param.sh.split(',')
+            var imgArr = param.tpurl.split(',')
 
             this.$store.commit('SET_POPUPBGURL', imgArr[0])
-            this.$store.commit('SET_POPUPQRURL', result.codeurl)
-            this.$store.commit('SET_POINTPOSITION', [Number(result.jd), Number(result.wd), Number(result.gd), Number(result.heading), Number(result.pitch), Number(result.roll)])
-            this.$store.commit('SET_STATENAME', result.mechanismname)
-            this.$store.commit('SET_SITENAME', result.address)
-            this.$store.commit('SET_TELEPHONE', result.telephone)
-            this.$store.commit('SET_INTRODUCETEXT', result.introduce)
-            if (result.panoramaurl != '') {
-                this.$store.commit('SET_PANORAMAURL', result.panoramaurl)
+            this.$store.commit('SET_POPUPQRURL', param.codeurl)
+            this.$store.commit('SET_POINTPOSITION', [Number(param.jd), Number(param.wd), Number(param.gd), Number(param.heading), Number(param.pitch), Number(param.roll)])
+            this.$store.commit('SET_STATENAME', param.mechanismname)
+            this.$store.commit('SET_SITENAME', param.address)
+            this.$store.commit('SET_TELEPHONE', param.telephone)
+            this.$store.commit('SET_INTRODUCETEXT', param.introduce)
+            if (param.panoramaurl != '') {
+                this.$store.commit('SET_PANORAMAURL', param.panoramaurl)
             }
-            if (result.videourl && result.videourl != '') {
-                this.$store.commit('SET_MONITORURL', result.videourl)
+            if (param.videourl && param.videourl != '') {
+                this.$store.commit('SET_MONITORURL', param.videourl)
             }
             this.$store.commit('SET_POPUPIMGATLAS', imgArr)
-            if (param.jx != '') {
+            if (param.jx != undefined && param.jx != '') {
+                var tabOne = param.jx.split(',')
                 this.$store.commit('SET_TEACHLIST', tabOne)
             } else {
                 this.$store.commit('SET_TEACHLIST', [])
             }
 
-            if (param.sh != '') {
+            if (param.sh != undefined && param.sh != '') {
+                var tabTwo = param.sh.split(',')
                 this.$store.commit('SET_LIVELIST', tabTwo)
             } else {
                 this.$store.commit('SET_LIVELIST', [])
             }
 
-            this.newPopup(result)
+            this.newPopup(param)
             this.viewer.flyToPosition(
-                new this.DC.Position(Number(result.jd), Number(result.wd), 300, Number(result.heading), Number(result.pitch), Number(result.roll)),
+                new this.DC.Position(Number(param.jd), Number(param.wd), 300, Number(param.heading), Number(param.pitch), Number(param.roll)),
                 () => {
 
                 },
-                3
+                0.5
             )
         },
 
@@ -393,7 +386,7 @@
                 display: flex;
                 width: 100%;
                 height: 120px;
-                justify-content: start;
+                justify-content: flex-start;
                 flex-wrap: wrap;
 
                 li {

--
Gitblit v1.9.3