<template>
  <div>
    <screenOrdinary ></screenOrdinary>
    <!-- <screenSchool v-if="matchScreen(2)"></screenSchool>
    <screenOrdinary v-else ></screenOrdinary> -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import screen_ordinary from "@/views/dashboard/components/screen_ordinary";
import screen_school from "@/views/dashboard/components/screen_school";
import {checkVisitorType} from "@/utils/checkRole";

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'username'
    ])
  },
  components: {
    screenOrdinary: screen_ordinary,
    screenSchool: screen_school,
  },
  data() {
    return {}
  },
  methods: {
    // 判断显示普通大屏or迎新大屏
    matchScreen(type) {
      let status = false;
      switch (type) {
        case 1 :
          if (((!checkVisitorType(['1']) && checkVisitorType(['2'])) || (checkVisitorType(['1']) && checkVisitorType(['2'])))) {
            status = true
          } else {
            status = false
          }
          break;
        case 2 :
          if (checkVisitorType(['1']) && !checkVisitorType(['2'])) {
            status = true
          } else {
            status = false
          }
          break;
        default:
          break;
      };
      return status;
    }
  }
}
</script>

<style scoped>

</style>
