Newer
Older
qd_cnooc_front / src / views / alarmStatics / alarmStatics.vue
[wangxitong] on 17 Mar 2022 1 KB 添加三级分区
<template>
  <div class="container" style="background-color: white">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane v-if="hasPerm('/statics/alarmsByDept')" label="按权属单位" name="byDept">
        <alarm-statics-by-dept ref="bydept"/>
      </el-tab-pane>
      <el-tab-pane label="按区域" name="byArea">
        <alarm-statics-by-area ref="byarea"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import AlarmStaticsByDept from './components/alarmStaticsByDept'
import AlarmStaticsByArea from './components/alarmStaticsByArea'
export default {
  name: 'AlarmStatics',
  components: { AlarmStaticsByArea, AlarmStaticsByDept },
  data() {
    return {
      activeName: 'byDept'
    }
  },
  methods: {
    handleClick(tab, event) {
      if (tab.name === 'byDept') {
        this.$refs.bydept.fetchData()
      } else if (tab.name === 'byArea') {
        this.$refs.byarea.fetchData()
      }
    }
  }
}
</script>

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