<template>
|
<div class="inner-panel">
|
<div class="filter-group">
|
<div v-for="item in pointLayers" :key="item.code" class="filter-item">
|
<div class="title"><input type="checkbox" :value="item.code" :checked="item.checked"
|
@change="swAllSubFilter(item)">{{item.name}}
|
</div>
|
<div class="content">
|
<div v-for="filter in item.filters" :key="filter.code">
|
<input type="checkbox" :value="filter.code" :checked="filter.checked" @change="swSubFilter(filter)"><label
|
:title="filter.name">{{filter.name}}</label>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { mapMutations } from 'vuex'
|
|
export default {
|
name: 'LcServiceLayerFilter',
|
components: {},
|
data () {
|
return {
|
visible: {},
|
filterConfig: [] // 附属要素
|
}
|
},
|
computed: {
|
config () {
|
return this.$store.state.map.config
|
},
|
pointLayers () {
|
// 根据线图层选中情况,显示或隐藏点图层面板
|
var serviceLayers = this.config.mapConfig.Layers.LayerSewersLine // 一级图层
|
var checkedLayers = window.serviceLayerHelper.getCheckedLayers(serviceLayers)
|
var pointLayers = this.config.mapConfig.Layers.layerSewersPoint // 二级图层
|
return pointLayers.filter(function (layer) {
|
var code = layer.code
|
for (var i = 0; i < checkedLayers.length; i++) {
|
var checkedLayer = checkedLayers[i]
|
if (checkedLayer.childLayer.indexOf(code) >= 0) {
|
return checkedLayer
|
}
|
}
|
})
|
}
|
},
|
mounted () {
|
// this.filterConfig = window.serviceLayerHelper.getWMSConfig().filtersGroup
|
},
|
methods: {
|
...mapMutations([]),
|
swAllSubFilter (item) {
|
item.checked = !item.checked
|
console.log(item)
|
// window.serviceLayerHelper.loadLayers()
|
},
|
swSubFilter (item) {
|
item.checked = !item.checked
|
console.log(item)
|
// window.serviceLayerHelper.loadLayers()
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="less">
|
.inner-panel {
|
color: #90c8e0;
|
font-size: 13px;
|
|
position: absolute;
|
left: 250px;
|
bottom: 10px;
|
z-index: 1000;
|
height: 220px;
|
|
.filter-group {
|
display: flex;
|
flex-flow: row;
|
|
.filter-item {
|
width: 120px;
|
height: 100%;
|
margin-right: 5px;
|
|
.title {
|
height: '25px';
|
background-color: #091331;
|
border: 1px solid #10488c;
|
}
|
|
.content {
|
background-color: rgba(44, 62, 80, 0.6);
|
border: 1px solid #10488c;
|
max-height: 200px;
|
overflow-y: auto;
|
}
|
|
::-webkit-scrollbar {
|
width: 7px;
|
height: 5px !important;
|
}
|
|
::-webkit-scrollbar-thumb {
|
/*滚动条里面小方块*/
|
border-radius: 10px;
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
background: #0661AE;
|
border: 1px solid transparent;
|
}
|
|
::-webkit-scrollbar-track {
|
/*滚动条里面轨道*/
|
// box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2);
|
border-radius: 0px;
|
background: #0E3565;
|
}
|
}
|
}
|
}
|
</style>
|