zhengnaiwen_citu 1 tydzień temu
rodzic
commit
4a6f14f56f

+ 2 - 3
src/views/modelSystem/modelQa/index.vue

@@ -69,9 +69,7 @@ export default {
           }
         ]
       },
-      queryData: {
-        name: null
-      },
+      queryData: {},
       headers: [
         { text: '问题', align: 'start', value: 'question' },
         { text: 'sql', align: 'start', value: 'sql' },
@@ -98,6 +96,7 @@ export default {
       try {
         this.loading = true
         const { data } = await getFeedbackList({
+          ...this.queryData,
           page: this.pageInfo.current,
           page_size: this.pageInfo.size
         })

+ 39 - 3
src/views/modelSystem/modelStatistics/index.vue

@@ -1,6 +1,26 @@
 <template>
-  <div>
+  <div class="content white">
+    <v-container>
+      <v-row >
+        <v-col
+          v-for="elevation in elevations"
+          :key="elevation.value"
+          cols="3"
+        >
+          <v-card
+            class="pa-2"
+            tile
+            height="200"
+          >
+            <div class="d-flex align-center justify-center flex-column" style="height: 100%;">
+              <div class="text-h3" :class="`${elevation.textColor}--text`">{{ itemData[elevation.value] }}</div>
+              <div>{{ elevation.text }}</div>
+            </div>
+          </v-card>
+        </v-col>
+      </v-row>
 
+    </v-container>
   </div>
 </template>
 
@@ -10,6 +30,20 @@ import {
 } from '@/api/dataChart'
 export default {
   name: 'modelStatistics',
+  data () {
+    return {
+      elevations: [
+        { text: '总反馈数', value: 'total_feedback', textColor: 'primary' },
+        { text: '正向反馈数', value: 'positive_feedback', textColor: 'success' },
+        { text: '负向反馈数', value: 'negative_feedback', textColor: 'error' },
+        { text: '已训练反馈数', value: 'trained_feedback', textColor: 'indigo' },
+        { text: '未训练反馈数', value: 'untrained_feedback', textColor: 'warning' },
+        { text: '正向反馈率', value: 'positive_rate', textColor: 'primary' },
+        { text: '训练覆盖率', value: 'training_rate', textColor: 'primary' }
+      ],
+      itemData: {}
+    }
+  },
   created () {
     this.init()
   },
@@ -17,7 +51,7 @@ export default {
     async init () {
       try {
         const { data } = await getFeedbackStats()
-        console.log(data)
+        this.itemData = data
       } catch (error) {
         this.$snackbar.error(error)
       }
@@ -27,5 +61,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-
+.content {
+  font-size: 14px;
+}
 </style>