<template>
  <div>
    <h2>
      欢迎使用徽象防伪
    </h2>
    <hr>
    <div class="fade-in">
      <p>
      您好，欢迎使用徽象防伪管理后台。
      </p>
      <p v-if="$root.message_count">
        收件箱消息：[{{ $root.message_count.new }} / {{ $root.message_count.total }}]
        <router-link to="/inbox">查看</router-link>
      </p>
      <p>
      当前登录身份为：
      <b v-if="$root.is_admin">管理员</b>
      <b v-else>租户</b>
      </p>
      <div class="stats" v-if="stats">
        <AdminDashboard :stats=stats v-if="$root.is_admin" />
        <TenantDashboard :stats=stats v-else />
      </div>
      <hr>
      <Chart />
    </div>
  </div>
</template>

<script>

import AdminDashboard from '../components/admin-dashboard.vue'
import TenantDashboard from '../components/tenant-dashboard.vue'
import Chart from '../components/chart.vue'

export default {
  name: 'Dashboard',
  components: {
    AdminDashboard,
    TenantDashboard,
    Chart,
  },
  props: [],
  data: function () {
    return {
      stats: null,
    };
  },
  computed: {
  },
  methods: {
  },
  mounted() {
  },
}
</script>

<style scoped>
div.stats {
  margin-top: 5rem;
}
div.history {
  margin: 5rem 0 5rem 0;
}
div.history h4 {
  text-align: center;
}
</style>

