Browse Source

fix: 容器余量

master
guoapeng 2 months ago
parent
commit
550d9e378e
  1. 4
      src/components/home/Liquid/index.vue

4
src/components/home/Liquid/index.vue

@ -10,7 +10,7 @@ const props = defineProps({
}, },
}) })
const solutionStyle = computed(() => { const solutionStyle = computed(() => {
const difference = props.data.capacityUsed / props.data.capacityTotal
const difference = (props.data.capacityTotal - props.data.capacityUsed) / props.data.capacityTotal
const process = 100 - (difference * 100) const process = 100 - (difference * 100)
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)' 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 { return {
@ -19,7 +19,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)
</script> </script>
<template> <template>

Loading…
Cancel
Save