From 94db596da665290d22c4cf824e2ae1a75f768b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Sat, 23 Dec 2023 12:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81:=20=E7=94=A8=E7=94=B5?= =?UTF-8?q?=E9=87=8F=E6=A1=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/content/usedEle/UsedEle.vue | 59 ++++++++++------------ 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/src/components/content/usedEle/UsedEle.vue b/src/components/content/usedEle/UsedEle.vue index 0b87b24..f67ac56 100644 --- a/src/components/content/usedEle/UsedEle.vue +++ b/src/components/content/usedEle/UsedEle.vue @@ -71,7 +71,7 @@ const bgImage = computed(() => ); watch(() => props.eleData, (now) => { getBasicData(now.frequencyChangerList) - // setValue() + setValue() }, {deep: true}); watch(() => props.list, (now) => { eleData.value.forEach(item => { @@ -86,22 +86,19 @@ watch(() => props.list, (now) => { } }) }) - // setValue() + setValue() }, {deep: true}); onMounted(()=>{ - // setValue() + setValueA() + setValueB() }) -const setValue=()=> { - let width = (electricityConsumptionMonthly.value * length.value.offsetHeight) / 10000; - console.log('width',electricityConsumptionMonthly.value,width) +const setValueA=()=> { + let width = (5000 * length.value.offsetHeight) / 10000; valueA.value.style.height = `${width}px`; - // let flag = (params.wp.point * length.value.offsetWidth) / params.wp.max; - // point.value.style.left = `${flag}px`; - // if (width >= flag) { - // value.value.style.background = "#F53839"; - // } else { - // value.value.style.background = "#60DDDE"; - // } +} +const setValueB=()=> { + let width = (8000 * length.value.offsetHeight) / 10000; + valueB.value.style.height = `${width}px`; } const getBasicData = (data) => { let tranObj = {} @@ -232,23 +229,6 @@ const getImageUrl = (name) => {