<template>
  <div class="img-flex">
    <el-image
      :preview-src-list="fileList"
      :src="require('../assets/images/picture.png')"
    >
    </el-image>
    <!-- <el-image
      :preview-src-list="[urlVal(item)]"
      v-for="item in fileList"
      :key="item"
    >
   
      <div slot="error" class="image-slot">
        <i class="el-icon-picture-outline" @click="handleClick"></i>
      </div>
    </el-image> -->
  </div>
</template>
<script>
const baseUrl = process.env.VUE_APP_API_BASE_URL + "/";
const zwfwUrl = process.env.VUE_APP_API_ZWFW_URL + "/";
export default {
  props: ["src", "row", "fileList"],
  data() {
    return {
      // fileList: [],
    };
  },
  created() {},
  computed: {},
  methods: {
    // handleClick() {
    //   this.fileList = [];
    //   if (this.row.snapPath && this.row.filePaths) {
    //     this.src = this.row.snapPath + this.row.filePaths;
    //   } else {
    //     if (this.row.snapPath) {
    //       this.src = this.row.snapPath;
    //     } else {
    //       this.src = this.row.filePaths;
    //     }
    //   }
    //   this.fileList = this.src ? this.src.split(",") : [];
    //   this.fileList &&
    //     this.fileList.forEach((val) => {
    //       val.indexOf("zwfw_api_xnjc") == -1
    //         ? val.indexOf("http") == -1
    //           ? (val = baseUrl + val)
    //           : (val = val)
    //         : (val = zwfwUrl + val);
    //     });
    // },
    urlVal(val) {
      return val.indexOf("zwfw_api_xnjc") == -1
        ? val.indexOf("http") == -1
          ? baseUrl + val
          : val
        : zwfwUrl + val;
    },
  },
};
</script>
<style lang="less" scoped>
.img-flex {
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  .el-image {
    width: 50px;
    float: left;
    border: 1px solid #ddd;
    margin: 2px;
  }
}
</style>
