|
@@ -156,36 +156,41 @@
|
|
|
warningList.value = warningListTemp;
|
|
|
compositeData.value = res.reduce((arr, e) => {
|
|
|
if (isDataRealTime.value) {
|
|
|
- return [...arr, ...e.majorpath_data];
|
|
|
+ arr.push(...e.majorpath_data);
|
|
|
} else {
|
|
|
- return [
|
|
|
- ...arr,
|
|
|
- ...e.majorpath_data.map(({ majorpath, readData }) => {
|
|
|
+ arr.push(
|
|
|
+ ...e.majorpath_data.map((ele) => {
|
|
|
+ const { majorpath, readData } = ele;
|
|
|
+ const { drag_1, drag_2, drag_3, drag_total } = majorpath;
|
|
|
+ const { retM3_merge, fy_merge } = readData;
|
|
|
// 报表数据只有总数据,按实时数据计算比例然后乘以报表数据
|
|
|
- if (readData.fy_merge && readData.retM3_merge) {
|
|
|
+ if (fy_merge && retM3_merge) {
|
|
|
return {
|
|
|
+ ...ele,
|
|
|
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((drag_1 / drag_total) * parseInt(fy_merge.value)),
|
|
|
+ drag_2: Math.round((drag_2 / drag_total) * parseInt(fy_merge.value)),
|
|
|
+ drag_3: Math.round((drag_3 / drag_total) * parseInt(fy_merge.value)),
|
|
|
+ drag_total: parseInt(fy_merge.value),
|
|
|
+ m3_total: parseInt(retM3_merge.value),
|
|
|
},
|
|
|
};
|
|
|
} else {
|
|
|
return {
|
|
|
+ ...ele,
|
|
|
majorpath: {
|
|
|
- drag_1: '-',
|
|
|
- drag_2: '-',
|
|
|
- drag_3: '-',
|
|
|
- drag_total: '-',
|
|
|
- m3_total: '-',
|
|
|
+ drag_1: NaN,
|
|
|
+ drag_2: NaN,
|
|
|
+ drag_3: NaN,
|
|
|
+ drag_total: NaN,
|
|
|
+ m3_total: NaN,
|
|
|
},
|
|
|
};
|
|
|
}
|
|
|
- }),
|
|
|
- ];
|
|
|
+ })
|
|
|
+ );
|
|
|
}
|
|
|
+ return arr;
|
|
|
}, []);
|
|
|
centerDetail.value = res.filter((v) => v.orgcode == orgcode.value)[0];
|
|
|
}
|