<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="1"
          v-if="permission('/institutionTeamRules')"
        >
          <teamRules v-if="activeIndex==1"/>
        </el-tab-pane>

        <!-- <el-tab-pane
          label="会员规则设置"
          lazy
          name="2"
          v-if="permissionList.typesManager"
        >
          <remberRules />
        </el-tab-pane> -->
        <!--  -->
        <el-tab-pane
          label="线下课考勤规则"
          lazy
          name="2"
            v-if="permission('/institutionOfflineTeamRules')"
        >
          <offlineTeamRules v-if="activeIndex==2"/>
        </el-tab-pane>

        <el-tab-pane
          label="线上课考勤规则"
          lazy
          name="3"
           v-if="permission('/institutionOnlineCloudRules')"
        >
          <onlineCloudRules v-if="activeIndex==3"/>
        </el-tab-pane>
        <el-tab-pane
          label="乐保设置"
          lazy
          name="4"
          v-if="permission('/institutionLeBaoRules')"
        >
          <leBaoRules v-if="activeIndex==4"/>
        </el-tab-pane>
        <el-tab-pane
          label="课程规则设置"
          lazy
          name="5"
          v-if="permission('/institutionStudentAttRules')"
        >
          <studentAttRules v-if="activeIndex==5"/>
        </el-tab-pane>
        <el-tab-pane
          label="服务异常提醒"
          lazy
          name="6"
           v-if="permission('/institutionServerMinitor')"
        >
          <serverMinitor v-if="activeIndex==6"/>
        </el-tab-pane>
        <el-tab-pane
          label="网管&试听课规则"
          lazy
          name="7"
           v-if="permission('/institutionAccompanyBaseConfig')"
        >
          <accompanyBaseConfig v-if="activeIndex==7"/>
        </el-tab-pane>
        <!--
        <el-tab-pane
          label="登录设置"
          lazy
          name="8"
          v-if="permissionList.errorManager"
        >
          <loginRules />
        </el-tab-pane> -->
      </tab-router>
    </div>
  </div>
</template>
<script>
import teamRules from "./components/teamRules";
import leBaoRules from "./components/leBaoRules";
import loginRules from "./components/loginRules";
import offlineTeamRules from "./components/offlineTeamRules";
import offlineVipRules from "./components/offlineVipRules";
import onlineCloudRules from "./components/onlineCloudRules";
import remberRules from "./components/remberRules";
import studentAttRules from "./components/studentAttRules";
import accompanyBaseConfig from "@/views/categroyManager/accompanyBaseConfig";
import serverMinitor from "./components/serverMinitor";
import { permission } from "@/utils/directivePage";
export default {
  components: {
    teamRules,
    leBaoRules,
    loginRules,
    offlineTeamRules,
    offlineVipRules,
    onlineCloudRules,
    remberRules,
    studentAttRules,
    accompanyBaseConfig,
    serverMinitor,
  },
  name: "baseRulersManager",
  data() {
    return {
      activeIndex: "1",
    };
  },
  methods: {
    handleClick(val) {
      this.activeIndex = val.name;
    },
    permission(str){
      return permission(str)
    }
  },
};
</script>
<style lang="scss" scoped>
/deep/.m-container {
  padding: 0 10px 40px;
}
</style>
