<template>
  <div>
      <a-tabs v-model="currentViewId" type="card" @tabClick="tabClick">
        <a-tab-pane v-for="(option, index) in options"
                     :tab="option.label"
                     :key="option.value">
          <keep-alive>
            <report v-if="showTable" :key="option.value" :name="option.value" :index="index" :ref="option.value"
                    :option="option"/>
          </keep-alive>
        </a-tab-pane>
      </a-tabs>
  </div>
</template>

<script>
import report_com from './report_com.vue';
/**
 * reportIndex_hystjx, reportIndex_rdwpjx, reportIndex_floodjx,
 * reportIndex_jsfl, reportIndex_dikejx, reportIndex_wrjx,
 * reportIndex_keyjx
 * 以上页面使用该组件，若要调整组件（加新功能），请一并调整。
 */
export default {
  props: ['options'],
  components: { report: report_com },
  data() {
    return {
      showTable: true,
      currentViewId: '',
      currentNodeType: '',
      ids: [],
      pid: '000',
      pidNodes: [],
      dxdcMainHeight: window.innerHeight - 180,
      dxdcAsideHeight: window.innerHeight - 180,
      windowHeight: window.innerHeight - 200,
      windowWidth: window.innerWidth - 350,
      treeWidth: 250,
      elmspan: 24,
    };
  },
  created() {
    this.currentViewId = this.options[0].value;
  },
  mounted() {},
  methods: {
    tabClick(e) {
      this.$refs[e][0].searchExcel();
    },
  },
  computed: {
    persId() {
      return localStorage.getItem('userid')
        ? localStorage.getItem('userid')
        : '1098101939614724096';
    },
  },
  watch: {
    currentViewId() {},
  },
};
</script>

<style scoped>
  .ant-tabs{
     background: white !important;
  }
</style>
