<template>
  <div id="app">
    <router-view />
    <ws-common-loading v-if="isLoadding"></ws-common-loading>
    <!-- <rookie-training v-if="roles && roles.length"></rookie-training> -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import RookieTraining from '@/components/RookieTraining'
import { EventBus } from 'base-core-lib'
//
export default {
  name: 'App',
  components: { RookieTraining },
  provide() {
    return {
      reload: this.reload // 将reload方法导出
    }
  },
  data() {
    return {
      isRouterAlive: true
    }
  },
  computed: {
    ...mapGetters(['isLoadding', 'roles'])
  },
  watch: {
    $route(to, from) {
      EventBus.$emit('routerCheck', { to, from })
    }
  },
  created() {
    if (window.location.host === 'winsea.com') {
      window.location.href = 'https://www.winsea.com'
      return
    }
    // EventBus.$emit('dayTheme')
  },
  mounted() {
    // setTimeout(() => {
    // 设置灰度模式
    // toggleGrayMode(true)
    // }, 2000);
  },
  methods: {
    reload() {
      // reload实现
      this.isRouterAlive = false
      this.$nextTick(function() {
        this.isRouterAlive = true
      })
    }
  }
}
</script>
<style lang="scss">
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.flex {
  display: flex;
}
.gird {
  display: gird;
}
.el-table th.gutter{
   display: table-cell!important;
}
.el-select-dropdown .el-scrollbar .el-scrollbar__wrap {
  overflow: scroll !important;
}
.el-table .el-scrollbar .el-scrollbar__wrap {
  overflow: scroll !important;
}
::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}
::-webkit-scrollbar-thumb {
  height: 8px !important;
  background: #dadce7;
  border-radius: 4px !important;
}
::-webkit-scrollbar-track-piece {
  background: #f9fafe !important;
}
.el-button--primary{
    background-color: #5878e8;
    border-color: #5878e8;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
      -webkit-appearance: none !important;
    }
input[type='number'] {
      -moz-appearance: textfield !important;
    }
    .el-input.is-disabled .el-input__inner{
      background: #f9FAFC!important;
      color: #8890B1!important;
    }
</style>
