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

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