liuyg
2021-12-31 e40ee62d3e9b71ffe3432d32a53a00c4097b5708
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<template>
  <div v-show="openmobileGoTo" class="mobileGoTo">
    <el-input v-model="height"></el-input>
    <el-input v-model="heading"></el-input>
    <el-input v-model="pitch"></el-input>
    <el-input v-model="roll"></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",
      "ccDataState",
      "perspectiveControls",
      "perspectiveControl",
    ]),
  },
  data() {
    return {
      lnt: "121.53772514948211",
      lat: "31.23938286341316",
      alt: "90.648862227",
      height: 800,
      heading: 0,
      pitch: -45,
      roll: 0,
    };
  },
  watch: {
    MobileWindowChangeData() {
      this.lnt = this.query.lntLat[0];
      this.lat = this.query.lntLat[1];
    },
    ccDataState() {
      this.lnt = this.query.lntLat[0];
      this.lat = this.query.lntLat[1];
    },
    perspectiveControls() {
      this.height = this.perspectiveControl.height;
      this.heading = this.perspectiveControl.heading;
      this.pitch = this.perspectiveControl.pitch;
      this.roll = this.perspectiveControl.roll;
    },
  },
  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);
        let d = {
          height: this.height,
          heading: this.heading,
          pitch: this.pitch,
          roll: this.roll,
        };
        that.$store.dispatch("MSET_GOTOCC", d);
      }
    },
  },
};
</script>
 
<style lang="scss" scoped>
.mobileGoTo {
  position: fixed;
  bottom: 60px;
  width: 73%;
  z-index: 500;
}
</style>