管道式消毒机
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.

284 lines
7.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="liquid_contaienr">
  3. <div class="header_wrap">
  4. <div class="set_wrap" v-if="tabType == 1">
  5. <van-field
  6. type="number"
  7. v-model="addLiquidVal"
  8. :clickable="true"
  9. :maxlength="3"
  10. readonly
  11. @touchstart.stop="numberKeyboardShow = true"
  12. class="add_liquid_input"
  13. />
  14. <p class="title">设置加液</p>
  15. </div>
  16. <div
  17. :class="
  18. operatorStore.replenishingFluidsWorkState
  19. ? 'btn mr active'
  20. : 'btn mr '
  21. "
  22. v-if="tabType == 1"
  23. @click="stopAdd"
  24. >
  25. 停止加液
  26. </div>
  27. <div
  28. :class="
  29. operatorStore.replenishingFluidsWorkState ? 'btn' : 'btn active'
  30. "
  31. v-if="tabType == 1"
  32. @click="startAdd"
  33. >
  34. 开始加液
  35. </div>
  36. <div
  37. :class="operatorStore.drainingWorkState ? 'btn mr active' : 'btn mr '"
  38. v-if="tabType == 2"
  39. @click="stopPop"
  40. >
  41. 停止排液
  42. </div>
  43. <div
  44. :class="operatorStore.drainingWorkState ? 'btn' : 'btn active'"
  45. v-if="tabType == 2"
  46. @click="startTabLiquid"
  47. >
  48. 开始排液
  49. </div>
  50. </div>
  51. <div
  52. class="add_liquid"
  53. v-if="operatorStore.replenishingFluidsWorkState == 1 && tabType == 1"
  54. >
  55. <svg
  56. xmlns="http://www.w3.org/2000/svg"
  57. xmlns:xlink="http://www.w3.org/1999/xlink"
  58. fill="none"
  59. version="1.1"
  60. width="29.999204635620117"
  61. height="29.999876022338867"
  62. viewBox="0 0 29.999204635620117 29.999876022338867"
  63. >
  64. <g>
  65. <path
  66. d="M14.9997,0C6.7157,0,0,6.71555,0,14.9997C0,23.2839,6.7157,29.9999,14.9997,29.9999C19.1418,29.9999,22.8916,28.3208,25.606,25.6063C28.3204,22.8918,29.9992,19.1417,29.9992,14.9997C29.9992,6.7157,23.2838,0,14.9997,0ZM11.0395,23.4572L11.0395,6.54144L23.6346,14.9997L11.0395,23.4573L11.0395,23.4572Z"
  67. fill="#FF9A2D"
  68. fill-opacity="1"
  69. />
  70. </g>
  71. </svg>
  72. <p class="text">正在加液...</p>
  73. </div>
  74. <div
  75. class="add_liquid"
  76. v-if="operatorStore.drainingWorkState == 1 && tabType == 2"
  77. >
  78. <svg
  79. xmlns="http://www.w3.org/2000/svg"
  80. xmlns:xlink="http://www.w3.org/1999/xlink"
  81. fill="none"
  82. version="1.1"
  83. width="29.999204635620117"
  84. height="29.999876022338867"
  85. viewBox="0 0 29.999204635620117 29.999876022338867"
  86. >
  87. <g>
  88. <path
  89. d="M14.9997,0C6.7157,0,0,6.71555,0,14.9997C0,23.2839,6.7157,29.9999,14.9997,29.9999C19.1418,29.9999,22.8916,28.3208,25.606,25.6063C28.3204,22.8918,29.9992,19.1417,29.9992,14.9997C29.9992,6.7157,23.2838,0,14.9997,0ZM11.0395,23.4572L11.0395,6.54144L23.6346,14.9997L11.0395,23.4573L11.0395,23.4572Z"
  90. fill="#FF9A2D"
  91. fill-opacity="1"
  92. />
  93. </g>
  94. </svg>
  95. <p class="text">正在排液...</p>
  96. </div>
  97. <div class="chart">
  98. <div
  99. class="liquid_column"
  100. :style="{
  101. '--height': `${(disinfectantCapacity / 5000) * 427}px`,
  102. }"
  103. ></div>
  104. </div>
  105. <LiquidModal
  106. v-if="tabType == 2 && tipModalVisible"
  107. :hideTabLiquid="hideTabLiquid"
  108. />
  109. <van-number-keyboard
  110. v-model="addLiquidVal"
  111. :show="numberKeyboardShow"
  112. :maxlength="3"
  113. @blur="numberKeyboardShow = false"
  114. />
  115. </div>
  116. </template>
  117. <script setup>
  118. import LiquidModal from './dialogs/LiquidModal.vue'
  119. import { useDeviceStore, useWebSocketStore, useOperatorStore } from '@/store'
  120. import { ref } from 'vue'
  121. import { storeToRefs } from 'pinia'
  122. import {
  123. startReplenishingFluidsJSON,
  124. stopReplenishingFluidsJSON,
  125. stopDrainingJSON,
  126. } from '@/mock/command'
  127. const numberKeyboardShow = ref(false)
  128. const operatorStore = useOperatorStore()
  129. const props = defineProps({
  130. tabType: {
  131. type: Number,
  132. },
  133. })
  134. const addLiquidVal = ref(1)
  135. const tipModalVisible = ref(false)
  136. const webSocketStore = useWebSocketStore()
  137. const isPopLiquidStatus = ref(false)
  138. const startAdd = () => {
  139. if (!operatorStore.replenishingFluidsWorkState) {
  140. console.log(startReplenishingFluidsJSON(parseInt(addLiquidVal.value)))
  141. webSocketStore.sendCommandMsg(
  142. startReplenishingFluidsJSON(parseInt(addLiquidVal.value)),
  143. )
  144. }
  145. }
  146. const stopAdd = () => {
  147. if (operatorStore.replenishingFluidsWorkState) {
  148. webSocketStore.sendCommandMsg(stopReplenishingFluidsJSON)
  149. }
  150. }
  151. const stopPop = () => {
  152. if (operatorStore.drainingWorkState) {
  153. webSocketStore.sendCommandMsg(stopDrainingJSON)
  154. }
  155. }
  156. const startTabLiquid = () => {
  157. if (!operatorStore.drainingWorkState) {
  158. tipModalVisible.value = true
  159. }
  160. }
  161. const hideTabLiquid = () => {
  162. tipModalVisible.value = false
  163. }
  164. const deviceStore = useDeviceStore()
  165. const { disinfectantCapacity } = storeToRefs(deviceStore)
  166. </script>
  167. <style lang="scss" scoped>
  168. .liquid_contaienr {
  169. margin-bottom: 30px;
  170. height: 580px;
  171. box-sizing: border-box;
  172. background: #ffffff;
  173. border-radius: 16px;
  174. padding: 30px;
  175. padding-bottom: 23px;
  176. position: relative;
  177. .header_wrap {
  178. display: flex;
  179. align-items: center;
  180. justify-content: flex-end;
  181. position: relative;
  182. margin-bottom: 39px;
  183. .set_wrap {
  184. position: relative;
  185. width: 227px;
  186. height: 45px;
  187. background: url(../assets/img/liquid/oper.png) no-repeat;
  188. background-size: 227px 45px;
  189. .title {
  190. position: absolute;
  191. left: 22px;
  192. top: 12px;
  193. font-family: Source Han Sans CN;
  194. font-size: 14px;
  195. font-weight: normal;
  196. line-height: normal;
  197. letter-spacing: 0.1em;
  198. color: #0e0e0e;
  199. }
  200. .add_liquid_input {
  201. position: absolute;
  202. left: 113px;
  203. top: 11px;
  204. width: 40px;
  205. height: 20px;
  206. padding: 0;
  207. color: #0e0e0e;
  208. font-family: Source Han Sans CN;
  209. font-weight: 500;
  210. font-size: 14;
  211. }
  212. }
  213. .btn {
  214. width: 140px;
  215. height: 45px;
  216. border-radius: 23px;
  217. background: #f6f6f6;
  218. display: flex;
  219. align-items: center;
  220. justify-content: center;
  221. font-family: Source Han Sans CN;
  222. font-size: 14px;
  223. font-weight: normal;
  224. line-height: normal;
  225. letter-spacing: 0.1em;
  226. color: #d8d8d8;
  227. }
  228. .mr {
  229. margin: 0 16px;
  230. }
  231. .active {
  232. background: #06518b;
  233. color: #fff;
  234. }
  235. }
  236. .add_liquid {
  237. position: absolute;
  238. left: 382px;
  239. top: 33px;
  240. display: flex;
  241. align-items: center;
  242. .text {
  243. margin-left: 16px;
  244. font-family: Source Han Sans CN;
  245. font-size: 26px;
  246. font-weight: normal;
  247. line-height: normal;
  248. letter-spacing: 0.06em;
  249. color: #ff9a2d;
  250. }
  251. }
  252. .chart {
  253. position: absolute;
  254. left: 310px;
  255. bottom: 23px;
  256. width: 600px;
  257. height: 452px;
  258. background: url(../assets/img/liquid/chart.png) no-repeat;
  259. background-size: 600px 452px;
  260. .liquid_column {
  261. position: absolute;
  262. left: 96px;
  263. bottom: 13px;
  264. width: 491px;
  265. height: var(--height);
  266. border-radius: 0px 12px 12px 0px;
  267. background: linear-gradient(0deg, #06518b 0%, rgba(6, 81, 139, 0.7) 58%);
  268. }
  269. }
  270. }
  271. </style>