派生自 wuyushui/SewerAndRainNetwork

wangrui
2020-12-25 e8bcc8ff69702b8c2ba123981a45e668cf95a01b
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
<template>
  <div class="inner-panel">
      <div class="filter-group">
          <div v-for="item in filterConfig" :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"><label :title="filter.name">{{filter.sname}}</label>
                  </div>
              </div>
          </div>
      </div>
  </div>
</template>
 
<script>
import { mapState, mapMutations } from "vuex";
export default {
  name: "LcServiceLayerFilter",
  components: {},
  data() {
    return {
      filterConfig: [], // 附属要素
    };
  },
  computed: {
    ...mapState({
      serviceLayerHelper: (state) => {
        return state.serviceLayerHelper
      },
      selectedServiceLayer: (state) => {
        return state.selectedServiceLayer
      },
      serviceLayerFilters: (state) => {
        return state.serviceLayerFilters
      }
    }),
  },
  mounted() {
    
  },
  methods: {
    ...mapMutations([]),
    getFilterConfig(){
        return this.filterConfig
    },
    swAllSubFilter(item){
        item.checked = !item.checked
        for(let i = 0, len = item.filters.length; i < len; ++i){
            item.filters[i].checked = item.checked
        }
    }
  },
  watch: {
      selectedServiceLayer(newVal){
          this.filterConfig = this.serviceLayerHelper.getWMSConfig(newVal).filtersGroup
      }
  }
};
</script>
 
<style scoped lang="less">
.inner-panel {
    color:#90c8e0;
    font-size: 13px;
 
    position: absolute;
    left: 250px;
    bottom: 10px;
    z-index: 1000;
    height: 220px;
    width: 500px;
 
    .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>