<template>
  <div id="app">
    <router-view/>
  </div>
</template>
<script>
  import {mapGetters} from 'vuex'
  export default{
    data () {
      return {
      }
    },
    computed:{
    ...mapGetters({
      searchValue:'searchValue',
    })
  },
    methods:{
    },
    created () {
    },
    watch: {
      $route(val) {
        try {
          if (!val.meta.modules) {
            let at_modules = JSON.parse(sessionStorage.getItem('active_modules'))
            val.meta.modules?'':val.meta.modules = at_modules
          } else {
            
            let app = val.meta.modules.apps.filter(e=>{
              if (e.name === val.name) return e
            })
            sessionStorage.setItem('active_modules',JSON.stringify(val.meta.modules))
            
            this.$store.dispatch('setActiveApp',{app:app[0],val:this.searchValue})

            let system = JSON.parse(sessionStorage.getItem('module_info'))
            
            let at_system = system.filter(e=>{
              if (e.systemid === val.meta.modules.systemid)
              return e
            })
            this.$store.dispatch('getModules',{mod:at_system[0].modules})
          }          
        } catch (error) {
          
        }
      }
    }
  }
</script>
<style>
body{
  font:16px/1.5 Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif;
  font-family: "阿里巴巴普惠体 2.0 35 Thin";
  min-width: 1200px;
}
.rightBar{
  width:60px;
  height:100vh;
  background: rgba(255,255,255,.5);
  box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
}
.el-drawer__header{
  padding: 10px !important;
  margin-bottom: 0 !important;
  font-size: 16px  !important;
  font-family: PingFang SC-Bold, PingFang SC;
  font-weight: bold  !important;
  color: #333333  !important;
}
</style>
