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

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