石墨仪设备 前端仓库
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.

153 lines
3.6 KiB

6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <div class="h-[--footerHeight] bg-[--bgColor] footer">
  3. <div class="footer_ins">
  4. <img
  5. class="w-[18px] mx-4"
  6. :class="statusStr !== '等待指令' ? 'ani' : ''"
  7. src="@/assets/icon_operation.svg"
  8. alt="op" />
  9. <span class="ins_text text_size" @click="testStatus">{{ statusStr }}</span>
  10. </div>
  11. <div class="footer_normal">
  12. <van-popover v-model:show="showWastePopover" placement="top-end" class="waste_popover">
  13. <template #reference>
  14. <div class="footer_container">
  15. <div class="circle" :class="!!hasLowLiquid ? 'bg-[#EE8223]' : 'bg-[#26d574]'"></div>
  16. <div
  17. class="waste_status text_size font-medium underline"
  18. :class="!!hasLowLiquid ? 'text-[#EE8223]' : 'text-primary'">
  19. {{ !!hasLowLiquid ? "溶液余量低" : "溶液正常" }}
  20. </div>
  21. <div class="waste_detail">
  22. <button class="text_size"><van-icon name="arrow" /></button>
  23. </div>
  24. </div>
  25. </template>
  26. <Liquid></Liquid>
  27. </van-popover>
  28. </div>
  29. </div>
  30. </template>
  31. <script lang="ts" setup>
  32. import { ref, onMounted, onUnmounted, computed } from "vue";
  33. import Liquid from "./Liquid.vue";
  34. import { onGoingStatusOb, setOnGoingStatus } from "@/stores/status";
  35. import { createWebSocket, sharedWsUrl } from "@/services/socket";
  36. import { useSettingStore } from "@/stores/setting";
  37. const settingStore = useSettingStore();
  38. const hasLowLiquid = computed(() => {
  39. return settingStore.heatContainers.find(
  40. c => c.capacityTotal - c.capacityUsed < (settingStore.liquidWarningSetting ? +settingStore.liquidWarningSetting.value : 0)
  41. );
  42. });
  43. const showWastePopover = ref(false);
  44. const statusStr = ref<string>("");
  45. function testStatus() {
  46. if (statusStr.value === "等待指令") {
  47. setOnGoingStatus("doorOpening");
  48. } else {
  49. setOnGoingStatus("idle");
  50. }
  51. }
  52. onMounted(() => {
  53. const subscription2 = onGoingStatusOb.subscribe(status => {
  54. if (status === "idle") {
  55. statusStr.value = "等待指令";
  56. } else if (status === "doorOpening") {
  57. statusStr.value = "正在开门";
  58. } else if (status === "doorClosing") {
  59. statusStr.value = "正在关门";
  60. } else if (status === "shaking") {
  61. statusStr.value = "正在摇匀";
  62. } else if (status === "injecting") {
  63. statusStr.value = "正在加液";
  64. } else if (status === "movingToAct") {
  65. statusStr.value = "正在移至加液区";
  66. } else if (status === "movingToHeat") {
  67. statusStr.value = "正在移至加热区";
  68. }
  69. });
  70. onUnmounted(() => {
  71. subscription2.unsubscribe();
  72. });
  73. });
  74. </script>
  75. <style lang="scss" scoped>
  76. @use "@/assets/style/mixin.scss" as *;
  77. .footer {
  78. display: flex;
  79. align-items: center;
  80. justify-content: flex-end;
  81. }
  82. @keyframes rotateAnimation {
  83. from {
  84. transform: rotate(0deg);
  85. }
  86. to {
  87. transform: rotate(360deg);
  88. }
  89. }
  90. .ani {
  91. animation: rotateAnimation 3s linear infinite;
  92. }
  93. .footer_ins {
  94. flex: 1 1 auto;
  95. display: flex;
  96. align-items: center;
  97. border-radius: 4px;
  98. background: #ffffff;
  99. height: 2.5rem;
  100. width: 39.625rem;
  101. margin-left: 1.5rem;
  102. @media (min-width: $lg) {
  103. margin-left: 11.875rem;
  104. }
  105. }
  106. .footer_waste {
  107. display: flex;
  108. align-items: center;
  109. border-radius: 4px;
  110. min-width: 13.4375rem;
  111. height: 2.5rem;
  112. background: #ffffff;
  113. margin: 0 1.5rem;
  114. }
  115. .footer_normal {
  116. margin-left: 3rem;
  117. margin-right: 1.5rem;
  118. }
  119. .text_size {
  120. font-size: 1rem;
  121. padding-right: 0.3125rem;
  122. }
  123. .footer_container {
  124. display: flex;
  125. align-items: center;
  126. border-radius: 5px;
  127. width: 13.75rem;
  128. height: 2.5rem;
  129. background: #ffffff;
  130. .circle {
  131. width: 1rem;
  132. height: 1rem;
  133. border-radius: 50%;
  134. margin-left: 10px;
  135. }
  136. .waste_status {
  137. padding: 5px 5px;
  138. }
  139. .waste_detail {
  140. margin-left: auto;
  141. }
  142. }
  143. </style>