Browse Source

fix:容器状态

master
guoapeng 2 months ago
parent
commit
8a2f93159f
  1. 8
      src/components/home/Liquid/index.vue

8
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)
</script>
<template>

Loading…
Cancel
Save