智慧园区前端大屏
shuishen
2024-11-12 7ebb90b4d99cd661dcb9c9bdc9a1932e5b4a102f
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
130
131
132
133
134
135
136
137
138
139
<!--
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-03-13 14:54:26
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-03-13 15:00:55
 * @FilePath: \forest-fire\src\views\statistics\components\box\dataContent.vue
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
-->
<script setup>
import publicContent from './publicContent.vue'
 
const fxy = () => {
    if (state.layer) {
        console.log("***************************")
        window.$viewer.removeLayer(state.layer)
    }
    let layer = new DC.VectorLayer(`${row.id}`)
    state.layer = layer
    window.$viewer.addLayer(layer)
    let material = new DC.PolylineDashMaterialProperty({
        color: DC.Color.ORANGE
    })
    let item = new DC.Position(row.lng, row.lat, 100)
    let label = new DC.CustomLabel(
        item,
        row.name
    )
    label.setStyle({
        fillColor: DC.Color.YELLOW,
        font: '12px',
        pixelOffset: { x: 0, y: -10 },
    })
    label.setVLine({
        width: 2,
        material
    })
    layer.addOverlay(label)
}
 
const fxe = () => {
    if (state.layer) {
        console.log("***************************")
        window.$viewer.removeLayer(state.layer)
    }
    let layer = new DC.VectorLayer(`${row.id}`)
    state.layer = layer
    window.$viewer.addLayer(layer)
    let material = new DC.PolylineDashMaterialProperty({
        color: DC.Color.ORANGE
    })
    let item = new DC.Position(row.lng, row.lat, 100)
    let label = new DC.CustomLabel(
        item,
        row.name
    )
    label.setStyle({
        fillColor: DC.Color.YELLOW,
        font: '12px',
        pixelOffset: { x: 0, y: -10 },
    })
    label.setVLine({
        width: 2,
        material
    })
    layer.addOverlay(label)
}
 
 
const fxs = () => {
    if (state.layer) {
        console.log("***************************")
        window.$viewer.removeLayer(state.layer)
    }
    let layer = new DC.VectorLayer(`${row.id}`)
    state.layer = layer
    window.$viewer.addLayer(layer)
    let material = new DC.PolylineDashMaterialProperty({
        color: DC.Color.ORANGE
    })
    let item = new DC.Position(row.lng, row.lat, 100)
    let label = new DC.CustomLabel(
        item,
        row.name
    )
    label.setStyle({
        fillColor: DC.Color.YELLOW,
        font: '12px',
        pixelOffset: { x: 0, y: -10 },
    })
    label.setVLine({
        width: 2,
        material
    })
    layer.addOverlay(label)
}
 
 
 
 
</script>
 
<template>
    <public-content>
        <template #content>
            <div class="data-content">
                <ul>
                    <li @click="fxy">防线一</li>
                    <li @click="fxe">防线二</li>
                    <li @click="fxs">防线三</li>
                </ul>
            </div>
        </template>
    </public-content>
</template>
 
<style lang="scss" scoped>
.data-content {
    color: #fff;
}
 
.data-content>ul {
    margin-top: 90px;
    margin-left: 90px;
}
 
.data-content>ul>li {
    display: block;
    color: #000;
    margin-top: 160px;
    background-color: #fff;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 50%;
}
</style>