<template>
  <div class="ele-body">
    <el-tabs
      v-model="activeName"
      style="width: 100%"
      type="border-card"
      @tab-click="activeNameChange"
    >
      <el-tab-pane label="个人记录" name="个人记录">
        <list
          v-if="activeName == '个人记录'"
          ref="listRef"
          :queryType="0"
        ></list
      ></el-tab-pane>
      <el-tab-pane label="部门记录" name="部门记录">
        <list
          v-if="activeName == '部门记录'"
          ref="listRef"
          :queryType="1"
        ></list
      ></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import list from './components/list.vue';

  export default {
    components: {
      list
    },
    data() {
      return {
        activeName: '个人记录'
      };
    },
    mounted() {
      this.$nextTick(() => {
        this.$refs.listRef.reload();
      });
    },

    methods: {
      activeNameChange() {
        this.$nextTick(() => {
          this.$refs.listRef.reload();
        });
      }
    }
  };
</script>

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