<template lang="pug">
  el-dialog( :close-on-click-modal='false', :visible.sync='visible' append-to-body :modal-append-to-body='false')
    div.title-bold(slot='title') 预览站点地图
    el-carousel(:interval="5000" arrow="always")
      el-carousel-item(v-for="item in mapList" :key="item.id" :label="item.name")
        el-image(:src="item.readPath" fit='scale-down')

    span(slot='footer')
      el-button(type='primary' size='medium' @click='visible = false' ) 关闭
</template>

<script>
export default {
  data () {
    return {
      clickFlag: false,
      visible: false,
      stationId: '',
      urlPath: window.CONFIG.urlPath,
      mapList: []
    }
  },
  methods: {
    init (id) {
      this.visible = true
      this.stationId = id
      if (this.stationId) {
        this.$http({
          url: this.$http.adornUrl(`/liStation/getId/${this.stationId}`),
          method: 'get',
          params: this.$http.adornParams()
        }).then(data => {
          if (data && data.code === 0) {
            console.log('站点地图：', data.bean.mapList)
            this.mapList = data.bean.mapList
            this.mapList.forEach(element => {
              element.readPath = this.urlPath + element.filePath
            })
          }
        })
      }
    }
  }
}
</script>
<style>
.el-carousel__container{
  height: 570px;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 570px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}
</style>
