<template>
  <div class="container">
    <router-view></router-view>
  </div>
</template>

<script>
import { postMethodCommon, getMethodCommon } from "./api/common";
export default {
  created(){
    let token = localStorage.getItem('Token')
    if(!token){
      this.$router.push({
        path: '/',
      })
    }else{
      getMethodCommon("/Check/GetModulesTree").then(res =>{
        res.data.result.forEach(item =>{
          let param = {
            code: item.item.code,
          }
          getMethodCommon("/FormModule/GetEntityByCode",param).then(val =>{
            let rel = val.data.result
            if(item.item.name == "新闻动态管理"){
              window.newsId = rel.formScheme.id
              window.newsMid = rel.entity.id
            }
            if(item.item.name == "商品管理"){
              window.goodsId = rel.formScheme.id
              window.goodsMid = rel.entity.id
            }
            if(item.item.name == "供需管理"){
              window.supplyId = rel.formScheme.id
              window.supplyMid = rel.entity.id
            }
            if(item.item.name == "产品销量"){
              window.goodsNumId = rel.formScheme.id
              window.goodsNumMid = rel.entity.id
            }
            if(item.item.name == "合作社管理"){
              window.cooperId = rel.formScheme.id
              window.cooperMid = rel.entity.id
            }
            
          })              
        })
      })
    }
  },
  mounted(){
    window.addEventListener('hashchange',()=>{
      var currentPath = window.location.hash.slice(1); // 获取输入的路由
      if(this.$router.path !== currentPath){
        this.$router.push(currentPath); // 动态跳转
      }
    },false);
    // document.querySelector(':root').setAttribute('style', '--panel-bg-color: '+'#ffffff')
  }
}
</script>
<script setup>

</script>
<style>
  @import '../public/common.css';
.sm-panel{
  /* left: 480px;
  top: 90px !important; */
  padding: 30px 15px 15px !important;
  /* position: inherit !important; */
}
* {
  margin: 0;
  border: 0;
  padding: 0;
}
.container{
  height: 100%;
}
body {
  background: #222222;
}

.container {
  margin: 0 auto;
  text-align: center;

}
.el-loading-mask{
    background: none !important;
}
/*删除超图图标*/
.cesium-widget-credits {
  display: none !important;
}

/*禁用滚动条*/
*::-webkit-scrollbar {
  display: none;
}

/* 滑道样式 */
body::-webkit-scrollbar{
  width:8px;
  background:#304156;
  border-radius: 8px;
}

/* 定义滑块的样式 */
body::-webkit-scrollbar-thumb{
  border-radius: 10px;
  -webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
  background-color:rgba(0,0,0,0.3);
}

/* 定义滑块鼠标移入时的样式 */
body::-webkit-scrollbar-thumb:hover{
  border-radius: 10px;
  -webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
  background-color:rgba(0,0,0,0.4);
}


</style>
