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

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