<template>
  <div>
    <template v-if="this.row.wclxxfclzp">
      <el-link type="primary" @click="onClick">查看图片</el-link>
    </template>
    <template v-else>
      <el-link type="primary" target="_blank">-</el-link>
    </template>
    <el-image-viewer v-if="isShowPics" :on-close="closeViewer" :url-list="srcList" />
  </div>
</template>
<script>
import ElImageViewer from "element-ui/packages/image/src/image-viewer";

export default {
  components: { ElImageViewer },
  props: {
    row: {
      type: Object
    },
    column: {
      type: Object
    },
    index: {
      type: String
    },
    desc: {
      type: String
    }
  },

  data() {
    return {
      isShowPics: false,
      srcList: []
    };
  },
  created() {

  },
  methods: {
    // 关闭查看器
    closeViewer() {
      this.isShowPics = false;
    },
    onClick() {
      let this_ = this;
      if (this.row.wclxxfclzp) {
        JSON.parse(this.row.wclxxfclzp).forEach(d => {
          this_.srcList.push(this_.$requestConfig.getImgUrl(d.response.fileId));
        });
        this.isShowPics = true;
      }
    }
  }
};
</script>

<style scoped lang="scss">
::v-deep .el-dialog__header {
  display: none;
}

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

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