<template>
  <app-tabs ref="appTab" :tab-list="tabList" class="flex-1 overflow-h">
    <template #tabPane="{ item }">
      <component :is="item.name" :ref="item.name" :source-query-row="providerRow" @onTableClick="onTableClick" />
    </template>
  </app-tabs>
</template>

<script>
import SourceQuery from './SourceQuery';
import HistoryEveryDay from './HistoryEveryDay';
import HistoryEveryTime from './HistoryEveryTime';

export default {
  components: { SourceQuery, HistoryEveryDay, HistoryEveryTime },
  data() {
    return {
      // ...TABLE_CONFIG, // table相关
      activeName: 'SourceQuery',
      providerRow: null,
      tabList: [
        { label: '数据资源查询', name: 'SourceQuery' },
        { label: '任务采集日志 - 每天', name: 'HistoryEveryDay' },
        { label: '任务采集明细', name: 'HistoryEveryTime' },
      ],
    };
  },
  computed: {
    currentConfig() {
      return '';
      // return this[this.configName]
    },
  },
  mounted() {},
  methods: {
    onTableClick(row, action) {
      if (action === 'dataSource') {
        this.$refs.appTab.setActive('HistoryEveryDay');
        this.providerRow = row;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.com {
  transition: opacity 0.3s;
}

.leave {
  opacity: 0;
}
</style>
