<template>
  <section class="app-main">
    <transition name="fade-transform" mode="out-in">
      <keep-alive :include="cachedViews">
        <router-view :key="key"/>
      </keep-alive>
    </transition>
    <div v-for="item in company" id="el-main-footer" :key="item.id">
      <span>© 2019{{ item.companyname }}</span>
      <span> ⋅ </span>
      <a href="http://www.beian.miit.gov.cn" target="_blank">{{ item.recordno }}</a>
    </div>
  </section>
</template>

<script>
import { loadSysByUserid } from '@/api/sSysmanage'
export default {
  name: 'AppMain',
  data() {
    return {
      company: []
    }
  },
  computed: {
    cachedViews() {
      return this.$store.state.tagsView.cachedViews
    },
    key() {
      return this.$route.fullPath
    }
  },
  created() {
    this.loadSysByUserid()
  },
  methods: {
    loadSysByUserid() {
      loadSysByUserid().then(res => {
        // console.log(res, '22')
        this.company.push(res)
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  .app-main {
    z-index: 88;
    /*84 = navbar + tags-view = 50 +34 */
    min-height: calc(100vh - 84px);
    width: 100%;
    position: relative;
    overflow: hidden;
    padding-bottom: 12px;
  }

  .fixed-header+.app-main {
    padding-top: 50px;
  }

  .hasTagsView {
    .app-main {
      min-height: calc(100vh - 84px);
    }

    .fixed-header+.app-main {
      padding-top: 85px;
    }
  }
</style>

