<template>
  <div>
    <div class="layout-content-padding">
      <div class="layout-content-main">
        <el-tabs v-model="activeName" @tab-click="_changeTabs">
          <el-tab-pane label="报告审核" name="lab">
            <reportMake ref="labTabs" />
          </el-tab-pane>
          <el-tab-pane label="历史任务" name="his">
            <historyTask ref="hisTabs" />
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>
<script>
import reportMake from './tabs/reportAudit'
import historyTask from './tabs/historyTask'

export default {
  components: { reportMake, historyTask },
  data() {
    return {
      activeName: 'lab'
    }
  },
  mounted() {
    this.activeName = 'lab'
    this._page()
  },
  methods: {
    _changeTabs(tab, event) {
      if (tab.name === 'lab') {
        this._page()
      } else {
        this.$refs.hisTabs._clearPage()
        this.$refs.hisTabs._page()
      }
    },
    _page() {
      this.$refs.labTabs._clearPage()
      this.$refs.labTabs._page()
    }
  }
}
</script>
