<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>
|