From f03420d43d69ee99a0a9534097e38b111abba4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyu=E2=80=9D?= <“winebunny@163.com”> Date: Wed, 17 Jul 2024 21:31:07 +0800 Subject: [PATCH] yy --- .../pages/OpticalStoragePage/storeLine.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/pages/OpticalStoragePage/storeLine.vue b/src/views/pages/OpticalStoragePage/storeLine.vue index ecf21fc..49a0c05 100644 --- a/src/views/pages/OpticalStoragePage/storeLine.vue +++ b/src/views/pages/OpticalStoragePage/storeLine.vue @@ -18,7 +18,6 @@ onMounted(() => { }); const props = defineProps<{ echartArr: any[]; - }>(); // 获取echart挂载的DOM节点 @@ -56,7 +55,14 @@ const drawOneLine = (arr: any) => { function getDom(param: any) { let newStr = ""; param.forEach((item: any) => { - let unit = item.series.unit + let unit="" + if (item.seriesName.indexOf("电压") !== -1) { + unit = " V"; + } else if (item.seriesName.indexOf("电流") !== -1) { + unit = " A"; + } else if (item.seriesName.indexOf("功率") !== -1) { + unit = " kW"; + } newStr += `