浏览代码

fix: 设备仪表盘

wzyyy 3 年之前
父节点
当前提交
07a296310b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/pages/device/DashBoard/index.tsx

+ 2 - 2
src/pages/device/DashBoard/index.tsx

@@ -180,8 +180,8 @@ const DeviceBoard = () => {
       },
       },
     ]);
     ]);
     if (res.status === 200) {
     if (res.status === 200) {
-      const thisMonth = res.result.find((item: any) => item.group === 'thisMonth').data.value;
-      const oneDay = res.result.find((item: any) => item.group === 'oneday').data.value;
+      const thisMonth = res.result.find((item: any) => item.group === 'thisMonth')?.data.value;
+      const oneDay = res.result.find((item: any) => item.group === 'oneday')?.data.value;
       setDay(oneDay);
       setDay(oneDay);
       setMonth(thisMonth);
       setMonth(thisMonth);
       const today = res.result.filter((item: any) => item.group === 'today');
       const today = res.result.filter((item: any) => item.group === 'today');