石墨仪设备 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.5 KiB

6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <div class="w-[340px] py-4">
  3. <div>
  4. <div class="text-sm font-medium text-text px-6">溶液容器状态</div>
  5. <div class="flex flex-wrap px-6 py-3 gap-x-8 gap-y-4">
  6. <div
  7. v-for="container in settingStore.heatContainerWithLiquid"
  8. :key="container.id"
  9. class="flex flex-col items-center justify-center">
  10. <div class="bg-[url(@/assets/container.svg)] bg-cover relative w-[42px] h-[58px]">
  11. <div class="absolute top-[8px] bottom-0 w-full rounded overflow-hidden">
  12. <div
  13. class="absolute left-0 w-full bottom-0 bg-[#26D574]"
  14. :style="`height:${
  15. ((container.capacityTotal - container.capacityUsed) / container.capacityTotal) * 100
  16. }%; background: ${
  17. container.capacityTotal - container.capacityUsed <
  18. (settingStore.liquidWarningSetting ? +settingStore.liquidWarningSetting.value : 0)
  19. ? '#EE8223'
  20. : '#26D574'
  21. }`"></div>
  22. <span
  23. class="absolute text-xs left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 font-medium text-white"
  24. >{{
  25. `${Math.round(((container.capacityTotal - container.capacityUsed) / container.capacityTotal) * 100)}%`
  26. }}</span
  27. >
  28. </div>
  29. </div>
  30. <div class="text-xs text-[#666] mt-2">{{ container.solution.name }}</div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script lang="ts" setup>
  37. import { useSettingStore } from "@/stores/setting";
  38. const settingStore = useSettingStore();
  39. </script>