<template>
  <div class="layout">
    <Header 
      v-if="!route.path.startsWith('/main/reviewManagementDetail')" 
      :horizontalNavList="horizontalNavList"/>
    <AppMain :menuItems="menuList" />
  </div>
</template>

<!-- vue3 setup -->
<script setup lang="ts">
import {computed,ref} from 'vue'
import Header from './components/header.vue'
import AppMain from './components/AppMain.vue'
import { useStore } from 'vuex'
import { useRoute } from 'vue-router'
const store = useStore()
const route = useRoute()

// 此处要根据登录用户的权限 分条件展示 不同的内容
const menuList =  computed(()=>{
  return []
})


const horizontalNavList = computed(()=>{
  let user= JSON.parse(localStorage.getItem('userInfo') || '{}')
  // 学校管理员
  if(user?.roleCodes?.includes('SCHOOL_MANAGER')){
      return store.state.managerHorizontalMenuItems
  // 普通教师
  }else{
    return store.state.ordinaryPeopleHorizontalMenuItems
  }
})

</script>