<template>
  <div class="container-fluid" />
</template>
<script>


export default {
  data: function () {
    return {
      processReportNo: null,
      previewExcelUrl: null,
    };
  },

  watch: {
    '$route': function (to, from) {
      let processReportNo = to.params.processReportNo;
      if((processReportNo != null && processReportNo != undefined)){
        this.processReportNo = processReportNo;
        this.init();
      }
    },
  },

  mounted:function(){
    let processReportNo = this.$route.params.processReportNo;
    if(processReportNo != null){
      this.processReportNo = processReportNo;
      this.init();
    }
  },
  methods:{

    /**
     * 加载excel报表
     */ 
    init:function(){
      let _self = this;
      let processReportNo = '20221024_111018';
      let locale = this.$i18n.locale;
      if(_self.processReportNo === '20221024_111018'){
        if(locale == 'zh-CN'){
          processReportNo = '20221024_111018';
        }
        if(locale == 'en-US'){
          processReportNo = '20221202_180219';
        }
      }
      if(_self.processReportNo === '20221028_164444'){
        if(locale == 'zh-CN'){
          processReportNo = '20221028_164444';
        }
        if(locale == 'en-US'){
          processReportNo = '20221202_181906';
        }
      }
      if(_self.processReportNo === '20221028_170152'){
        if(locale == 'zh-CN'){
          processReportNo = '20221028_170152';
        }
        if(locale == 'en-US'){
          processReportNo = '20221202_182322';
        }
      }

      if(_self.processReportNo === '20221013_171927'){
        if(locale == 'zh-CN'){
          processReportNo = '20221013_171927';
        }
        if(locale == 'en-US'){
          processReportNo = '20221228_094705';
        }
      }
      let previewExcelUrl = '/static/x-spreadsheet/index.html?processReportNo=' + processReportNo;
      _self.previewExcelUrl = previewExcelUrl;
      window.open(_self.previewExcelUrl);
    },
  },
};
</script>