<template>
  <div class="m-container">
    <h2>
      <el-page-header @back="onCancel"
                      :content="teacherName"></el-page-header>
    </h2>
    <div class="m-core">
      <!-- navMenu -->
      <el-tabs v-model.trim="activeName"
               type="card"
               @tab-click="handleClick">
        <el-tab-pane label="基本信息"
                     v-if="permissionList.teacherInfo"
                     name="0">
          <teacherInfo v-if="activeName == 0" />
        </el-tab-pane>
        <el-tab-pane label="乐团课"
                     v-if="permissionList.musicGroup"
                     name="1">
          <courseInfo v-if="activeName == 1" />
        </el-tab-pane>
        <el-tab-pane label="VIP课"
                     v-if="permissionList.VipCourse"
                     name="2">
          <courseInfo1 v-if="activeName == 2" />
        </el-tab-pane>
        <el-tab-pane label="网管课"
                     v-if="permissionList.teacherNetwork"
                     name="8">
          <teacherNetwork v-if="activeName == 8" />
        </el-tab-pane>
        <el-tab-pane label="对外课"
                     v-if="permissionList.outCourseList"
                     name="3">
          <outCourseList v-if="activeName == 3" />
        </el-tab-pane>
        <el-tab-pane label="课表详情"
                     v-if="permissionList.teacherRecord"
                     name="4">
          <teacherRecord v-if="activeName == 4" />
        </el-tab-pane>
        <el-tab-pane label="请假记录"
                     v-if="permissionList.leaveRecord"
                     name="5">
          <leaveRecord v-if="activeName == 5" />
        </el-tab-pane>
        <el-tab-pane label="上课结算列表"
                     v-if="permissionList.settlement"
                     name="6">
          <settlement v-if="activeName == 6" />
        </el-tab-pane>
        <el-tab-pane label="时间记录"
                     v-if="permissionList.timerList"
                     name="7">
          <timerList v-if="activeName == 7" />
        </el-tab-pane>
        <el-tab-pane label="学员"
                     v-if="permissionList.serveStudentList"
                     name="9">
          <serveStudentList v-if="activeName == 9" />
        </el-tab-pane>
        <el-tab-pane label="月历课表"
                     v-if="permissionList.calendarList"
                     name="10">
          <calendarList v-if="activeName == 10" />
        </el-tab-pane>
        <el-tab-pane label="周历课表"
                     v-if="permissionList.weeklyCalendar"
                     name="11">
          <weeklyCalendar v-if="activeName == 11" />
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>
<script>
import teacherRecord from "@/views/teacherManager/teacherDetail/components/teacherRecord";
import leaveRecord from "@/views/teacherManager/teacherDetail/components/leaveRecord";
import teacherInfo from "@/views/teacherManager/teacherDetail/components/teacherInfo";
import courseInfo from "@/views/teacherManager/teacherDetail/components/courseInfo";
import courseInfo1 from "@/views/teacherManager/teacherDetail/components/courseInfo1";
import courseInfo2 from "@/views/teacherManager/teacherDetail/components/courseInfo2";
import settlement from "@/views/teacherManager/teacherDetail/components/settlement";
import timerList from "@/views/teacherManager/teacherDetail/components/timerList";
import outCourseList from "@/views/teacherManager/teacherDetail/components/outCourseList";
import teacherNetwork from "@/views/teacherManager/teacherDetail/components/teacherNetwork";
import serveStudentList from "@/views/teacherManager/teacherDetail/components/serveStudentList";
import calendarList from '@/views/teacherManager/teacherDetail/components/calendarList'
import weeklyCalendar from '@/views/teacherManager/teacherDetail/components/weeklyCalendar'
import { permission } from "@/utils/directivePage";
export default {
  components: {
    teacherRecord,
    leaveRecord,
    teacherInfo,
    courseInfo,
    courseInfo1,
    courseInfo2,
    settlement,
    timerList,
    outCourseList,
    teacherNetwork,
    serveStudentList,
    calendarList,
    weeklyCalendar
  },
  name: "teacherDetail",
  data () {
    return {
      teacherName: this.$route.query.teacherName,
      activeName: "0",
      // activeStatus: [true, false, false, false, false, false, false]
      permissionList: {
        teacherInfo: permission("/teacherDetail/teacherInfo"),
        musicGroup: permission("/teacherDetail/musicGroupCourse"),
        VipCourse: permission("/teacherDetail/VIPCourse"),
        domeCourse: permission("/teacherDetail/domeCourse"),
        teacherRecord: permission("/teacherDetail/teacherRecord"),
        leaveRecord: permission("/teacherDetail/leaveRecord"),
        settlement: permission("/teacherDetail/settlement"),
        timerList: permission("/teacherDetail/timerList"),
        outCourseList: permission("/teacherDetail/outCourseList"), //
        teacherNetwork: permission("/teacherDetail/teacherNetwork"),
        serveStudentList: permission("/teacherDetail/serveStudentList"),
        calendarList: permission("/teacherDetail/calendarList"),
        weeklyCalendar: permission("/teacherDetail/weeklyCalendar"),
      },
    };
  },
  activated () {
    this.teacherName = this.$route.query.teacherName;
    this.activeName = "0";
  },

  created () {
  },
  methods: {
    handleClick (val, event) {
      this.activeName = val.name;
      // this.activeStatus[val.name] = true
    },
    onCancel () {
      this.$router.push({
        path: "/business/teacherList"
      });
    }
  }
};
</script>
<style lang="scss">
</style>
