<template>
  <div>
    <a-tabs>
      <a-tab-pane v-for="(item, index) in tabList" :key="index" v-bind="item">
        <ns-view-list-table v-bind="item.config" />
      </a-tab-pane>
    </a-tabs>
    <opForm ref="opFormRef" />
    <fileDown ref="fileDownRef" />
  </div>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
  import { tableConfig1, tableConfig2, tableConfig3 } from './config';
  import opForm from './op.vue';
  import fileDown from './fileDown.vue';
  const opFormRef = ref();
  const fileDownRef = ref();
  const tabList = [
    { tab: '能耗', config: tableConfig1(opFormRef, fileDownRef) },
    { tab: '碳排', config: tableConfig2 },
    { tab: '标煤', config: tableConfig3 },
  ];
  defineOptions({
    name: 'EnergyMappingIndex', // 与页面路由name一致缓存才可生效
  });
</script>
<style lang="less" scoped></style>
