<template></template>

<script>
import { createGifLayer } from '@/utils/mapCommon/tools'
import Config from './config.json'
export default {
  name: 'PumpMonitor', //泵站监控
  data() {
    return {
      handler: null,
      gifLayer: null,
      dicgif: {
        hei: "<img class='gifelement' src='" + require('@/views/widgets/DisplayControlList/images/hei32.gif') + "'>",
        hong: "<img class='gifelement' src='" + require('@/views/widgets/DisplayControlList/images/hong32.png') + "'>",
        lan: "<img class='gifelement' src='" + require('@/views/widgets/DisplayControlList/images/lan32.png') + "'>"
      }
    }
  },
  computed: {
    config: function () {
      return Config
    }
  },
  methods: {
    /**
     * 添加模型
     */
    addModel() {
      let viewer = window.viewer
      for (var i = 0; i < this.config.pumps.length; i++) {
        this.config.pumps[i].imgdiv = this.dicgif[this.config.pumps[i].state]
      }
      this.gifLayer = createGifLayer(
        document.querySelector('#' + this.$store.state.cesiumMap.mapContainerId),
        this.config.pumps,
        viewer,
        this.addModelClick()
      )
    },
    /**
     * 删除指定图层
     */
    removeAll() {
      if (this.gifLayer) {
        this.gifLayer.remove()
      }
    },
    /**
     * 添加click事件
     */
    addModelClick(evt) {}
  }
}
</script>

<style>
</style>