<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="permissionList.earlyWarning"
        >
          <leBaoRules v-if="activeIndex == 1" />
        </el-tab-pane>
        <!-- <el-tab-pane
          label="商品库存预警"
          lazy
          name="2"
          v-if="permissionList.earlyWarning"
        >
          <goodsRules />
        </el-tab-pane> -->
        <el-tab-pane
          label="登录限制"
          lazy
          name="3"
          v-if="permissionList.earlyWarning"
        >
          <loginRules />
        </el-tab-pane>
        <el-tab-pane
          label="服务异常提醒"
          lazy
          name="4"
          v-if="permissionList.earlyWarning"
        >
          <serverMinitor />
        </el-tab-pane>
        <el-tab-pane
          label="机构参数设置"
          lazy
          name="5"
          v-if="permissionList.earlyWarning"
        >
          <institutionRules />
        </el-tab-pane>
      </tab-router>
    </div>
  </div>
</template>
<script>
import leBaoRules from "@/views/courseRulersManager/components/leBaoRules";
import loginRules from "@/views/courseRulersManager/components/loginRules";
import serverMinitor from "./components/serverMinitor";
import goodsRules from "./components/goodsRules";
import institutionRules from "./components/institutionRules";

import { permission } from "@/utils/directivePage";
export default {
  components: {
    leBaoRules,
    serverMinitor,
    loginRules,
    goodsRules,
    institutionRules,
  },
  name: "baseRulersManager",
  data() {
    return {
      activeIndex: "1",
      permissionList: {
        overallManager: permission("/globalConfig/overallManager"),
        overallManagerTwo: permission("/globalConfig/overallManagerTwo"),
        holidaySetting: permission("/globalConfig/holidaySetting"),
        earlyWarning: permission("/globalConfig/earlyWarning"),
      },
    };
  },
  methods: {
    handleClick(val) {
      this.activeIndex = val.name;
    },
  },
};
</script>
<style lang="scss" scoped>
/deep/.m-container {
  padding: 0 10px 40px;
}
</style>
