From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示

---
 src/views/SignMachineNest/MachineLeft/InspectionRaskDetails.vue |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/views/SignMachineNest/MachineLeft/InspectionRaskDetails.vue b/src/views/SignMachineNest/MachineLeft/InspectionRaskDetails.vue
index b96be9b..d2ff6e6 100644
--- a/src/views/SignMachineNest/MachineLeft/InspectionRaskDetails.vue
+++ b/src/views/SignMachineNest/MachineLeft/InspectionRaskDetails.vue
@@ -109,7 +109,7 @@
 		},
 	],
 }
-
+import _ from 'lodash'
 // chart.setOption(option);
 
 const pieOption = {
@@ -138,7 +138,7 @@
 					tarValue = data[i].value
 				}
 			}
-			let percentage = ((tarValue / total) * 100).toFixed(1)
+			let percentage = total ? _.round(((tarValue / total) * 100),1) : 0
 			return `${name} ${percentage}%`
 		},
 	},
@@ -155,7 +155,9 @@
 			label: {
 				show: true,
 				position: 'inside',
-				formatter: '{c}%',
+				formatter: function(params) {
+          return params.value > 0 ? params.value : ''
+        },
 				fontSize: 12,
 				color: '#fff',
 			},
@@ -165,7 +167,7 @@
 				{ value: 0, name: '处理中', itemStyle: { color: '#FFC398' } },
 				{ value: 0, name: '已完成', itemStyle: { color: '#AFD9FB' } },
 				// { value: 0, name: '待分拨', itemStyle: { color: '#E9C81A' } },
-				
+
 				{ value: 0, name: '已完结', itemStyle: { color: '#11C4FF' } },
 			],
 		},

--
Gitblit v1.9.3