From d6bf155a30352558c1bf7a8e7da1f6aac20b7c85 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 25 Mar 2024 10:25:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=94=9F=E4=BA=A7=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=AE=A1=E6=95=B0=E7=B4=AF=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/product_check.vue | 51 ++++++++++++++------------ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/src/views/statistics/product_check.vue b/src/views/statistics/product_check.vue index ce6b5cf9..fd8f9cfa 100644 --- a/src/views/statistics/product_check.vue +++ b/src/views/statistics/product_check.vue @@ -329,15 +329,17 @@ export default { if (res2.data2.ds0) { let data = res2.data2.ds0; if (data.length > 0) { - that.option3.series.data[0].value = data[0].合格数; - that.option3.series.data[1].value = data[0].弯曲; - that.option3.series.data[2].value = data[0].条纹; - that.option3.series.data[3].value = data[0].断裂; - that.option3.series.data[4].value = data[0].偏壁; - that.option3.series.data[5].value = data[0].大小头; - that.option3.series.data[6].value = data[0].结石; - that.option3.series.data[7].value = data[0].气线; - that.option3.series.data[8].value = data[0].箱中破; + data.forEach(item => { + that.option3.series.data[0].value += item.合格数; + that.option3.series.data[1].value += item.弯曲; + that.option3.series.data[2].value += item.条纹; + that.option3.series.data[3].value += item.断裂; + that.option3.series.data[4].value += item.偏壁; + that.option3.series.data[5].value += item.大小头; + that.option3.series.data[6].value += item.结石; + that.option3.series.data[7].value += item.气线; + that.option3.series.data[8].value += item.箱中破; + }) } } }); @@ -370,12 +372,14 @@ export default { if (res2.data2.ds0) { let data = res2.data2.ds0; if (data.length > 0) { - that.option1.series.data[0].value = data[0].合格数; - that.option1.series.data[1].value = data[0].炸纹; - that.option1.series.data[2].value = data[0].条纹; - that.option1.series.data[3].value = data[0].气泡; - that.option1.series.data[4].value = data[0].弯曲; - that.option1.series.data[5].value = data[0].其他; + data.forEach(item => { + that.option1.series.data[0].value += item.合格数; + that.option1.series.data[1].value += item.炸纹; + that.option1.series.data[2].value += item.条纹; + that.option1.series.data[3].value += item.气泡; + that.option1.series.data[4].value += item.弯曲; + that.option1.series.data[5].value += item.其他; + }); } } }); @@ -408,16 +412,17 @@ export default { if (res2.data2.ds0) { let data = res2.data2.ds0; if (data.length > 0) { - that.option2.series.data[0].value = data[0].合格数; - that.option2.series.data[1].value = data[0].断裂; - that.option2.series.data[2].value = data[0].条纹; - that.option2.series.data[3].value = data[0].偏壁; - that.option2.series.data[4].value = data[0].大小头; - that.option2.series.data[5].value = data[0].结石; - that.option2.series.data[6].value = data[0].气线; + data.forEach((item) => { + that.option2.series.data[0].value += item.合格数; + that.option2.series.data[1].value += item.断裂; + that.option2.series.data[2].value += item.条纹; + that.option2.series.data[3].value += item.偏壁; + that.option2.series.data[4].value += item.大小头; + that.option2.series.data[5].value += item.结石; + that.option2.series.data[6].value += item.气线; + }) } } - }); }, handleQuery() {