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) => {