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

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