<template>
  <div class="pa10">
    <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick" style="height: calc(100vh - 20px)">
      <el-tab-pane name="first" label="谐波专项统计">
        <harmonictj ></harmonictj>
      </el-tab-pane>
      <el-tab-pane name="second" label="电能质量综合评估">
        <qypowerpollution  ></qypowerpollution>
      </el-tab-pane>
      <el-tab-pane label="统计报表" name="sex">
       <CustomReport ></CustomReport>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import qypowerpollution from "@/views/cgy-harmonic-boot/detailed/qypowerpollution";
import harmonictj from "@/views/cgy-harmonic-boot/detailed/harmonictj";
import CustomReport from "@/views/cgy-harmonic-boot/staeyreport/CustomReport";
import api1 from '@/api/pollution/pollution'
export default {
  components: {
    qypowerpollution,
    harmonictj,
    CustomReport
  },
  data() {
    return {
      activeName:'first'
    };
  },
  created() {
      if (process.env.VUE_APP_MODE === 'cgyqr') {
          if (process.env.VUE_APP_KEY != 'scqr') {
                this.guanzhou()
            }
      }
  },
  mounted() {

  },
  methods: {
    guanzhou(){
        var data ={
           token:this.$route.query.token
        } 
        api1.guanzhou(data).then(res=>{
            if(res.code=='A0000'){
               return
              }else{
                this.$router.push('/error/massege/403')
              } 
        })
      },
      handleClick(tab, event) {
       // console.log(tab, event);
        this.activeName = tab.name
      }
  },
  beforeDestroy(){
     this.$destroy()
     this.qy = false
  },
};
</script>
<style lang="less" scoped>
.pa10 {
  padding: 10px;
}
::v-deep .el-tabs--border-card > .el-tabs__content {
  padding: 10px;
}
</style>
