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.

38 lines
835 B

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