大空间消毒机
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.

298 lines
7.5 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
  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. >
  104. <p class="indicator">{{ disinfectantCapacity }}g</p>
  105. </div>
  106. </div>
  107. <LiquidModal
  108. v-if="tabType == 2 && tipModalVisible"
  109. :hideTabLiquid="hideTabLiquid"
  110. />
  111. <van-number-keyboard
  112. v-model="addLiquidVal"
  113. :show="numberKeyboardShow"
  114. :maxlength="3"
  115. @blur="numberKeyboardShow = false"
  116. />
  117. </div>
  118. </template>
  119. <script setup>
  120. import LiquidModal from './dialogs/LiquidModal.vue'
  121. import { useDeviceStore, useWebSocketStore, useOperatorStore } from '@/store'
  122. import { ref } from 'vue'
  123. import { storeToRefs } from 'pinia'
  124. import {
  125. startReplenishingFluidsJSON,
  126. stopReplenishingFluidsJSON,
  127. stopDrainingJSON,
  128. } from '@/mock/command'
  129. const numberKeyboardShow = ref(false)
  130. const operatorStore = useOperatorStore()
  131. const props = defineProps({
  132. tabType: {
  133. type: Number,
  134. },
  135. })
  136. const addLiquidVal = ref(1)
  137. const tipModalVisible = ref(false)
  138. const webSocketStore = useWebSocketStore()
  139. const isPopLiquidStatus = ref(false)
  140. const startAdd = () => {
  141. if (!operatorStore.replenishingFluidsWorkState) {
  142. console.log(startReplenishingFluidsJSON(parseInt(addLiquidVal.value)))
  143. webSocketStore.sendCommandMsg(
  144. startReplenishingFluidsJSON(parseInt(addLiquidVal.value)),
  145. )
  146. }
  147. }
  148. const stopAdd = () => {
  149. if (operatorStore.replenishingFluidsWorkState) {
  150. webSocketStore.sendCommandMsg(stopReplenishingFluidsJSON)
  151. }
  152. }
  153. const stopPop = () => {
  154. if (operatorStore.drainingWorkState) {
  155. webSocketStore.sendCommandMsg(stopDrainingJSON)
  156. }
  157. }
  158. const startTabLiquid = () => {
  159. if (!operatorStore.drainingWorkState) {
  160. tipModalVisible.value = true
  161. }
  162. }
  163. const hideTabLiquid = () => {
  164. tipModalVisible.value = false
  165. }
  166. const deviceStore = useDeviceStore()
  167. const { disinfectantCapacity } = storeToRefs(deviceStore)
  168. </script>
  169. <style lang="scss" scoped>
  170. .liquid_contaienr {
  171. margin-bottom: 30px;
  172. height: 580px;
  173. box-sizing: border-box;
  174. background: #ffffff;
  175. border-radius: 16px;
  176. padding: 30px;
  177. padding-bottom: 23px;
  178. position: relative;
  179. .header_wrap {
  180. display: flex;
  181. align-items: center;
  182. justify-content: flex-end;
  183. position: relative;
  184. margin-bottom: 39px;
  185. .set_wrap {
  186. position: relative;
  187. width: 227px;
  188. height: 45px;
  189. background: url(../assets/img/liquid/oper.png) no-repeat;
  190. background-size: 227px 45px;
  191. .title {
  192. position: absolute;
  193. left: 22px;
  194. top: 12px;
  195. font-family: Source Han Sans CN;
  196. font-size: 14px;
  197. font-weight: normal;
  198. line-height: normal;
  199. letter-spacing: 0.1em;
  200. color: #0e0e0e;
  201. }
  202. .add_liquid_input {
  203. position: absolute;
  204. left: 113px;
  205. top: 11px;
  206. width: 40px;
  207. height: 20px;
  208. padding: 0;
  209. color: #0e0e0e;
  210. font-family: Source Han Sans CN;
  211. font-weight: 500;
  212. font-size: 14;
  213. }
  214. }
  215. .btn {
  216. width: 140px;
  217. height: 45px;
  218. border-radius: 23px;
  219. background: #f6f6f6;
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. font-family: Source Han Sans CN;
  224. font-size: 14px;
  225. font-weight: normal;
  226. line-height: normal;
  227. letter-spacing: 0.1em;
  228. color: #d8d8d8;
  229. }
  230. .mr {
  231. margin: 0 16px;
  232. }
  233. .active {
  234. background: #06518b;
  235. color: #fff;
  236. }
  237. }
  238. .add_liquid {
  239. position: absolute;
  240. left: 382px;
  241. top: 33px;
  242. display: flex;
  243. align-items: center;
  244. .text {
  245. margin-left: 16px;
  246. font-family: Source Han Sans CN;
  247. font-size: 26px;
  248. font-weight: normal;
  249. line-height: normal;
  250. letter-spacing: 0.06em;
  251. color: #ff9a2d;
  252. }
  253. }
  254. .chart {
  255. position: absolute;
  256. left: 310px;
  257. bottom: 23px;
  258. width: 600px;
  259. height: 452px;
  260. background: url(../assets/img/liquid/chart.png) no-repeat;
  261. background-size: 600px 452px;
  262. .liquid_column {
  263. position: absolute;
  264. left: 96px;
  265. bottom: 13px;
  266. width: 491px;
  267. height: var(--height);
  268. border-radius: 0px 12px 12px 0px;
  269. background: linear-gradient(0deg, #06518b 0%, rgba(6, 81, 139, 0.7) 58%);
  270. .indicator {
  271. position: absolute;
  272. top: -10px;
  273. right: -50px;
  274. font-family: Source Han Sans CN;
  275. font-size: 12px;
  276. font-weight: 500;
  277. line-height: normal;
  278. letter-spacing: 0.06em;
  279. color: #06518b;
  280. }
  281. }
  282. }
  283. }
  284. </style>