<template>
  <div class="m-container">
    <h2>
      <div class="squrt"></div>全局配置
    </h2>
    <div class="m-core">
      <!-- navMenu -->
      <el-tabs v-model.trim="activeIndex"
               type="card"
               @tab-click="handleClick">

        <el-tab-pane label="声部设置(对内)"
                     name="0"
                     v-if="permissionList.musicalManager">
          <musicalManager v-if="activeIndex == 0" />
        </el-tab-pane>
        <el-tab-pane label="声部设置(对外)"
                     name="1"
                     v-if="permissionList.musicalManagerOut">
          <musicalManagerOut v-if="activeIndex == 1" />
        </el-tab-pane>
        <el-tab-pane label="乐团收费类型"
                     name="2"
                     v-if="permissionList.typesManager">
          <typesManager v-if="activeIndex == 2" />
        </el-tab-pane>
        <el-tab-pane label="折扣设置"
                     name="9"
                     v-if="permissionList.typesManager">
          <discountManage v-if="activeIndex == 9" />
        </el-tab-pane>
        <el-tab-pane label="乐团收费标准"
                     name="3"
                     v-if="permissionList.chargesList">
          <chargesList v-if="activeIndex == 3" />
        </el-tab-pane>
        <el-tab-pane label="乐团课程费用"
                     name="10"
                     v-if="permissionList.holidaySetting">
          <musicCourseFee v-if="activeIndex == 10" />
        </el-tab-pane>
        <el-tab-pane label="乐团作业模板"
                     name="4"
                     v-if="permissionList.jobTemplateSetting">
          <jobTemplateSetting v-if="activeIndex == 4" />
        </el-tab-pane>
        <el-tab-pane label="热词标签"
                     name="5"
                     v-if="permissionList.errorManager">
          <errorManager v-if="activeIndex == 5" />
        </el-tab-pane>
        <el-tab-pane label="参数设置"
                     name="6"
                     v-if="permissionList.overallManager">
          <overallManager v-if="activeIndex == 6" />
        </el-tab-pane>
        <el-tab-pane label="收费分润配置"
                     name="7"
                     v-if="permissionList.overallManagerTwo">
          <overallManagerTwo v-if="activeIndex == 7" />
        </el-tab-pane>
        <!-- holiday_setting -->
        <el-tab-pane label="节假日设置"
                     name="8"
                     v-if="permissionList.holidaySetting">
          <holidaySetting v-if="activeIndex == 8" />
        </el-tab-pane>

      </el-tabs>
    </div>
  </div>
</template>
<script>
import overallManager from './generalSettings/overallManager'
import overallManagerTwo from './generalSettings/overallManagerTwo'
import holidaySetting from './generalSettings/holidaySetting'
import musicalManager from './specialSetup/musicalManager'
import musicalManagerOut from './specialSetup/musicalManagerOut'
import typesManager from './specialSetup/typesManager'
import discountManage from './specialSetup/discountManage'
import jobTemplateSetting from './specialSetup/jobTemplateSetting'
import errorManager from './generalSettings/errorManager'
import chargesList from './specialSetup/chargesList'
import musicCourseFee from './specialSetup/musicCourseFee'
import { permission } from '@/utils/directivePage'
export default {
  components: {
    overallManager,
    overallManagerTwo,
    holidaySetting,
    musicalManager,
    musicalManagerOut,
    typesManager,
    discountManage,
    jobTemplateSetting,
    errorManager,
    chargesList,
    musicCourseFee
  },
  name: 'globalConfig',
  data () {
    return {
      activeIndex: '0',
      permissionList: {
        overallManager: permission('/globalConfig/overallManager'),
        overallManagerTwo: permission('/globalConfig/overallManagerTwo'),
        musicalManager: permission('/globalConfig/musicalManager'),
        musicalManagerOut: permission('/globalConfig/musicalManagerOut'),
        typesManager: permission('/globalConfig/typesManager'),
        chargesList: permission('/globalConfig/chargesList'),
        jobTemplateSetting: permission('/globalConfig/jobTemplateSetting'),
        errorManager: permission('/globalConfig/errorManager'),
        holidaySetting: permission('/globalConfig/holidaySetting'),
        musicCourseFee:permission('/globalConfig/musicCourseFee')
      }
    }
  },
  methods: {
    handleClick (val) {
      this.activeIndex = val.name
    }
  }
}
</script>
<style lang="scss" scoped>
/deep/.m-container {
  padding: 0 10px 40px;
}
</style>
