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

661 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
  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. kPa/100g
  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. return value
  312. }
  313. const formatter7 = value => {
  314. let arr = settingStore.allSettingList.filter(
  315. item => item.name == 'injection_pump_speed',
  316. )
  317. if (arr && arr.length > 0) {
  318. if (parseInt(value) > 40) {
  319. return '40'
  320. }
  321. if (parseInt(value) < arr[0].val_lower_limit) {
  322. return arr[0].val_lower_limit + ''
  323. }
  324. }
  325. return value
  326. }
  327. const isFirstClick = ref(true)
  328. const hideAllKeyboards = flag => {
  329. isFirstClick.value = true
  330. if (flag == 1) {
  331. numberKeyboardShowVal.value = true
  332. numberKeyboardShowPower.value = false
  333. numberKeyboardShowVal2.value = false
  334. numberKeyboardShowPower2.value = false
  335. }
  336. if (flag == 2) {
  337. numberKeyboardShowPower.value = true
  338. numberKeyboardShowVal.value = false
  339. numberKeyboardShowVal2.value = false
  340. numberKeyboardShowPower2.value = false
  341. }
  342. if (flag == 3) {
  343. numberKeyboardShowVal2.value = true
  344. numberKeyboardShowPower.value = false
  345. numberKeyboardShowVal.value = false
  346. numberKeyboardShowPower2.value = false
  347. }
  348. if (flag == 4) {
  349. numberKeyboardShowPower2.value = true
  350. numberKeyboardShowPower.value = false
  351. numberKeyboardShowVal2.value = false
  352. numberKeyboardShowVal.value = false
  353. }
  354. }
  355. const handleInput = (value, index) => {
  356. if (isFirstClick.value) {
  357. if (index == 1) {
  358. setTimeout(() => {
  359. addLiquidVal.value = value + ''
  360. })
  361. }
  362. if (index == 2) {
  363. setTimeout(() => {
  364. addLiquidPower.value = value + ''
  365. })
  366. }
  367. if (index == 3) {
  368. setTimeout(() => {
  369. addLiquidVal2.value = value + ''
  370. })
  371. }
  372. if (index == 4) {
  373. setTimeout(() => {
  374. addLiquidPower2.value = value + ''
  375. })
  376. }
  377. isFirstClick.value = false
  378. }
  379. }
  380. const setAddLiquidConfig = flag => {
  381. if (flag == 1) {
  382. if (settingStore.chargingPumpRPM == 0) {
  383. websocketStore.sendCommandMsg(
  384. // 正传
  385. test_replenishingFluidsPumpCtrJSON(1, addLiquidVal.value),
  386. )
  387. showSuccessToast('设置成功')
  388. return
  389. }
  390. } else if (flag == 2) {
  391. if (settingStore.sprinklerPumpRPM == 0) {
  392. websocketStore.sendCommandMsg(
  393. sprayLiquidPump_open_for_testJSON(1, addLiquidVal2.value),
  394. )
  395. showSuccessToast('设置成功')
  396. return
  397. }
  398. } else if (flag == 3) {
  399. // 关闭
  400. if (settingStore.chargingPumpRPM != 0) {
  401. websocketStore.sendCommandMsg(
  402. test_replenishingFluidsPumpCtrJSON(0, addLiquidVal.value),
  403. )
  404. showSuccessToast('关闭加液蠕动泵成功')
  405. return
  406. }
  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. if (settingStore.sprinklerPumpRPM != 0) {
  420. websocketStore.sendCommandMsg(
  421. sprayLiquidPump_open_for_testJSON(0, addLiquidVal2.value),
  422. )
  423. showSuccessToast('关闭注射蠕动泵成功')
  424. return
  425. }
  426. }
  427. }
  428. const handleUpdate = () => {
  429. websocketStore.sendCommandMsg(getStateJSON)
  430. }
  431. const changeFeedingStatus = flag => {
  432. if (flag == 1) {
  433. if (!testStore.feedingPeristalticPumpStatus) {
  434. // 发送打开指令
  435. websocketStore.sendCommandMsg(
  436. liquidpumpctrlJSON(1, settingStore.addLiquidConfigVal),
  437. )
  438. testStore.updateFeedingPeristalticPumpStatus(true)
  439. }
  440. } else {
  441. if (testStore.feedingPeristalticPumpStatus) {
  442. websocketStore.sendCommandMsg(liquidpumpctrlJSON(1, 0))
  443. testStore.updateFeedingPeristalticPumpStatus(false)
  444. }
  445. }
  446. }
  447. const changeSprayStatus = flag => {
  448. if (flag == 1) {
  449. if (!testStore.sprayPeristalticPump) {
  450. websocketStore.sendCommandMsg(
  451. liquidpumpctrlJSON(2, settingStore.sprayLiquidConfigVal),
  452. )
  453. testStore.updateSprayPeristalticPump(true)
  454. }
  455. } else {
  456. if (testStore.sprayPeristalticPump) {
  457. websocketStore.sendCommandMsg(liquidpumpctrlJSON(2, 0))
  458. testStore.updateSprayPeristalticPump(false)
  459. }
  460. }
  461. }
  462. const changeHeatingStatus = flag => {
  463. if (flag == 1) {
  464. if (!testStore.heatingStrip) {
  465. websocketStore.sendCommandMsg(someAirSwitchJSON(4, 1))
  466. websocketStore.sendCommandMsg(someAirSwitchJSON(5, 1))
  467. testStore.updateHeatingStrip(true)
  468. }
  469. } else {
  470. if (testStore.heatingStrip) {
  471. websocketStore.sendCommandMsg(someAirSwitchJSON(4, 0))
  472. websocketStore.sendCommandMsg(someAirSwitchJSON(5, 0))
  473. testStore.updateHeatingStrip(false)
  474. }
  475. }
  476. }
  477. const changeAirStatus = flag => {
  478. if (flag == 1) {
  479. if (!testStore.airCompressor) {
  480. websocketStore.sendCommandMsg(someAirSwitchJSON(0, 1))
  481. websocketStore.sendCommandMsg(someAirSwitchJSON(1, 1))
  482. testStore.updateAirCompressor(true)
  483. }
  484. } else {
  485. if (testStore.airCompressor) {
  486. websocketStore.sendCommandMsg(someAirSwitchJSON(0, 0))
  487. websocketStore.sendCommandMsg(someAirSwitchJSON(1, 0))
  488. testStore.updateAirCompressor(false)
  489. }
  490. }
  491. }
  492. const changeDraughtStatus = flag => {
  493. if (flag == 1) {
  494. if (!testStore.draughtFan) {
  495. websocketStore.sendCommandMsg(someAirSwitchJSON(2, 1))
  496. websocketStore.sendCommandMsg(someAirSwitchJSON(3, 1))
  497. testStore.updateDraughtFan(true)
  498. }
  499. } else {
  500. if (testStore.draughtFan) {
  501. websocketStore.sendCommandMsg(someAirSwitchJSON(2, 0))
  502. websocketStore.sendCommandMsg(someAirSwitchJSON(3, 0))
  503. testStore.updateDraughtFan(false)
  504. }
  505. }
  506. }
  507. </script>
  508. <style lang="scss" scoped>
  509. .test_container {
  510. margin-bottom: 19px;
  511. height: 580px;
  512. overflow: scroll;
  513. box-sizing: border-box;
  514. background: #ffffff;
  515. border-radius: 16px;
  516. padding: 20px;
  517. display: grid;
  518. row-gap: 20px;
  519. column-gap: 20px;
  520. grid-template-columns: repeat(2, 1fr);
  521. grid-template-rows: repeat(5, 1fr);
  522. padding-bottom: 20px;
  523. .common_set {
  524. width: 580px;
  525. height: 73px;
  526. box-sizing: border-box;
  527. border-radius: 14px;
  528. background: #f6f6f6;
  529. display: flex;
  530. align-items: center;
  531. .title {
  532. font-family: Source Han Sans CN;
  533. font-size: 20px;
  534. font-weight: 500;
  535. letter-spacing: 0.06em;
  536. color: #000000;
  537. width: 106px;
  538. }
  539. .num {
  540. font-family: Source Han Sans CN;
  541. font-size: 13px;
  542. font-weight: 500;
  543. letter-spacing: 0.1em;
  544. color: #000000;
  545. display: flex;
  546. align-items: center;
  547. margin-right: 4px;
  548. .add_liquid_input {
  549. width: 40px;
  550. margin-right: 2px;
  551. text-align: right;
  552. height: 24px;
  553. padding: 0;
  554. color: #0e0e0e;
  555. font-family: Source Han Sans CN;
  556. font-weight: 500;
  557. font-size: 14;
  558. }
  559. }
  560. }
  561. .switch_wrap {
  562. padding: 0 17px 0 17px;
  563. justify-content: space-between;
  564. .btn_wrap {
  565. display: flex;
  566. align-items: center;
  567. background: #ddd;
  568. padding: 6px;
  569. border-radius: 30px;
  570. .mg {
  571. margin-right: 6px;
  572. }
  573. .open {
  574. width: 67px;
  575. height: 35px;
  576. border-radius: 18px;
  577. background: #06518b;
  578. display: flex;
  579. align-items: center;
  580. justify-content: center;
  581. font-family: Source Han Sans CN;
  582. font-size: 14px;
  583. font-weight: 500;
  584. letter-spacing: 0.1em;
  585. color: #ffffff;
  586. }
  587. .success {
  588. background: #1ad66e;
  589. }
  590. .close {
  591. width: 67px;
  592. height: 35px;
  593. border-radius: 18px;
  594. background: #ffffff;
  595. display: flex;
  596. align-items: center;
  597. justify-content: center;
  598. font-family: Source Han Sans CN;
  599. font-size: 14px;
  600. font-weight: 500;
  601. letter-spacing: 0.1em;
  602. color: #d8d8d8;
  603. }
  604. }
  605. }
  606. .update_wrap {
  607. padding: 0 17px 0 17px;
  608. justify-content: space-between;
  609. .btn_wrap {
  610. width: 184px;
  611. height: 45px;
  612. border-radius: 23px;
  613. background: #06518b;
  614. display: flex;
  615. align-items: center;
  616. justify-content: center;
  617. font-family: Source Han Sans CN;
  618. font-size: 14px;
  619. font-weight: 500;
  620. letter-spacing: 0.1em;
  621. color: #ffffff;
  622. }
  623. }
  624. .info_wrap {
  625. padding: 0 32px 0 17px;
  626. justify-content: space-between;
  627. .title {
  628. font-family: Source Han Sans CN;
  629. font-size: 20px;
  630. font-weight: 500;
  631. letter-spacing: 0.06em;
  632. color: #000000;
  633. width: 57px;
  634. white-space: nowrap;
  635. }
  636. .info {
  637. font-family: Source Han Sans CN;
  638. font-size: 14px;
  639. font-weight: 500;
  640. letter-spacing: 0.1em;
  641. color: #06518b;
  642. }
  643. }
  644. }
  645. </style>