From 8a2f93159f36db0c89b2bbfc35b9f9626dca44e9 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Fri, 13 Jun 2025 16:05:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=B9=E5=99=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/Liquid/index.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/home/Liquid/index.vue b/src/components/home/Liquid/index.vue index 6151d51..f05bb8e 100644 --- a/src/components/home/Liquid/index.vue +++ b/src/components/home/Liquid/index.vue @@ -10,8 +10,10 @@ const props = defineProps({ }, }) const solutionStyle = computed(() => { - const difference = props.data.capacityUsed / props.data.capacityTotal - const process = 100 - (difference * 100) + const difference = (props.data.capacityTotal - props.data.capacityUsed) / props.data.capacityTotal + console.log(difference) + const process = 100 - difference * 100 + console.log(process) const filter = difference > 0.4 ? 'hue-rotate(270deg) saturate(100) brightness(81%)' : difference > 0.1 ? 'hue-rotate(150deg) saturate(100)' : 'hue-rotate(120deg) saturate(100)' return { 'filter': filter, @@ -19,7 +21,7 @@ const solutionStyle = computed(() => { } }) -const percentage = computed(() => Number((props.data.capacityUsed / props.data.capacityTotal).toFixed(2)) * 100) +const percentage = computed(() => Number(((props.data.capacityTotal - props.data.capacityUsed) / props.data.capacityTotal).toFixed(2)) * 100)