<template>
  <div class="dashboard-container">
    <el-badge :value="count.total_count" class="item" @click.native="gotoTicketPage">
      <el-icon class="el-icon-s-management" style="font-size: 70px;color: #d29898"></el-icon>
    </el-badge>
    <div></div>
    <div class="dashboard-text">name: {{ name }}</div>
    <div class="dashboard-text">perms: <span v-for="perm in perms" :key="perm">{{ perm }}</span></div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name',
      'perms',
      'count'
    ])
  },
  methods:{
    gotoTicketPage(){
      let path = this.$route.path;
      if(path==='/workflow/ticket'){
        this.$message.success("已在当前页面");
      }else{
        this.$router.push({name:'ticket',params:{}})
      }
    },
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
