拉杆箱消毒机
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.

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