<template>
  <div class="select-course-wrapper">
    <div class="top-line"></div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="公共课程" name="0">
        <CourseSelect></CourseSelect>
      </el-tab-pane>
      <el-tab-pane label="机构课程" name="1">
        <CourseSelectOrg></CourseSelectOrg>
      </el-tab-pane>
    </el-tabs>
    <div class="top-line" style="margin-top: 20px;"></div>
    <CourseList @showOrgCourse="showOrgCourse"></CourseList>
  </div>
</template>
<script>
import CourseSelect from '@/components/education/custom/course-select';
import CourseSelectOrg from '@/components/education/custom/course-select-org';
import CourseList from '@/components/education/custom/course-list';
import { mapActions, mapGetters } from 'vuex';
export default {
  data() {
    return {
      activeName: '0'
    }
  },
  computed: {
    ...mapGetters(['kind'])
  },
  components: {
    CourseSelect,
    CourseSelectOrg,
    CourseList,
  },
  methods: {
    ...mapActions(['setKind']),
    handleClick() {
      this.setKind(this.activeName);
    },
    showOrgCourse(courseId) {
      this.$emit('showOrgCourse', courseId);
    },    
  },
}
</script>
<style lang="less" scoped>
  .select-course-wrapper {
    min-width: 1125px;
    .top-line {
      // width: 120%;
      height: 10px;
      background: rgb(240, 242, 245);
    }
  }
</style>
