فهرست منبع

use table to show data

lyc8503 3 سال پیش
والد
کامیت
bcca8cedac
1فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 7 4
      frontend_refactor/src/containers/TaskList.js

+ 7 - 4
frontend_refactor/src/containers/TaskList.js

@@ -1,5 +1,5 @@
 import React from "react";
-import {Card, Collapse, Progress, Skeleton, Statistic} from "antd";
+import {Card, Collapse, Descriptions, Progress, Skeleton, Statistic} from "antd";
 import axios from "axios";
 import {BACKEND_URL} from "../config";
 import {Divider} from "antd/es";
@@ -23,10 +23,11 @@ function showAnalysis(key, data) {
         should_right_angle: "右侧胳膊-肩膀-脖⼦⻆度",
         should_left_angle: "左侧胳膊-肩膀-脖⼦⻆度",
         neck_centre_angle: "左胳膊-脖⼦-右胳膊⻆度",
+        is_prepared: "是否有准备动作"
     }
 
     if (table[key] !== undefined) {
-        return <Statistic title={table[key]} value={data} />
+        return <Descriptions.Item label={table[key]}>{String(data)}</Descriptions.Item>
     } else {
         return <></>
     }
@@ -102,11 +103,13 @@ function renderResult(x, data) {
                 '100%': '#87d068',
             }} /><br/></>)
 
-
+            let detail_items = []
             for (const k in result.data[key]) {
-                analysis.push(showAnalysis(k, result.data[key][k]))
+                detail_items.push(showAnalysis(k, result.data[key][k]))
             }
 
+            analysis.push(<Descriptions bordered>{detail_items}</Descriptions>)
+
             analysis.push(<Divider/>)
         }
     }