From 81773ab04fd259e893c2d7f08dbdc9be772d01c4 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 21 Dec 2021 17:18:45 +0800
Subject: [PATCH] +,请求数据,弹框显示,优化代码长度
---
src/components/orgNavBar/index.vue | 63 ++++++++++++++++++++++++++++++-
1 files changed, 60 insertions(+), 3 deletions(-)
diff --git a/src/components/orgNavBar/index.vue b/src/components/orgNavBar/index.vue
index 16f1fe4..cc9b184 100644
--- a/src/components/orgNavBar/index.vue
+++ b/src/components/orgNavBar/index.vue
@@ -21,7 +21,8 @@
<div class="content">
<ul>
<li v-for="(item, index) in navList"
- :key="index">
+ :key="index"
+ @click="mapPopup(item)">
<img :src="item.icon"
alt="">
<span>
@@ -35,11 +36,16 @@
</template>
<script>
+import { mapGetters } from 'vuex'
+
+var $ = window.$
+
export default {
name: 'OrgNavBar',
data () {
return {
- moveFlag: false
+ moveFlag: false,
+ DC: null
}
},
props: {
@@ -49,6 +55,26 @@
title: {
type: String
}
+ },
+ created () {
+ this.DC = global.DC
+ },
+ computed: {
+ ...mapGetters([
+ 'viewer',
+ 'popupBgUrl',
+ 'pupupQRUrl',
+ // 点信息
+ 'pointPosition',
+ // 点名称
+ 'stateName',
+ // 地址
+ 'siteName',
+ // 介绍
+ 'introduceText',
+ // 全景地址
+ 'panoramaUrl'
+ ])
},
methods: {
move (e) {
@@ -99,6 +125,36 @@
},
closeModel () {
this.$parent.closeModel()
+ },
+ mapPopup (item) {
+ this.$store.commit('CLEAR_ALL', null)
+
+ this.$store.commit('SET_POPUPBGURL', item.bgImg)
+ this.$store.commit('SET_POPUPQRURL', item.QRImg)
+ this.$store.commit('SET_POINTPOSITION', [Number(item.longitude), Number(item.latitude), Number(item.alt), Number(item.heading), Number(item.pitch), Number(item.roll)])
+ this.$store.commit('SET_STATENAME', item.navTitle)
+
+ var that = this
+
+ this.viewer.zoomToPosition(
+ new this.DC.Position(item.longitude, item.latitude, item.alt, item.heading, item.pitch, item.roll),
+ function () {
+ that.newPopup(item)
+ }
+ )
+ },
+ newPopup (item) {
+ const position = this.DC.Transform.transformWGS84ToCartesian(new this.DC.Position(item.longitude, item.latitude, item.alt, item.heading, item.pitch, item.roll))
+ // eslint-disable-next-line no-unused-vars
+ var popup = new this.DC.DivForms(this.viewer, {
+ domId: 'divFormsDomBox',
+ position: [
+ position
+ ]
+ })
+
+ this.$store.commit('SET_PANORAMAPOPUP', false)
+ this.$store.commit('SET_DETAILSPOPUP', true)
}
}
}
@@ -122,7 +178,7 @@
width: 100%;
height: 36px;
line-height: 36px;
- background-color: #2196f3;
+ background-color: #020c17;
.title {
padding-left: 10px;
img {
@@ -160,6 +216,7 @@
overflow-y: auto;
background: url(/img/bg/nav-bg.jpeg) no-repeat;
background-size: 100% 100%;
+ border-radius: 0 0 8px 8px;
ul {
padding: 15px;
padding-top: 4px;
--
Gitblit v1.9.3