<template>
  <div id="app">
    <router-view v-if="isRouterAlive" />
  </div>
</template>  
<script>
export default {
  name: "App",
  provide() {
    //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。
    return {
      reload: this.reloadParent, //父级
      permissions:()=>this.permissions, //组织管理与部门管理员权限表 --这里通过一个函数返回值的方式，传入的是一个function是一个值的引用
    };
  },
  data() {
    return {
      isRouterAlive: true, //控制视图是否显示的变量
      permissions:[]
    };
  },
  mounted() {
    this.permissionsList()
    localStorage.setItem('isJincheng', process.env.VUE_APP_ISJINCHENG);
  },
  methods: {
    reloadParent() {
      this.isRouterAlive = false; //先关闭，
      this.$nextTick(function () {
        this.isRouterAlive = true; //再打开
      });
    },
    permissionsList() {
      if (localStorage.getItem("domainList")) {
        let domainId = localStorage.getItem("domainId");
        let domainList = JSON.parse(localStorage.getItem("domainList"));
        let domainInfo = domainList.find((item) => {
          return item.id == domainId;
        });
        console.log(domainInfo);
        if (domainInfo&&domainInfo.permissions) {
          this.permissions = domainInfo.permissions;
        }
      }
    },
  },
};
</script>

<style lang="scss">
#app {
  font-family: "Microsoft YaHei", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.el-loading-spinner {
  top: 500px !important;
  position: fixed;
}
#nprogress .spinner-icon {
  display: none;
}

/* 解决element-ui的table表格控件表头与内容列不对齐问题 */
/* .el-table__body, .el-table__footer, .el-table__header{
  table-layout:auto;
} */

.ReportTitleDIV {
  display: block;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 5px 0;
  strong {
    font-size: 16px;
    color: #333333;
    font-weight: bold;
  }
}

//考勤全局样式
.ContainerBox {
  padding: 10px 20px;
}

//新员工管理全局样式
.remarkInfo {
  span {
    font-size: 14px;
  }
}

.el-select__tags {
  max-width: 250px !important;
}

/**
谷歌滚动条样式--全局给样式
*/
/* 设置滚动条的样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;  
}
::-webkit-scrollbar-thumb:hover {
  background: #bfbfbf;
}
/* 滚动槽 */
::-webkit-scrollbar-track {
  -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);
  border-radius: 10px;
}
/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
  border-style: solid;
  border-width: 3px;
  border-color: transparent;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
  -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
  &:hover {
    border-color: #bfbfbf;
  }
}
.el-table th.el-table__cell>.cell{text-align: center!important;}
.el-table .el-table__cell{text-align: center!important;}
.two-elp{
  overflow: auto;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
      -webkit-line-clamp: 2; /* 显示的行数 */
}

</style>
