浏览代码

[Fix 0000] 公司端首页没有适配报表数据缺失的情况

houzekong 2 月之前
父节点
当前提交
e1780d844f
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/views/vent/home/clique/index.vue

+ 5 - 5
src/views/vent/home/clique/index.vue

@@ -164,11 +164,11 @@
               // 报表数据只有总数据,按实时数据计算比例然后乘以报表数据
               return {
                 majorpath: {
-                  drag_1: Math.round((majorpath.drag_1 / majorpath.drag_total) * parseInt(readData.fy_merge.value)),
-                  drag_2: Math.round((majorpath.drag_2 / majorpath.drag_total) * parseInt(readData.fy_merge.value)),
-                  drag_3: Math.round((majorpath.drag_3 / majorpath.drag_total) * parseInt(readData.fy_merge.value)),
-                  drag_total: readData.fy_merge.value,
-                  m3_total: readData.retM3_merge.value,
+                  drag_1: Math.round((majorpath.drag_1 / majorpath.drag_total) * parseInt(readData.fy_merge?.value || majorpath.drag_total)),
+                  drag_2: Math.round((majorpath.drag_2 / majorpath.drag_total) * parseInt(readData.fy_merge?.value || majorpath.drag_total)),
+                  drag_3: Math.round((majorpath.drag_3 / majorpath.drag_total) * parseInt(readData.fy_merge?.value || majorpath.drag_total)),
+                  drag_total: readData.fy_merge?.value || majorpath.drag_total,
+                  m3_total: readData.retM3_merge?.value || majorpath.m3_total,
                 },
               };
             }),