<template>
  <div class="form-wrap">
    <div style="padding: 10px">
      <el-tabs
        v-model="activeName"
        @tab-click="handleTabClick">
        <el-tab-pane
          name="visitorStat"
          label="游客统计">
          <VisitorStat ref="visitorStat" />
        </el-tab-pane>
        <el-tab-pane
          name="blacklist"
          label="黑名单管理">
          <BlacklistManage ref="blacklist" />
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import VisitorStat from './visitor/VisitorStat'
import BlacklistManage from './visitor/BlacklistManage'

export default {
  name: 'visitorQuery',
  components: {
    VisitorStat,
    BlacklistManage
  },
  data () {
    return {
      activeName: 'visitorStat'
    }
  },
  methods: {
    handleTabClick (tab) {
      if (tab.name === 'visitorStat') {
        this.$refs.visitorStat.getVisitorList()
      }
      if (tab.name === 'blacklist') {
        this.$refs.blacklist.getList()
      }
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
