<script setup>
  import { ref,onMounted } from 'vue'
  import { checkPwd,departInterence,customInterence,roadshowInterence } from "@/api/api.js";
  import { useAppStore } from '@/store/modules/app'
  import Aside from './components/menu/index.vue'
  import Container from './components/container/index.vue'

  const appStore = useAppStore()
  const isCollapse = ref(false)
  function changeCollapese() {
    isCollapse.value = !isCollapse.value
  }

  
  /* 获取菜单数据 */
  const navlists = ref([])
  function getMenuList() {
    departInterence.getMenu().then(res => {
      if(res.Ret === 200) {
          navlists.value = res.Data.List.length?res.Data.List:[];
          sessionStorage.setItem('MenuList',JSON.stringify(navlists));
          /* 是否有数据报表权限 */
          let bool_data = navlists.value.some(item => {
            return item.name === '报表统计'
          })
          appStore.SET_DATA_AUTH(bool_data)
      }
    })
  }
  onMounted(() => {
    if(sessionStorage.getItem('hasGetMenu')){
      navlists.value=JSON.parse(sessionStorage.getItem('MenuList'))
      sessionStorage.removeItem('hasGetMenu')
    }else{
      getMenuList()
    }
  })


</script>
<template>
  <div id="containercon">
    <!-- 侧边栏 -->
    <Aside 
      :isCollapse="isCollapse"
      :navlists="navlists"
    />

    <!-- 右侧container -->
    <Container 
      :isCollapse="isCollapse"
      @changeCollapese="changeCollapese"
    />
  </div>
</template>
<style lang="scss" scoped>
.notice_item:hover {
  color: #409EFF;
}
.notice_poper {
  max-height: 500px;
  overflow-y: auto;
  .notice-nav-box{
    display: flex;
    padding-top: 12px;
    padding-left: 5px;
    .notice-nav-item{
      cursor: pointer;
      line-height: 2;
      margin-right: 30px;
      position: relative;
    }
  }
  .notice-nav-active{
    color: #409EFF;
    border-bottom: 2px solid #409EFF;
  }
}
#containercon {
  min-width: 1000px;
  width: 100%;
  position: absolute;
  top: 0px;
  bottom: 0px;
  overflow  :hidden;
  display: flex;
  .asider-cont {
    &::-webkit-scrollbar{
      width: 0 !important;
    }
  }
  // reset
  .el-breadcrumb {
    font-size: 16px;
  }
  .left_section_logo {
    width: 148px;
    height: 38px;
  }
}
</style>