shuishen
2022-07-29 71ac571768baab6ca36057be77075b80cfe74739
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<template>
    <div class="layer-control-box"
         ref='publicLegendAll'>
        <div class="public-legends"
             v-show="legendFlag">
            <div v-for="(item, index) in legendsDetail"
                 :key="index">
                <ul>
                    <li v-for="(it, ind) in item.content"
                        :key="ind">
 
                        <el-button plain
                                   @click="layerControl(it)"
                                   :class="it.btnClass"
                                   :ref="it.type">
 
                            <div>
                                <img :src="it.src"
                                     alt="" />
                            </div>
                            <div>
                                <span :class="it.class"> <strong>{{ it.value }}</strong>个</span>
                                <span>{{ it.label }} <img style="width: 10px; height: 10px;"
                                         :src="it.smallsrc"
                                         alt=""> </span>
                            </div>
 
                        </el-button>
 
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>
 
<script>
 
export default {
    name: 'layerControl',
    props: ['legendsDetail'],
    data () {
        return {
            legendFlag: true
        }
    },
    methods: {
        layerControl (item) {
            this.$parent.$parent.layerControl(item)
        },
 
        layerControlResize (val) {
            if (val) {
                this.$refs.publicLegendAll.style.left = 'calc((100% + 396px) / 2)'
            } else {
                this.$refs.publicLegendAll.style.left = '50%'
            }
        },
 
        riskLayerNormal () {
 
        },
 
        riskLayerWarn () {
 
        }
    }
}
</script>
 
<style lang="scss" scope>
.layer-control-box {
    margin: auto;
    position: fixed;
    top: auto;
    left: 50%;
    right: auto;
    bottom: 2px;
    width: auto;
    height: auto !important;
    text-align: center;
    color: #677788 !important;
    z-index: 1111 !important;
    transform: translate(-50%, 0px);
 
    .public-legends {
        border-radius: 10px;
        text-align: center;
        max-height: 320px;
        & > div {
            position: relative;
            h3 {
                position: absolute;
                top: -22px;
                left: 20px;
                background: #fff;
                color: #4fa9fd;
                padding: 0 8px;
                font-size: 13px;
                border-radius: 10px;
            }
            ul {
                margin: 0;
                border-radius: 10px;
                display: flex;
                justify-content: center;
                li {
                    margin: 0 4px;
                    display: flex;
                    list-style: none;
                    line-height: 28px;
                    align-items: center;
                    font-size: 16px;
 
                    .el-button {
                        padding: 4px 16px;
                        border: none;
                        background: rgba(0, 0, 0, 0.1);
                        & > span {
                            display: flex;
                            & > div {
                                display: flex;
                                align-items: center;
                                flex: 1;
                                img {
                                    width: 38px;
                                    vertical-align: middle;
                                }
                            }
 
                            & > div:nth-child(2) {
                                margin-left: 10px;
                                flex-direction: column;
                                align-items: flex-start;
                                & > span {
                                    flex: 1;
                                    text-align: left;
                                }
 
                                & > span:nth-child(1) {
                                    strong {
                                        font-size: 24px;
                                    }
                                }
 
                                & > span:nth-child(2) {
                                    font-size: 18px;
                                    line-height: 24px;
                                }
                            }
                        }
                    }
 
                    .el-button:focus,
                    .el-button:hover {
                        color: #677788 !important;
                        border: none;
                        background: rgba(0, 0, 0, 0.1);
                    }
 
                    .el-button.btn-yj {
                        background: #ffcdcd;
                    }
 
                    .el-button.btn-yj:focus,
                    .el-button.btn-yj:hover {
                        background: #ffcdcd;
                    }
 
                    .el-button.btn-zc {
                        background: #d3ffd3;
                    }
 
                    .el-button.btn-zc:focus,
                    .el-button.btn-zc:hover {
                        background: #d3ffd3;
                    }
                }
            }
        }
    }
}
</style>