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.

36 lines
882 B

2 years ago
2 years ago
  1. <template>
  2. <v-card>
  3. <v-card-title>Member's Progress</v-card-title>
  4. <v-divider />
  5. <v-card-text>
  6. <div v-for="(item, index) in stats.progress" :key="index" class="mb-2">
  7. <span class="font-weight-medium">{{ item.user }}</span>
  8. <span class="font-weight-medium">{{ item.done }} / {{ stats.total }}</span>
  9. <v-progress-linear :value="rate(item.done, stats.total)" />
  10. </div>
  11. </v-card-text>
  12. </v-card>
  13. </template>
  14. <script lang="ts">
  15. import Vue from 'vue'
  16. import { Progress } from '~/domain/models/metrics/metrics'
  17. export default Vue.extend({
  18. data() {
  19. return {
  20. stats: {} as Progress
  21. }
  22. },
  23. async created() {
  24. this.stats = await this.$repositories.metrics.fetchMemberProgress(this.$route.params.id)
  25. },
  26. methods: {
  27. rate(done: number, total: number) {
  28. return (done / total) * 100
  29. }
  30. }
  31. })
  32. </script>