<template>
  <div class="m-container">
    <h2>
      <div class="squrt"></div>
      课程参数设置
    </h2>
    <div class="m-core">
      <!-- navMenu -->
      <tab-router v-model.trim="activeIndex" @tab-click="handleClick">
        <el-tab-pane
          label="乐团收费标准"
          lazy
          name="3"
          v-if="permissionList.chargesList"
        >
          <chargesList v-if="activeIndex == 3" />
        </el-tab-pane>
        <el-tab-pane
          label="乐团课程设置"
          lazy
          name="1"
          v-if="permissionList.courseTimerSetting"
        >
          <courseTimerSetting v-if="activeIndex == 1" />
        </el-tab-pane>
        <el-tab-pane
          label="乐团类型设置"
          lazy
          name="6"
          v-if="permissionList.typesManager"
        >
          <typesManager v-if="activeIndex == 6" />
        </el-tab-pane>
        <el-tab-pane
          label="商品折扣&声部设置"
          lazy
          name="7"
          v-if="permissionList.discountManage"
        >
          <discountManage v-if="activeIndex == 7" />
        </el-tab-pane>
        <el-tab-pane
          label="乐团课程价格设置"
          lazy
          name="2"
          v-if="permissionList.musicCourseFee"
        >
          <musicCourseFee v-if="activeIndex == 2" />
        </el-tab-pane>

        <el-tab-pane
          label="VIP课设置"
          lazy
          name="4"
          v-if="permissionList.vipCourseType"
        >
          <vipCourseType v-if="activeIndex == '4'" />
        </el-tab-pane>
        <el-tab-pane
          label="VIP课程收费设置"
          lazy
          name="8"
          v-if="permissionList.vipChargeSeting"
        >
          <vipChargeSeting v-if="activeIndex == '8'" />
        </el-tab-pane>
        <el-tab-pane
          label="网管课收费设置"
          lazy
          name="5"
          v-if="permissionList.practiceRules"
        >
          <practiceRules v-if="activeIndex == '5'" />
        </el-tab-pane>
      </tab-router>
    </div>
  </div>
</template>
<script>
import courseTimerSetting from "@/views/categroyManager/specialSetup/courseTimerSetting";
import musicCourseFee from "@/views/categroyManager/specialSetup/musicCourseFee";
import typesManager from "@/views/categroyManager//specialSetup/typesManager";
import chargesList from "@/views/categroyManager/specialSetup/chargesList";
import vipCourseType from "@/views/categroyManager/generalSettings/vipCourseType";
import discountManage from "@/views/categroyManager/specialSetup/discountManage";
import vipChargeSeting from "@/views/categroyManager/vipChargeSeting";
import auditionSetting from "./audition";
import practiceRules from './practiceRules'
import { permission } from "@/utils/directivePage";
export default {
  components: {
    courseTimerSetting,
    musicCourseFee,
    chargesList,
    vipCourseType,
    auditionSetting,
    typesManager,
    discountManage,
    vipChargeSeting,
    practiceRules
  },
  name: "baseRulersManager",
  data() {
    return {
      activeIndex: "6",
      permissionList: {
        courseTimerSetting: permission("/globalConfig/courseTimerSetting"),
        musicCourseFee: permission("/globalConfig/musicCourseFee"),
        chargesList: permission("/globalConfig/chargesList"),
        vipCourseType: permission("/vipCourseType"),
        typesManager: permission("/globalConfig/typesManager"),
        discountManage:permission("/specialSetup/discountManage"),
        vipChargeSeting:permission("/vipChargeSeting"),
         practiceRules:permission("/practiceRules"),
      },
    };
  },
  mounted() {
    console.log(this.$route.query);
  },
  methods: {
    handleClick(val) {
      this.activeIndex = val.name;
    },
  },
  watch: {
    "$route.query"(val) {
      if (val.tabrouter) {
        this.handleClick(val.tabrouter);
      }
    },
  },
};
</script>
<style lang="scss" scoped>
/deep/.m-container {
  padding: 0 10px 40px;
}
</style>
