派生自 wuyushui/SewerAndRainNetwork

chenyabin
2021-04-14 faadb3a39e89b2cb7a00e81e3778f480f1f09998
src/components/LayerController/LayerController.vue
@@ -21,7 +21,7 @@
import iconSetting from '@/assets/images/map-pages/icon/setting.png'
import LcServiceLayer from './modules/LcServiceLayer'
import bus from '@/eventBus'
export default {
  name: 'LayerController',
  components: { LcServiceLayer },
@@ -55,9 +55,22 @@
      }
    }
  },
  mounted () {
    const that = this
    bus.$on('changeState', function (state) {
      if (state.num !== 3 && state.type) {
        that.layerControllerVisible = false
      }
    })
  },
  methods: {
    showPanel () {
      this.layerControllerVisible = !this.layerControllerVisible
      const state = {
        type: this.layerControllerVisible,
        num: 3
      }
      bus.$emit('changeState', state)
    },
    switchPanel () {
      this.panelSwitch.main = !this.panelSwitch.main