<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.typesManager">
            <typesManager v-if="activeIndex == 1" />
        </el-tab-pane>
        <el-tab-pane label="乐团收费标准" name="2" v-if="permissionList.chargesList">
          <chargesList v-if="activeIndex == 2" />
        </el-tab-pane>
        <el-tab-pane label="乐团作业模板" name="3" v-if="permissionList.jobTemplateSetting">
            <jobTemplateSetting v-if="activeIndex == 3" />
        </el-tab-pane>
        <el-tab-pane label="热词标签" name="4" v-if="permissionList.errorManager">
          <errorManager v-if="activeIndex == 4" />
        </el-tab-pane>
        <el-tab-pane label="参数设置" name="5" v-if="permissionList.overallManager">
            <overallManager v-if="activeIndex == 5" />
        </el-tab-pane>
        <el-tab-pane label="收费分润配置" name="6" v-if="permissionList.overallManagerTwo">
            <overallManagerTwo v-if="activeIndex == 6" />
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>
<script>
import overallManager from './generalSettings/overallManager'
import overallManagerTwo from './generalSettings/overallManagerTwo'
import musicalManager from './specialSetup/musicalManager'
import typesManager from './specialSetup/typesManager'
import jobTemplateSetting from './specialSetup/jobTemplateSetting'
import errorManager from './generalSettings/errorManager'
import chargesList from './specialSetup/chargesList'
import { permission } from '@/utils/directivePage'
export default {
  components: {
    overallManager,
    overallManagerTwo,
    musicalManager, 
    typesManager, 
    jobTemplateSetting, 
    errorManager,
    chargesList
  },
  name: 'globalConfig',
  data () {
    return {
      activeIndex: '0',
      permissionList: {
        overallManager: permission('/globalConfig/overallManager'),
        overallManagerTwo: permission('/globalConfig/overallManagerTwo'),
        musicalManager: permission('/globalConfig/musicalManager'),
        typesManager: permission('/globalConfig/typesManager'),
        chargesList: permission('/globalConfig/chargesList'),
        jobTemplateSetting: permission('/globalConfig/jobTemplateSetting'),
        errorManager: permission('/globalConfig/errorManager')
      }
    }
  },
  methods: {
    handleClick (val) {
      this.activeIndex = val.name
    }
  }
}
</script>
<style lang="scss" scoped>
/deep/.m-container {
  padding: 0 10px 40px
}
</style>