query-image.vue 1.64 KB
Newer Older
葛齐林's avatar
葛齐林 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<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: '',
co_dengxiongwen's avatar
co_dengxiongwen committed
19
      urlPath: window.CONFIG.urlPath,
葛齐林's avatar
葛齐林 committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
      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
co_dengxiongwen's avatar
co_dengxiongwen committed
36 37 38
            this.mapList.forEach(element => {
              element.readPath = this.urlPath + element.filePath
            })
葛齐林's avatar
葛齐林 committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
          }
        })
      }
    }
  }
}
</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>