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
<template>
    <public-box class="tool-layer">
        <template slot="public-box-header">
            <div class="title">
                <img class="icon deblurring" src="/img/icon/tool-layer.png" alt />
                <span>图层管理</span>
            </div>
            <img class="close deblurring" src="/img/navicon/close.png" alt @click="closeModel" />
        </template>
        <template slot="public-box-content">
            <div class="list-box">
                <ul v-show="signList.length > 0">
                    <li v-for="(item, index) in signList" :key="index">
                        <img src="/img/icon/layer-manage.png" alt />
                        图层1
                        <el-switch v-model="item.flag" active-text="显示" inactive-text="隐藏"></el-switch>
                    </li>
                </ul>
                <div v-show="signList.length == 0" class="no-data">
                    <img src="/img/icon/no-data.png" alt />
                    <div>暂无数据</div>
                </div>
            </div>
        </template>
    </public-box>
</template>
 
<script>
 
export default {
    data () {
        return {
            signList: [{ flag: true }],
            destroyedFlag: true
        }
    },
    mounted () {
 
    },
    methods: {
        moveMessage (e, b) {
            global.viewer.tooltip.enable = true
            global.viewer.tooltip.showAt(e.windowPosition, b)
        },
 
        mouseMove (e) {
            this.moveMessage(e, '点击确认标注位置')
        },
 
        addSign () {
            var that = this
 
            global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, that.mouseMove)
 
            global.viewer.once(global.DC.MouseEventType.CLICK, (e) => {
                if (that.destroyedFlag == false) return
 
                global.viewer.tooltip.showAt({ x: 100, y: 100 }, '')
                global.viewer.tooltip.enable = false
                global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, that.mouseMove)
 
                // eslint-disable-next-line no-unused-vars
                var popup = new global.DC.DivForms(global.viewer, {
                    domId: 'AddTagBox',
                    position: [global.DC.Transform.transformWGS84ToCartesian(
                        new global.DC.Position(
                            Number(
                                e.wgs84SurfacePosition.lng
                            ),
                            Number(
                                e.wgs84SurfacePosition.lat
                            ),
                            Number(
                                e.wgs84SurfacePosition.alt
                            )
                        )
                    )]
                })
 
                that.$store.commit('SET_ADDTAGPOSITION', e.wgs84SurfacePosition)
                that.$store.commit('SET_ADDTAGPOPUP', true)
            })
        },
 
        closeModel () {
            this.$store.dispatch('delVisitedViews', this.$route)
            this.$router.push('/pcLayout/default')
            global.viewer.tooltip.showAt({ x: 100, y: 100 }, '')
            global.viewer.tooltip.enable = false
            global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, this.mouseMove)
        }
    },
    destroyed () {
        var that = this
        that.destroyedFlag = false
        global.viewer.tooltip.showAt({ x: 100, y: 100 }, '')
        global.viewer.tooltip.enable = false
        global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, that.mouseMove)
    }
}
</script>
 
<style lang="scss" scoped>
.move {
    cursor: move;
}
</style>