You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.2 KiB

  1. <template>
  2. <v-row v-if="stats">
  3. <v-col
  4. cols="12"
  5. lg="4"
  6. >
  7. <v-card>
  8. <doughnut-chart
  9. :chart-data="progress"
  10. />
  11. </v-card>
  12. </v-col>
  13. <v-col
  14. cols="12"
  15. lg="4"
  16. >
  17. <v-card>
  18. <bar-chart
  19. :chart-data="labelStats"
  20. />
  21. </v-card>
  22. </v-col>
  23. <v-col
  24. cols="12"
  25. lg="4"
  26. >
  27. <v-card>
  28. <bar-chart
  29. :chart-data="userStats"
  30. />
  31. </v-card>
  32. </v-col>
  33. </v-row>
  34. </template>
  35. <script>
  36. import { mapActions, mapGetters, mapState } from 'vuex'
  37. import DoughnutChart from '@/components/molecules/DoughnutChart'
  38. import BarChart from '@/components/molecules/BarChart'
  39. export default {
  40. layout: 'project',
  41. components: {
  42. DoughnutChart,
  43. BarChart
  44. },
  45. computed: {
  46. ...mapGetters('statistics', ['userStats', 'labelStats', 'progress']),
  47. ...mapState('statistics', ['stats'])
  48. },
  49. async created() {
  50. await this.fetchStatistics({
  51. projectId: this.$route.params.id
  52. })
  53. },
  54. methods: {
  55. ...mapActions('statistics', ['fetchStatistics'])
  56. },
  57. validate({ params }) {
  58. return /^\d+$/.test(params.id)
  59. }
  60. }
  61. </script>