liuyg
2021-12-21 81773ab04fd259e893c2d7f08dbdc9be772d01c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
  <div v-show="openmobileGoTo" class="mobileGoTo">
    <el-input v-model="lnt"></el-input>
    <el-input v-model="lat"></el-input>
    <!-- <el-input v-model="alt"></el-input> -->
    <el-button type="primary" @click="submitForm('')">跳转</el-button>
  </div>
</template>
 
<script>
import { mapGetters } from "vuex";
export default {
  name: "mobileGoTo",
  computed: {
    ...mapGetters([
      "openmobileGoTo",
      "mviewer",
      "query",
      "MobileWindowChangeData",
    ]),
  },
  data() {
    return {
      lnt: "121.53772514948211",
      lat: "31.23938286341316",
      alt: "90.648862227",
    };
  },
  watch: {
    MobileWindowChangeData() {
      this.lnt = this.query.lntLat[0];
      this.lat = this.query.lntLat[1];
    },
  },
  methods: {
    submitForm() {
      if (this.lnt && this.lat) {
        let that = this;
        // 定制化窗体
        let position = {};
        let lntLat = [that.lnt, that.lat];
        let d = {
          position,
          lntLat,
          query: { position, lntLat },
          useJWD: true, //仅使用经纬度
        };
        that.$store.dispatch("setMobileWindows", d);
      }
    },
  },
};
</script>
 
<style lang="scss" scoped>
.mobileGoTo {
  position: fixed;
  bottom: 60px;
  width: 73%;
  z-index: 500;
}
</style>