| | |
| | | <template> |
| | | <div class="legend-panel"> |
| | | <transition name="fade"> |
| | | <div :class="'legend-content map-background'" v-show="legendControl"> |
| | | <div :class="'legend-content map-background'" v-show="isShow"> |
| | | <div class="legend-content-box" v-for="(item,index) in serviceLayers" :key="index"> |
| | | <p><span>{{ item.name }}</span></p> |
| | | <div class="map-under-line"></div> |
| | | <ul> |
| | | <li v-for="(ite,inde) in item.layers" :key="inde"> |
| | | <img :src='ite.legendImage' alt=''> |
| | | <li v-for="(ite,idx) in item.layers" :key="idx"> |
| | | <img :src="ite.legendImage===undefined?'../.././assets/images/map-pages/setting.png':ite.legendImage" alt=''> |
| | | <span>{{ ite.name }}</span> |
| | | </li> |
| | | </ul> |
| | |
| | | </div> |
| | | </transition> |
| | | <el-tooltip :popper-class="'map-tooltip'" effect="dark" content="图例" placement="left"> |
| | | <div :class="this.legendControl?'legend-btn map-btn-active':'legend-btn map-btn-unactive'" |
| | | <div :class="this.isShow?'legend-btn map-btn-active':'legend-btn map-btn-unactive'" |
| | | @click="legendChange()"> |
| | | <i class="el-icon-more-outline"></i> |
| | | </div> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { LayerWasteWater } from '../../conf/layers/LayerWasteWater' |
| | | import { LayerWasteGas } from '../../conf/layers/LayerWasteGas' |
| | | import { LayerWasteSolid } from '../../conf/layers/LayerWasteSolid' |
| | | import { LayerAirQuality } from '../../conf/layers/LayerAirQuality' |
| | | import { LayerEnvRisk } from '../../conf/layers/LayerEnvRisk' |
| | | import { LayerSoilGroundWater } from '../../conf/layers/LayerSoilGroundWater' |
| | | import { LayerPipeLines } from '../../conf/layers/LayerPipeLines' |
| | | import { LayerPk } from '../../conf/layers/LayerPk' |
| | | import { LayerArea } from '../../conf/layers/LayerArea' |
| | | |
| | | export default { |
| | | name: 'LegendPanel', |
| | | data () { |
| | | return { |
| | | // 控制图例 内容的 显示/隐藏 |
| | | legendControl: false |
| | | } |
| | | }, |
| | | computed: { |
| | | serviceLayers () { |
| | | return this.$store.state.map.serviceLayers.LayerSewersLine |
| | | isShow: false, |
| | | serviceLayers: [LayerSoilGroundWater, LayerEnvRisk, LayerAirQuality, LayerWasteSolid, LayerWasteGas, LayerWasteWater, LayerArea, LayerPk, LayerPipeLines] |
| | | } |
| | | }, |
| | | methods: { |
| | | // 图标 控制内容的展示与隐藏 |
| | | legendChange () { |
| | | this.legendControl = !this.legendControl |
| | | this.isShow = !this.isShow |
| | | } |
| | | } |
| | | } |