index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div class="content white">
  3. <v-container>
  4. <v-row >
  5. <v-col
  6. v-for="elevation in elevations"
  7. :key="elevation.value"
  8. cols="3"
  9. >
  10. <v-card
  11. class="pa-2"
  12. tile
  13. height="200"
  14. >
  15. <div class="d-flex align-center justify-center flex-column" style="height: 100%;">
  16. <div class="text-h3" :class="`${elevation.textColor}--text`">{{ itemData[elevation.value] }}</div>
  17. <div>{{ elevation.text }}</div>
  18. </div>
  19. </v-card>
  20. </v-col>
  21. </v-row>
  22. </v-container>
  23. </div>
  24. </template>
  25. <script>
  26. import {
  27. getFeedbackStats
  28. } from '@/api/dataChart'
  29. export default {
  30. name: 'modelStatistics',
  31. data () {
  32. return {
  33. elevations: [
  34. { text: '总反馈数', value: 'total_feedback', textColor: 'primary' },
  35. { text: '正向反馈数', value: 'positive_feedback', textColor: 'success' },
  36. { text: '负向反馈数', value: 'negative_feedback', textColor: 'error' },
  37. { text: '已训练反馈数', value: 'trained_feedback', textColor: 'indigo' },
  38. { text: '未训练反馈数', value: 'untrained_feedback', textColor: 'warning' },
  39. { text: '正向反馈率', value: 'positive_rate', textColor: 'primary' },
  40. { text: '训练覆盖率', value: 'training_rate', textColor: 'primary' }
  41. ],
  42. itemData: {}
  43. }
  44. },
  45. created () {
  46. this.init()
  47. },
  48. methods: {
  49. async init () {
  50. try {
  51. const { data } = await getFeedbackStats()
  52. this.itemData = data
  53. } catch (error) {
  54. this.$snackbar.error(error)
  55. }
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .content {
  62. font-size: 14px;
  63. }
  64. </style>