浏览代码

日常开发

linxuxiang 2 月之前
父节点
当前提交
1d8f30ceab
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      src/views/train/test.vue

+ 8 - 8
src/views/train/test.vue

@@ -571,15 +571,15 @@ const getFaceWindow = (data: boolean, num: number = 0) => {
 const getAchievement = (data: any) => {
 const getAchievement = (data: any) => {
   //console.log("成绩", data);
   //console.log("成绩", data);
   let type = parameter.value.project;
   let type = parameter.value.project;
-  let count =
-    data?.[dic.typeResultKey[type]]?.toFixed(0);
+  let result =
+    data?.[dic.typeResultKey[type]];
+    let count = null;
   if (["trijump", "solidball", "shotput", "longjump"].includes(type)) {
   if (["trijump", "solidball", "shotput", "longjump"].includes(type)) {
-    count =
-      data?.[dic.typeResultKey[type]]?.toFixed(2);
-    count = Math.round(count) / 100;
-  }
-  if (["basketballv1", "footballv1"].includes(type)) {
-    count = proxy?.$utils.runTime(data?.[dic.typeResultKey[type]], true, 1)
+    count = (Math.round(result) / 100).toFixed(2);
+  }else if(["basketballv1", "footballv1"].includes(type)){
+    count = proxy?.$utils.runTime(result, true, 1)
+  }else{
+    count = result;
   }
   }
   data.count = count || "0";
   data.count = count || "0";
   data.score = data.score || "0";
   data.score = data.score || "0";