<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="entry">
            <dataEntry ref="entryTabs" />
          </el-tab-pane>
<!--          <el-tab-pane label="待检任务" name="wait">-->
<!--            <taskWait ref="waitTabs" />-->
<!--          </el-tab-pane>-->
          <el-tab-pane label="历史任务" name="his">
            <taskHis ref="hisTabs" />
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>
<script>
import dataEntry from './tabs/dataEntry'
import taskHis from './tabs/taskHis'
export default {
  components: { dataEntry, taskHis },
  data() {
    return {
      activeName: 'entry'
    }
  },
  mounted() {
    this.activeName = 'entry'
    this._page()
  },
  methods: {
    _changeTabs(tab, event) {
      if (tab.name === 'wait') {
        this.$refs.waitTabs._page()
      } else if (tab.name === 'entry') {
        this._page()
      } else {
        this.$refs.hisTabs._page()
      }
    },
    _page() {
      this.$refs.entryTabs._page()
    }
  }
}
</script>
