<template>
  <div class="container">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="松动井盖预测" name="wellLooseness">
        <well-looseness ref="wellLooseness" />
      </el-tab-pane>
      <el-tab-pane label="信号弱井" name="wellSignal">
        <well-signal ref="wellSignal" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import wellLooseness from './components/wellLooseness'
import wellSignal from './components/wellSignal'

export default {
  name: 'IntelligenceManage',
  components: { wellLooseness, wellSignal },
  data() {
    return {
      activeName: 'wellLooseness'
    }
  },
  methods: {
    // 处理Tab点击事件，每次点击更新数据
    handleClick(tab, event) {
      if (tab.name === 'wellLooseness') {
        this.$refs.wellLooseness.fetchData()
      } else if (tab.name === 'wellSignal') {
        this.$refs.wellSignal.fetchData()
      }
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .container{
    padding: 5px;
  }
</style>
