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

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