<template>


  <div style="" >
    <el-carousel class="" ref="carousel"  arrow="always"  v-if="pptView"
                 height="900px"  trigger="click" :autoplay="false" indicator-position="outside">

      <el-carousel-item class="lun_img" v-for="(item,index) in imgs" v-bind:key="item" >
        <img :src="item" width="100%" height="100%" object-fit="cover" />
      </el-carousel-item>
    </el-carousel>

  </div>

</template>
<script>

export default {

  data() {
    return {
      imgs:[],
      pptView:false,
    }
  },
  mounted() {
    this.ppt()
  },


  methods: {
    ppt(){
      this.pptView=true;

      console.log(this.$route.query.id)

      const formatDate =new FormData();
      formatDate.append("filepath",this.$route.query.id)

      //调用文件预览api
      let res= this.officeConvert.pptConvertCommon(formatDate)
      res.then((result)=>{
        //关闭加载中
        this.loadingFlash=false

        //成功时直接给地址
        this.videoList = result.data.imagePathList
        //将返回的地址集合遍历添加到绑定的数组中
        this.imgs=[]
        for (var key=0;key<this.videoList.length;key++) {
          this.imgs.push( process.env.VUE_APP_BASE_API+  this.videoList[key]  );
        }
      }).catch(result => {
        //请求失败，关闭loading，pdf地址直接为为空，不显示
        // this.pdf.pdfUrl =""
        // this.loadingFlash = false;
      })


    }
  }
}
</script>
