Ver código fonte

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

houzekong 2 meses atrás
pai
commit
e1780d844f
1 arquivos alterados com 5 adições e 5 exclusões
  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,
                 },
               };
             }),