From 71f75cd55d11dda80118c0c3e278a8c531d98dc5 Mon Sep 17 00:00:00 2001 From: chenyabin <Chenab123!> Date: 星期一, 19 四月 2021 14:05:24 +0800 Subject: [PATCH] 添加 附属设施弹框。 --- src/components/panel/LegendPanel.vue | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/panel/LegendPanel.vue b/src/components/panel/LegendPanel.vue index 3c7178e..36e0efd 100644 --- a/src/components/panel/LegendPanel.vue +++ b/src/components/panel/LegendPanel.vue @@ -32,7 +32,7 @@ import { LayerPipeLines } from '../../conf/layers/LayerPipeLines' import { LayerPk } from '../../conf/layers/LayerPk' import { LayerArea } from '../../conf/layers/LayerArea' - +import bus from '@/eventBus' export default { name: 'LegendPanel', data () { @@ -42,17 +42,23 @@ serviceLayers: [LayerSoilGroundWater, LayerEnvRisk, LayerAirQuality, LayerWasteSolid, LayerWasteGas, LayerWasteWater, LayerArea, LayerPk, LayerPipeLines] } }, + mounted () { + const that = this + bus.$on('changeState', function (state) { + if (state.num !== 4 && state.type) { + that.isShow = false + } + }) + }, methods: { // 鍥炬爣 鎺у埗鍐呭鐨勫睍绀轰笌闅愯棌 legendChange () { - console.log(this.serviceLayers) - this.serviceLayers.forEach((item) => { - item.layers.forEach((itm) => { - console.log(itm.legendImage) - }) - }) - debugger this.isShow = !this.isShow + const state = { + type: this.isShow, + num: 4 + } + bus.$emit('changeState', state) } } } -- Gitblit v1.8.0