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

613 lines
16 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
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
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="test_container">
  3. <div class="common_set switch_wrap">
  4. <p class="title">加液蠕动泵</p>
  5. <div class="num">
  6. <van-field
  7. type="number"
  8. v-model="addLiquidVal"
  9. :clickable="true"
  10. :formatter="formatter6"
  11. readonly
  12. @click.stop="hideAllKeyboards(1)"
  13. class="add_liquid_input"
  14. />
  15. <p>g/min</p>
  16. </div>
  17. <div class="btn_wrap">
  18. <div
  19. :class="
  20. settingStore.chargingPumpRPM > 0
  21. ? 'open success style-btn mg'
  22. : 'open style-btn mg'
  23. "
  24. @click="setAddLiquidConfig(1)"
  25. >
  26. 正转
  27. </div>
  28. <div
  29. :class="
  30. settingStore.chargingPumpRPM < 0
  31. ? 'open success style-btn'
  32. : 'open style-btn'
  33. "
  34. @click="setAddLiquidConfig(5)"
  35. >
  36. 反转
  37. </div>
  38. </div>
  39. <div class="btn_wrap">
  40. <div class="open style-btn mg" @click="setAddLiquidConfig(1)">打开</div>
  41. <div class="open style-btn" @click="setAddLiquidConfig(3)">关闭</div>
  42. </div>
  43. </div>
  44. <div class="common_set switch_wrap">
  45. <p class="title">注射蠕动泵</p>
  46. <div class="num">
  47. <van-field
  48. type="number"
  49. :formatter="formatter7"
  50. v-model="addLiquidVal2"
  51. :clickable="true"
  52. readonly
  53. @click.stop="hideAllKeyboards(3)"
  54. class="add_liquid_input"
  55. />
  56. <p>g/min</p>
  57. </div>
  58. <div class="btn_wrap">
  59. <div
  60. :class="
  61. settingStore.sprinklerPumpRPM > 0
  62. ? 'open success style-btn mg'
  63. : 'open style-btn mg'
  64. "
  65. @click="setAddLiquidConfig(2)"
  66. >
  67. 正转
  68. </div>
  69. <div
  70. :class="
  71. settingStore.sprinklerPumpRPM < 0
  72. ? 'open success style-btn'
  73. : 'open style-btn'
  74. "
  75. @click="setAddLiquidConfig(6)"
  76. >
  77. 反转
  78. </div>
  79. </div>
  80. <div class="btn_wrap">
  81. <div class="open style-btn mg" @click="setAddLiquidConfig(2)">打开</div>
  82. <div class="open style-btn" @click="setAddLiquidConfig(4)">关闭</div>
  83. </div>
  84. </div>
  85. <div class="common_set switch_wrap">
  86. <p class="title">空压机</p>
  87. <p class="num">
  88. {{
  89. testStore?.airCompressorObj?.currentVal > 5000
  90. ? 5000
  91. : testStore?.airCompressorObj?.currentVal
  92. }}
  93. A
  94. </p>
  95. <div class="btn_wrap">
  96. <div
  97. :class="
  98. testStore.airCompressor ? 'open style-btn mg' : 'close style-btn mg'
  99. "
  100. @click="changeAirStatus(1)"
  101. >
  102. 打开
  103. </div>
  104. <div
  105. :class="
  106. !testStore.airCompressor ? 'open style-btn' : 'close style-btn'
  107. "
  108. @click="changeAirStatus(2)"
  109. >
  110. 关闭
  111. </div>
  112. </div>
  113. </div>
  114. <div class="common_set switch_wrap">
  115. <p class="title">风机</p>
  116. <p class="num">{{ testStore?.airBlowerObj?.currentVal }} A</p>
  117. <div class="btn_wrap">
  118. <div
  119. :class="
  120. testStore.draughtFan ? 'open style-btn mg' : 'close style-btn mg'
  121. "
  122. @click="changeDraughtStatus(1)"
  123. >
  124. 打开
  125. </div>
  126. <div
  127. :class="!testStore.draughtFan ? 'open style-btn ' : 'close style-btn'"
  128. @click="changeDraughtStatus(2)"
  129. >
  130. 关闭
  131. </div>
  132. </div>
  133. </div>
  134. <div class="common_set switch_wrap">
  135. <p class="title">加热片</p>
  136. <p class="num">{{ testStore?.heatingStripObj?.currentVal }} A</p>
  137. <div class="btn_wrap">
  138. <div
  139. :class="
  140. testStore.heatingStrip ? 'open style-btn mg' : 'close style-btn mg'
  141. "
  142. @click="changeHeatingStatus(1)"
  143. >
  144. 打开
  145. </div>
  146. <div
  147. :class="
  148. !testStore.heatingStrip ? 'open style-btn' : 'close style-btn'
  149. "
  150. @click="changeHeatingStatus(2)"
  151. >
  152. 关闭
  153. </div>
  154. </div>
  155. </div>
  156. <div class="common_set update_wrap">
  157. <p class="title">水浸1</p>
  158. <p class="num">{{ testStore.waterImmersionSensor1 ? '有水' : '没水' }}</p>
  159. <div class="btn_wrap style-btn" @click="handleUpdate" style="opacity: 0">
  160. 更新读取水浸状态
  161. </div>
  162. </div>
  163. <div class="common_set update_wrap">
  164. <p class="title">水浸2</p>
  165. <p class="num">{{ testStore.waterImmersionSensor2 ? '有水' : '没水' }}</p>
  166. <div class="btn_wrap style-btn" @click="handleUpdate" style="opacity: 0">
  167. 更新读取水浸状态
  168. </div>
  169. </div>
  170. <div class="common_set update_wrap">
  171. <p class="title">液位</p>
  172. <p class="num">
  173. {{
  174. deviceStore.disinfectantCapacity <= 0
  175. ? 0
  176. : deviceStore.disinfectantCapacity
  177. }}
  178. kPa/100g
  179. </p>
  180. <div class="btn_wrap style-btn" @click="handleUpdate" style="opacity: 0">
  181. 更新读取液位状态
  182. </div>
  183. </div>
  184. <div class="common_set info_wrap">
  185. <p class="title">仓内</p>
  186. <p class="info">温度 {{ deviceStore.binTemperature }} </p>
  187. <p class="info">湿度 {{ deviceStore.binHumidity }} </p>
  188. <p class="info">过氧化氢浓度 {{ deviceStore.binHP }} PPM</p>
  189. </div>
  190. <div class="common_set info_wrap">
  191. <p class="title">环境1</p>
  192. <p class="info">温度 {{ deviceStore.envirTemperature1 }} </p>
  193. <p class="info">湿度 {{ deviceStore.envirHumidity1 }} </p>
  194. <p class="info">过氧化氢浓度 {{ deviceStore.envirHP1 }} PPM</p>
  195. </div>
  196. <div class="common_set info_wrap">
  197. <p class="title">环境2</p>
  198. <p class="info">温度 {{ deviceStore.envirTemperature2 }} </p>
  199. <p class="info">湿度 {{ deviceStore.envirHumidity2 }} </p>
  200. <p class="info">过氧化氢浓度 {{ deviceStore.envirHP2 }} PPM</p>
  201. </div>
  202. <van-number-keyboard
  203. v-model="addLiquidVal"
  204. @input="val => handleInput(val, 1)"
  205. :show="numberKeyboardShowVal"
  206. @blur="numberKeyboardShowVal = false"
  207. />
  208. <van-number-keyboard
  209. @input="val => handleInput(val, 2)"
  210. v-model="addLiquidPower"
  211. :show="numberKeyboardShowPower"
  212. @blur="numberKeyboardShowPower = false"
  213. />
  214. <van-number-keyboard
  215. @input="val => handleInput(val, 3)"
  216. v-model="addLiquidVal2"
  217. :show="numberKeyboardShowVal2"
  218. @blur="numberKeyboardShowVal2 = false"
  219. />
  220. <van-number-keyboard
  221. @input="val => handleInput(val, 4)"
  222. v-model="addLiquidPower2"
  223. :show="numberKeyboardShowPower2"
  224. @blur="numberKeyboardShowPower2 = false"
  225. />
  226. </div>
  227. </template>
  228. <script setup>
  229. import { ref } from 'vue'
  230. import {
  231. useTestStore,
  232. useDeviceStore,
  233. useWebSocketStore,
  234. useSettingStore,
  235. } from '@/store'
  236. import {
  237. someAirSwitchJSON,
  238. liquidpumpctrlJSON,
  239. getStateJSON,
  240. addLiquidCtrlJSON,
  241. test_replenishingFluidsPumpCtrJSON,
  242. sprayLiquidPump_open_for_testJSON,
  243. } from '@/mock/command'
  244. import { showSuccessToast, showFailToast } from 'vant'
  245. const testStore = useTestStore()
  246. const deviceStore = useDeviceStore()
  247. const websocketStore = useWebSocketStore()
  248. const settingStore = useSettingStore()
  249. const addLiquidVal = ref(settingStore.addLiquidConfigVal)
  250. const addLiquidPower = ref(25)
  251. const numberKeyboardShowVal = ref(false)
  252. const numberKeyboardShowPower = ref(false)
  253. const addLiquidVal2 = ref(settingStore.sprayLiquidConfigVal)
  254. const addLiquidPower2 = ref(25)
  255. const numberKeyboardShowVal2 = ref(false)
  256. const numberKeyboardShowPower2 = ref(false)
  257. const formatter = value => {
  258. if (parseInt(value) > 31) {
  259. return '31'
  260. }
  261. return value
  262. }
  263. const formatter6 = value => {
  264. let arr = settingStore.allSettingList.filter(
  265. item => item.name == 'drainage_pump_speed',
  266. )
  267. if (arr && arr.length > 0) {
  268. if (parseInt(value) > 40) {
  269. return '40'
  270. }
  271. if (parseInt(value) < arr[0].val_lower_limit) {
  272. return arr[0].val_lower_limit + ''
  273. }
  274. }
  275. return value
  276. }
  277. const formatter7 = value => {
  278. let arr = settingStore.allSettingList.filter(
  279. item => item.name == 'injection_pump_speed',
  280. )
  281. if (arr && arr.length > 0) {
  282. if (parseInt(value) > 40) {
  283. return '40'
  284. }
  285. if (parseInt(value) < arr[0].val_lower_limit) {
  286. return arr[0].val_lower_limit + ''
  287. }
  288. }
  289. return value
  290. }
  291. const isFirstClick = ref(true)
  292. const hideAllKeyboards = flag => {
  293. isFirstClick.value = true
  294. if (flag == 1) {
  295. numberKeyboardShowVal.value = true
  296. numberKeyboardShowPower.value = false
  297. numberKeyboardShowVal2.value = false
  298. numberKeyboardShowPower2.value = false
  299. }
  300. if (flag == 2) {
  301. numberKeyboardShowPower.value = true
  302. numberKeyboardShowVal.value = false
  303. numberKeyboardShowVal2.value = false
  304. numberKeyboardShowPower2.value = false
  305. }
  306. if (flag == 3) {
  307. numberKeyboardShowVal2.value = true
  308. numberKeyboardShowPower.value = false
  309. numberKeyboardShowVal.value = false
  310. numberKeyboardShowPower2.value = false
  311. }
  312. if (flag == 4) {
  313. numberKeyboardShowPower2.value = true
  314. numberKeyboardShowPower.value = false
  315. numberKeyboardShowVal2.value = false
  316. numberKeyboardShowVal.value = false
  317. }
  318. }
  319. const handleInput = (value, index) => {
  320. if (isFirstClick.value) {
  321. if (index == 1) {
  322. setTimeout(() => {
  323. addLiquidVal.value = value + ''
  324. })
  325. }
  326. if (index == 2) {
  327. setTimeout(() => {
  328. addLiquidPower.value = value + ''
  329. })
  330. }
  331. if (index == 3) {
  332. setTimeout(() => {
  333. addLiquidVal2.value = value + ''
  334. })
  335. }
  336. if (index == 4) {
  337. setTimeout(() => {
  338. addLiquidPower2.value = value + ''
  339. })
  340. }
  341. isFirstClick.value = false
  342. }
  343. }
  344. const setAddLiquidConfig = flag => {
  345. if (flag == 1) {
  346. websocketStore.sendCommandMsg(
  347. // 正传
  348. test_replenishingFluidsPumpCtrJSON(1, addLiquidVal.value),
  349. )
  350. showSuccessToast('设置成功')
  351. } else if (flag == 2) {
  352. websocketStore.sendCommandMsg(
  353. sprayLiquidPump_open_for_testJSON(1, addLiquidVal2.value),
  354. )
  355. showSuccessToast('设置成功')
  356. } else if (flag == 3) {
  357. // 关闭
  358. websocketStore.sendCommandMsg(
  359. test_replenishingFluidsPumpCtrJSON(0, addLiquidVal.value),
  360. )
  361. showSuccessToast('关闭加液蠕动泵成功')
  362. } else if (flag == 5) {
  363. // 反转
  364. websocketStore.sendCommandMsg(
  365. test_replenishingFluidsPumpCtrJSON(-1, addLiquidVal.value),
  366. )
  367. showSuccessToast('设置成功')
  368. } else if (flag == 6) {
  369. websocketStore.sendCommandMsg(
  370. sprayLiquidPump_open_for_testJSON(-1, addLiquidVal2.value),
  371. )
  372. showSuccessToast('设置成功')
  373. } else {
  374. websocketStore.sendCommandMsg(
  375. sprayLiquidPump_open_for_testJSON(0, addLiquidVal2.value),
  376. )
  377. showSuccessToast('关闭注射蠕动泵成功')
  378. }
  379. }
  380. const handleUpdate = () => {
  381. websocketStore.sendCommandMsg(getStateJSON)
  382. }
  383. const changeFeedingStatus = flag => {
  384. if (flag == 1) {
  385. if (!testStore.feedingPeristalticPumpStatus) {
  386. // 发送打开指令
  387. websocketStore.sendCommandMsg(
  388. liquidpumpctrlJSON(1, settingStore.addLiquidConfigVal),
  389. )
  390. testStore.updateFeedingPeristalticPumpStatus(true)
  391. }
  392. } else {
  393. if (testStore.feedingPeristalticPumpStatus) {
  394. websocketStore.sendCommandMsg(liquidpumpctrlJSON(1, 0))
  395. testStore.updateFeedingPeristalticPumpStatus(false)
  396. }
  397. }
  398. }
  399. const changeSprayStatus = flag => {
  400. if (flag == 1) {
  401. if (!testStore.sprayPeristalticPump) {
  402. websocketStore.sendCommandMsg(
  403. liquidpumpctrlJSON(2, settingStore.sprayLiquidConfigVal),
  404. )
  405. testStore.updateSprayPeristalticPump(true)
  406. }
  407. } else {
  408. if (testStore.sprayPeristalticPump) {
  409. websocketStore.sendCommandMsg(liquidpumpctrlJSON(2, 0))
  410. testStore.updateSprayPeristalticPump(false)
  411. }
  412. }
  413. }
  414. const changeHeatingStatus = flag => {
  415. if (flag == 1) {
  416. if (!testStore.heatingStrip) {
  417. websocketStore.sendCommandMsg(someAirSwitchJSON(4, 1))
  418. websocketStore.sendCommandMsg(someAirSwitchJSON(5, 1))
  419. testStore.updateHeatingStrip(true)
  420. }
  421. } else {
  422. if (testStore.heatingStrip) {
  423. websocketStore.sendCommandMsg(someAirSwitchJSON(4, 0))
  424. websocketStore.sendCommandMsg(someAirSwitchJSON(5, 0))
  425. testStore.updateHeatingStrip(false)
  426. }
  427. }
  428. }
  429. const changeAirStatus = flag => {
  430. if (flag == 1) {
  431. if (!testStore.airCompressor) {
  432. websocketStore.sendCommandMsg(someAirSwitchJSON(0, 1))
  433. websocketStore.sendCommandMsg(someAirSwitchJSON(1, 1))
  434. testStore.updateAirCompressor(true)
  435. }
  436. } else {
  437. if (testStore.airCompressor) {
  438. websocketStore.sendCommandMsg(someAirSwitchJSON(0, 0))
  439. websocketStore.sendCommandMsg(someAirSwitchJSON(1, 0))
  440. testStore.updateAirCompressor(false)
  441. }
  442. }
  443. }
  444. const changeDraughtStatus = flag => {
  445. if (flag == 1) {
  446. if (!testStore.draughtFan) {
  447. websocketStore.sendCommandMsg(someAirSwitchJSON(2, 1))
  448. websocketStore.sendCommandMsg(someAirSwitchJSON(3, 1))
  449. testStore.updateDraughtFan(true)
  450. }
  451. } else {
  452. if (testStore.draughtFan) {
  453. websocketStore.sendCommandMsg(someAirSwitchJSON(2, 0))
  454. websocketStore.sendCommandMsg(someAirSwitchJSON(3, 0))
  455. testStore.updateDraughtFan(false)
  456. }
  457. }
  458. }
  459. </script>
  460. <style lang="scss" scoped>
  461. .test_container {
  462. margin-bottom: 19px;
  463. height: 580px;
  464. overflow: scroll;
  465. box-sizing: border-box;
  466. background: #ffffff;
  467. border-radius: 16px;
  468. padding: 20px;
  469. display: grid;
  470. row-gap: 20px;
  471. column-gap: 20px;
  472. grid-template-columns: repeat(2, 1fr);
  473. grid-template-rows: repeat(5, 1fr);
  474. padding-bottom: 20px;
  475. .common_set {
  476. width: 580px;
  477. height: 73px;
  478. box-sizing: border-box;
  479. border-radius: 14px;
  480. background: #f6f6f6;
  481. display: flex;
  482. align-items: center;
  483. .title {
  484. font-family: Source Han Sans CN;
  485. font-size: 20px;
  486. font-weight: 500;
  487. letter-spacing: 0.06em;
  488. color: #000000;
  489. width: 106px;
  490. }
  491. .num {
  492. font-family: Source Han Sans CN;
  493. font-size: 13px;
  494. font-weight: 500;
  495. letter-spacing: 0.1em;
  496. color: #000000;
  497. display: flex;
  498. align-items: center;
  499. margin-right: 4px;
  500. .add_liquid_input {
  501. width: 40px;
  502. margin-right: 2px;
  503. text-align: right;
  504. height: 24px;
  505. padding: 0;
  506. color: #0e0e0e;
  507. font-family: Source Han Sans CN;
  508. font-weight: 500;
  509. font-size: 14;
  510. }
  511. }
  512. }
  513. .switch_wrap {
  514. padding: 0 17px 0 17px;
  515. justify-content: space-between;
  516. .btn_wrap {
  517. display: flex;
  518. align-items: center;
  519. background: #ddd;
  520. padding: 6px;
  521. border-radius: 30px;
  522. .mg {
  523. margin-right: 6px;
  524. }
  525. .open {
  526. width: 67px;
  527. height: 35px;
  528. border-radius: 18px;
  529. background: #06518b;
  530. display: flex;
  531. align-items: center;
  532. justify-content: center;
  533. font-family: Source Han Sans CN;
  534. font-size: 14px;
  535. font-weight: 500;
  536. letter-spacing: 0.1em;
  537. color: #ffffff;
  538. }
  539. .success {
  540. background: #1ad66e;
  541. }
  542. .close {
  543. width: 67px;
  544. height: 35px;
  545. border-radius: 18px;
  546. background: #ffffff;
  547. display: flex;
  548. align-items: center;
  549. justify-content: center;
  550. font-family: Source Han Sans CN;
  551. font-size: 14px;
  552. font-weight: 500;
  553. letter-spacing: 0.1em;
  554. color: #d8d8d8;
  555. }
  556. }
  557. }
  558. .update_wrap {
  559. padding: 0 17px 0 17px;
  560. justify-content: space-between;
  561. .btn_wrap {
  562. width: 184px;
  563. height: 45px;
  564. border-radius: 23px;
  565. background: #06518b;
  566. display: flex;
  567. align-items: center;
  568. justify-content: center;
  569. font-family: Source Han Sans CN;
  570. font-size: 14px;
  571. font-weight: 500;
  572. letter-spacing: 0.1em;
  573. color: #ffffff;
  574. }
  575. }
  576. .info_wrap {
  577. padding: 0 32px 0 17px;
  578. justify-content: space-between;
  579. .title {
  580. font-family: Source Han Sans CN;
  581. font-size: 20px;
  582. font-weight: 500;
  583. letter-spacing: 0.06em;
  584. color: #000000;
  585. width: 57px;
  586. white-space: nowrap;
  587. }
  588. .info {
  589. font-family: Source Han Sans CN;
  590. font-size: 14px;
  591. font-weight: 500;
  592. letter-spacing: 0.1em;
  593. color: #06518b;
  594. }
  595. }
  596. }
  597. </style>