From ce86b24b46a0ba70384e753c22f9ed7985e0b30c Mon Sep 17 00:00:00 2001 From: huanghao1412 Date: Tue, 20 Aug 2024 17:40:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=BC=E5=90=88PUE=E9=80=9A=E7=94=A81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComprehensivePUEV4/index.vue | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.vue b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.vue index 66b63e8c..2215452f 100644 --- a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.vue +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.vue @@ -488,14 +488,31 @@ const toTwoDecimalPlaces = (num:number) => { return parseFloat(num.toFixed(2)); } +// const resetData = () => { +// let a = toTwoDecimalPlaces(1 + Math.random() * 0.6) +// let b = toTwoDecimalPlaces(1 + Math.random() * 0.6) +// let c = toTwoDecimalPlaces(1 + Math.random() * 0.6) +// let d = toTwoDecimalPlaces(1 + Math.random() * 0.6) +// let e = toTwoDecimalPlaces(Math.random() * 5000) +// let f = toTwoDecimalPlaces(e * (0.8 + Math.random() * 0.1)) +// let g = e - f +// +// dataArr.value = [a, b, c, d, e, f, g] +// option2.value.series[0].data[0].value = toTwoDecimalPlaces(f * 100 / e) +// option2.value.title[0].text = toTwoDecimalPlaces(f * 100 / e) + '' +// option3.value.series[0].data[0].value = toTwoDecimalPlaces(g * 100/ e) +// option3.value.title[0].text = toTwoDecimalPlaces(g * 100 / e) + '' +// } const resetData = () => { + let random = 0.8 + Math.random() * 0.2 + let a = toTwoDecimalPlaces(1 + Math.random() * 0.6) - let b = toTwoDecimalPlaces(1 + Math.random() * 0.6) let c = toTwoDecimalPlaces(1 + Math.random() * 0.6) let d = toTwoDecimalPlaces(1 + Math.random() * 0.6) - let e = toTwoDecimalPlaces(Math.random() * 5000) - let f = toTwoDecimalPlaces(e * (0.8 + Math.random() * 0.1)) - let g = e - f + let f = 1152 * 4 * random + let g = 277 * 4 * random + let e = f + g + let b = e / f dataArr.value = [a, b, c, d, e, f, g] option2.value.series[0].data[0].value = toTwoDecimalPlaces(f * 100 / e)