<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="report">
            <waitAssign ref="reportTabs"></waitAssign>
          </el-tab-pane>
          <el-tab-pane label="任务调度" name="dispatch">
            <taskDispatch ref="dispatchTabs"></taskDispatch>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>
<script>
import waitAssign from './tabs/waitAssign'
import taskDispatch from './tabs/TaskDispach'
export default {
  components: { waitAssign, taskDispatch },
  data() {
    return {
      activeName: 'report'
    }
  },
  mounted() {
    this.activeName = 'report'
    this._page()
  },
  methods: {
    _changeTabs(tab, event) {
      if (tab.name === 'report') {
        this._page()
      } else {
        this.$refs.dispatchTabs._open()
      }
    },
    _page() {
      this.$refs.reportTabs._open()
    }
  }
}
</script>
