Browse Source

#649 历史工况记录-工况标签下没有显示全部工况名称

zhangchuang 3 months ago
parent
commit
c24122d35e

+ 4 - 6
src/components/CalendarHeatmap/index.vue

@@ -83,18 +83,16 @@ const initChart = () => {
               const result: string[] = [];
               const result: string[] = [];
 
 
               for (const obj of objs[0].value) {
               for (const obj of objs[0].value) {
-                if (!uniqueTypes.has(obj.type)) {
-                  uniqueTypes.add(obj.type);
+                if (!uniqueTypes.has(obj.label)) {
+                  uniqueTypes.add(obj.label);
                   result.push(obj.label);
                   result.push(obj.label);
                 }
                 }
-                if (uniqueTypes.size === 3) {
-                  break;
-                }
               }
               }
 
 
               return result;
               return result;
             }
             }
             const nameArr = getFirstThreeUniqueTypes(objs);
             const nameArr = getFirstThreeUniqueTypes(objs);
+            console.log('getFirstThreeUniqueTypes nameArr', nameArr)
             // 动态生成多个 <div> 元素
             // 动态生成多个 <div> 元素
             const colors = ["#FC3F3F", "#FF8C00", "#0982FE"];
             const colors = ["#FC3F3F", "#FF8C00", "#0982FE"];
             const nameDivs = nameArr
             const nameDivs = nameArr
@@ -107,7 +105,7 @@ const initChart = () => {
               )
               )
               .join("");
               .join("");
             return `
             return `
-          <div style="max-height: 150px; width: 200px;background:'#fff';borderRadius:'6px'">
+          <div style="min-height: 50px; width: 200px;background:'#fff';borderRadius:'6px'">
             <div style="border-bottom:1px solid #eee;line-height:30px;text-align:center">${date}</div>
             <div style="border-bottom:1px solid #eee;line-height:30px;text-align:center">${date}</div>
             ${nameDivs}
             ${nameDivs}
             <div style="border-bottom:1px solid #eee;line-height:30px;text-align:center;color:#0982FE;cursor: pointer;"
             <div style="border-bottom:1px solid #eee;line-height:30px;text-align:center;color:#0982FE;cursor: pointer;"

+ 3 - 5
src/views/HealthStatusAnalysis/mock.vue

@@ -695,11 +695,9 @@ const handleConditionHistoryRecords = async (s: string, d: string) => {
     if (tStatus === "all") {
     if (tStatus === "all") {
       dataList.push(item);
       dataList.push(item);
     } else {
     } else {
-      item.data.forEach((element: any) => {
-        if (Number(element.type) === Number(tStatus)) {
-          dataList.push(item)
-        }
-      })
+      if (Number(item.type) === Number(tStatus)) {
+        dataList.push(item)
+      }
     }
     }
   });
   });