From 81f54040c2cb65537c6c6e1db8358a39a57dea0d Mon Sep 17 00:00:00 2001
From: mayisheng <admin>
Date: Mon, 15 Aug 2022 16:14:01 +0800
Subject: [PATCH] 1
---
src/components/map/components/campusBuildingSearch.vue | 123 ++++++++++++++++++++++++++++++-----------
1 files changed, 90 insertions(+), 33 deletions(-)
diff --git a/src/components/map/components/campusBuildingSearch.vue b/src/components/map/components/campusBuildingSearch.vue
index f0c0af6..2dab424 100644
--- a/src/components/map/components/campusBuildingSearch.vue
+++ b/src/components/map/components/campusBuildingSearch.vue
@@ -52,7 +52,6 @@
name: 'campusBuildingSearch',
data () {
return {
- DC: null,
shortcutList: [
{
bgimg: '/img/search/org.png',
@@ -113,17 +112,25 @@
},
computed: {
...mapGetters([
- 'viewer',
// 校区内导航的显示关闭
'campusNavFlag',
'orgNavBarFlag',
- 'arcNavBarFlag'
+ 'arcNavBarFlag',
+ 'twoOrThree'
])
},
created () {
- this.DC = global.DC
},
methods: {
+ coordinate (item) {
+ const arr = item.split(',')
+
+ return {
+ lng: arr[0],
+ lat: arr[1]
+ }
+ },
+
searchValueChange () {
if (this.searchInput == '') {
this.searchValList = []
@@ -220,6 +227,19 @@
loadPopup (param) {
var that = this
+ let obj = {}
+
+ if (param.x && param.x != '') {
+ const position = this.coordinate(param.x)
+ obj = {
+ lng: position.lng, lat: position.lat
+ }
+ } else {
+ obj = {
+ lng: param.longitude, lat: param.latitude
+ }
+ }
+
that.searchInput = ''
that.searchValList = []
that.searchValShow = false
@@ -230,14 +250,7 @@
this.$store.commit('SET_POPUPBGURL', imgArr[0])
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)
@@ -263,27 +276,68 @@
this.$store.commit('SET_LIVELIST', [])
}
- this.newPopup(param)
- this.viewer.flyToPosition(
- new this.DC.Position(
- Number(param.jd),
- Number(param.wd),
- 300,
+ this.newPopup(param, obj)
+ if (this.twoOrThree == '三 维') {
+ this.$store.commit('SET_POINTPOSITION', [
+ Number(obj.lng),
+ Number(obj.lat),
+ Number(param.gd),
Number(param.heading),
Number(param.pitch),
Number(param.roll)
- ),
- () => { },
- 0.5
- )
+ ])
+
+ global.viewer.flyToPosition(
+ new global.DC.Position(
+ Number(obj.lng),
+ Number(obj.lat),
+ 300,
+ Number(param.heading),
+ Number(param.pitch),
+ Number(param.roll)
+ ),
+ () => { },
+ 0.5
+ )
+ } else {
+ this.$store.commit('SET_POINTPOSITION', [
+ Number(param.jd),
+ Number(param.wd),
+ Number(50),
+ Number(param.heading),
+ Number(param.pitch),
+ Number(param.roll)
+ ])
+
+ global.viewer.flyToPosition(
+ new global.DC.Position(
+ Number(param.jd),
+ Number(param.wd),
+ 300,
+ Number(param.heading),
+ Number(param.pitch),
+ Number(param.roll)
+ ),
+ () => { },
+ 0.5
+ )
+ }
},
- newPopup (item) {
- const position = this.DC.Transform.transformWGS84ToCartesian(
- new this.DC.Position(Number(item.jd), Number(item.wd), Number(item.gd))
- )
+ newPopup (item, obj) {
+ let position
+ if (this.twoOrThree == '三 维') {
+ position = global.DC.Transform.transformWGS84ToCartesian(
+ new global.DC.Position(Number(obj.lng), Number(obj.lat), Number(item.gd))
+ )
+ } else {
+ position = global.DC.Transform.transformWGS84ToCartesian(
+ new global.DC.Position(Number(item.jd), Number(item.wd), Number(50))
+ )
+ }
+
// eslint-disable-next-line no-unused-vars
- var popup = new this.DC.DivForms(this.viewer, {
+ var popup = new global.DC.DivForms(global.viewer, {
domId: 'divFormsDomBox',
position: [position]
})
@@ -386,7 +440,7 @@
}
.map-campus-shortcut {
- margin-top: 20px;
+ margin-top: 40px;
width: 100%;
// height: 330px;
height: auto;
@@ -394,19 +448,18 @@
border-radius: 5px;
.shortcut-box {
- padding-top: 36px;
height: auto;
ul {
display: flex;
width: 100%;
height: auto;
- justify-content: flex-start;
+ // justify-content: space-around;
flex-wrap: wrap;
li {
- margin: 0 13px;
- width: 84px;
- height: 76px;
+ margin: 22.5px 0 0 22.5px;
+ width: 80px;
+ height: 70px;
.el-button {
width: 80px;
@@ -440,6 +493,10 @@
border: 1px solid #000;
}
}
+
+ li:last-child {
+ margin-bottom: 22.5px;
+ }
}
}
}
--
Gitblit v1.9.3