liuyg
2021-12-31 e40ee62d3e9b71ffe3432d32a53a00c4097b5708
src/components/mobileGoTo/index.vue
@@ -1,7 +1,9 @@
<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="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>
@@ -18,6 +20,8 @@
      "query",
      "MobileWindowChangeData",
      "ccDataState",
      "perspectiveControls",
      "perspectiveControl",
    ]),
  },
  data() {
@@ -25,6 +29,10 @@
      lnt: "121.53772514948211",
      lat: "31.23938286341316",
      alt: "90.648862227",
      height: 800,
      heading: 0,
      pitch: -45,
      roll: 0,
    };
  },
  watch: {
@@ -36,21 +44,34 @@
      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 position = {};
        // let lntLat = [that.lnt, that.lat];
        // let d = {
        //   position,
        //   lntLat,
        //   query: { position, lntLat },
        //   useJWD: true, //仅使用经纬度
        // };
        // that.$store.dispatch("setMobileWindows", d);
        let d = {
          position,
          lntLat,
          query: { position, lntLat },
          useJWD: true, //仅使用经纬度
          height: this.height,
          heading: this.heading,
          pitch: this.pitch,
          roll: this.roll,
        };
        that.$store.dispatch("setMobileWindows", d);
        that.$store.dispatch("MSET_GOTOCC", d);
      }
    },
  },