<template>
  <div id="app">
    <div class="sjp-content">
      <div class="nav">
        <div class="logo">
          世纪PLUS
        </div>
        <Menu theme="dark" mode="vertical" :open-names="openNames" @on-select="selectHandle" :active-name="activeKey">
        <Submenu name="2">
            <template slot="title">
                <Icon type="ios-paper"></Icon>
                免单
            </template>
            <Menu-item name="/freelist">周周赢免单</Menu-item>
        </Submenu>
        <Submenu name="1">
            <template slot="title">
                <Icon type="ios-paper"></Icon>
                统计数据
            </template>
            <!-- <Menu-item name="/statics">统计</Menu-item> -->
            <Menu-item name="/orderdata">周周赢免单</Menu-item>
            <Menu-item name="/authdata">授权统计</Menu-item>
            <Menu-item name="/prizemessage">免单奖品留言</Menu-item>
        </Submenu>
      </Menu>
      </div>
      <div class="sjp-detail">
        <div class="sjp-bread">
           <Breadcrumb>
            <BreadcrumbItem to="/">统计数据</BreadcrumbItem>
            <BreadcrumbItem to="/">统计</BreadcrumbItem>
          </Breadcrumb>
        </div>
        <div class="sjp-data">
          <router-view></router-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'App',
  components: { },
  data() {
    return {
      activeKey:'',
      openNames:['1','2']
    }
  },
  created() {
  },
  watch:{
    '$route'(route){
      this.activeKey = route.path
    }
  },
  methods:{
    selectHandle(key){
      this.$router.push(key)
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  background-color: #f6f7f9;
  min-height: 100vh;
}
.nav{
  width: 250px;
  background: #00152a;
  height: 100vh;
}
.logo{
  width:250px;
  height: 64px;
  line-height: 64px;
  color: rgb(118, 64, 129);
  font-size: xx-large;
  text-align: center;
}
.sjp-content{
  display: flex;
  flex-direction: row;
  justify-content: left;
}
.sjp-detail{
  width: calc(100% - 100px);
}
.sjp-bread{
  height: 64px;
  line-height: 64px;
  padding: 0px 20px;
  background: #fff;
}
.sjp-data{
  margin: 18px;
  background: #fff;
  height: calc(100vh - 120px);
  overflow: auto;
}
</style>
