1
mayisheng
2022-08-15 81f54040c2cb65537c6c6e1db8358a39a57dea0d
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
    <div v-if="openmobileGoTo" class="mobileGoTo">
        <el-input v-model="int1"></el-input>
        <el-input v-model="lat1"></el-input>
        <el-input v-model="int2"></el-input>
        <el-input v-model="lat2"></el-input>
        <!-- <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 class="mobileGoTocontext">{{ context }}</div>
        <el-button type="primary" @click="dingwei">规划路线</el-button>
    </div>
</template>
 
<script>
import { mapGetters } from 'vuex'
import axios from 'axios'
export default {
    name: 'mobileGoTo',
    computed: {
        ...mapGetters([
            'openmobileGoTo',
            'query',
            'MobileWindowChangeData',
            'ccDataState',
            'perspectiveControls',
            'perspectiveControl',
            'dimensionData',
            'isendPosition',
            'endPosition'
        ]),
        startLngLat () {
            return [+this.int1, +this.lat1]
        },
        endLngLat () {
            return [+this.int2, +this.lat2]
        }
    },
    data () {
        return {
            lnt: '114.039946',
            lat: '27.628475',
            alt: '0',
            height: 800,
            heading: 0,
            pitch: -45,
            roll: 0,
            context: null,
            // startLngLat: [114.039946, 27.628475],
            // endLngLat: [114.038355, 27.63057],
            int1: 114.039946,
            lat1: 27.628475,
            int2: 114.038355,
            lat2: 27.63057
        }
    },
    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
        },
        isendPosition () {
            this.int2 = this.endPosition[0]
            this.lat2 = this.endPosition[1]
            console.log(this.endPosition)
        }
    },
    methods: {
        submitForm () {
            if (this.lnt && this.lat) {
                const that = this
                // 定制化窗体
                const position = {}
                const lntLat = [that.lnt, that.lat]
                const 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);
            }
        },
        // dingwei(startLngLat, endLngLat) {
        dingwei () {
            const ints = [this.startLngLat, this.endLngLat]
            console.log(ints)
            this.$store.dispatch('MSET_GOTOWHERE', ints)
        }
    }
}
</script>
 
<style lang="scss" scoped>
.mobileGoTo {
    position: fixed;
    bottom: 60px;
    width: 73%;
    z-index: 500;
    .mobileGoTocontext {
        width: 100%;
        height: 100%;
        background-color: #fff;
        word-wrap: break-word;
    }
}
</style>