<template>
  <div class="main-page">
    <div class="main-header">
      <div class="main-title">
        <img src="/static/images/dashboard/main-logo.png">
        <span>虹膜身份核查系统</span>
      </div>
    </div>

    <div class="home-icon">
      <a href="/dashboard">
        <img src="/static/images/dashboard/home-logo.png">
      </a>
    </div>
    <div class="exit-icon">
      <a href="#" @click="logout">
        <img src="/static/images/dashboard/exit-logo.png">
      </a>
    </div>

    <div class="panelBlock">
      <!-- 统计数字面板 -->
      <data-panel/>

      <!-- 趋势图表面板 -->
      <trend-panel/>

      <!-- 分类统计图表面板 -->
      <category-panel/>
    </div>
  </div>
</template>

<script>
import DataPanel from '@/views/dataCockpit/dataPanel'
import TrendPanel from '@/views/dataCockpit/TrendPanel'
import CategoryPanel from '@/views/dataCockpit/CategoryPanel'
export default {
  name: 'DataCockpitPanel',
  components: { DataPanel, TrendPanel, CategoryPanel },
  methods: {
    logout() {
      this.$store.dispatch('LogOut').then(() => {
        location.reload() // 为了重新实例化vue-router对象 避免bug
      })
    }
  }
}
</script>

<style scoped>
  .panelBlock {
    margin: 0;
    height: calc(100vh - 74px - 20px);
    overflow-y: auto;
    overflow-x: auto;
  }

  .main-page {
    background-size: cover;
    background: url('images/dashboard-background.png') no-repeat fixed 0px 0px;
    height: 100%;
  }

  .home-icon {
    width: 26px;
    height: 26px;
    position: fixed;
    left: 20px;
    top: 12px;
  }

  .exit-icon {
    width: 26px;
    height: 26px;
    position: fixed;
    right: 20px;
    top: 12px;
  }
  .home-icon img, .exit-icon img {
    width: 26px;
    height: 26px;
  }

  .main-header {
    width: 100vw;
    /*background: -webkit-linear-gradient(left, #0d1b3b 0%, #182c7d 50%, #0d1b3b 100%);*/
  }
  .main-title {
    height: 74px;
    text-align: center;
    padding-top: 21px;
    background: url("images/title-background-1920.png");
  }

  .main-title img {
    display: inline-block;
    margin-right: 15px;
    width: 52px;
    height: 32px;
    vertical-align: text-bottom;
  }

  .main-title span {
    color: #FFFFFF;
    font-size: 32px;
    font-weight: bold;
    font-family: '微软雅黑', serif;
  }

  @media(max-width: 1440px) {
    .main-title {
      height: 56px;
      padding-top: 15px;
      background: url("images/title-background-1440.png");
    }
    .main-title span {
      font-size: 24px;
    }
    .main-title img {
      margin-right: 15px;
      width: 42px;
      height: 24px;
    }

    .home-icon {
      left: 18px;
      width: 18px;
      height: 18px;
    }
    .exit-icon {
      right: 18px;
      width: 18px;
      height: 18px;
    }

    .home-icon img, .exit-icon img {
      width: 18px;
      height: 18px;
    }

    .panelBlock {
      height: calc(15px + 285px + 300px + 300px)
    }
  }

  @media(max-width: 1366px) {
    .main-title {
      height: 53px;
      padding-top: 11px;
      background: url("images/title-background-1366.png");
    }
    .main-title span {
      font-size: 24px;
    }
    .main-title img {
      margin-right: 15px;
      width: 36px;
      height: 20px;
    }

    .home-icon {
      left: 16px;
      width: 16px;
      height: 16px;
    }
    .exit-icon {
      right: 16px;
      width: 16px;
      height: 16px;
    }

    .home-icon img, .exit-icon img {
      width: 15px;
      height: 15px;
    }

    .panelBlock {
      /*height: calc(100vh - 64px);*/
      height: calc(15px + 225px + 252px + 252px)
    }
  }
</style>
