消毒机设备
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.

480 lines
12 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <script lang="ts" setup>
  2. import { sendCmd } from 'apis/system'
  3. import { roundNumber } from 'libs/utils'
  4. import { useDebugStore } from 'stores/debugStore'
  5. import { useHomeStore } from 'stores/homeStore'
  6. import { ref, watchEffect } from 'vue'
  7. const homeStore = useHomeStore()
  8. const debugStore = useDebugStore()
  9. const h2O2SensorData = ref<Home.DisplayrelyMgrParams[]>(homeStore.h2O2SensorData)
  10. const sprayPumpGpmValue = ref<number>(5)
  11. const airLeakDetectTestMode = ref<string>('disinfection')
  12. watchEffect(() => {
  13. const hdData = homeStore.h2O2SensorData
  14. if (hdData && hdData.length) {
  15. h2O2SensorData.value = [...hdData]
  16. }
  17. })
  18. // 加液
  19. const liquidFillingPumpDoLiquidFilling = async () => {
  20. const data = {
  21. className: 'TestPageCtrlService',
  22. fnName: 'liquidFillingPumpDoLiquidFilling',
  23. params: {},
  24. }
  25. await sendCmd(data)
  26. }
  27. // 排液
  28. const liquidFillingPumpDoLiquidDischarge = async () => {
  29. const data = {
  30. className: 'TestPageCtrlService',
  31. fnName: 'liquidFillingPumpDoLiquidDischarge',
  32. params: {},
  33. }
  34. sendCmd(data)
  35. }
  36. // 停止加液 或 排液。停止电机
  37. const liquidFillingPumpDoStop = () => {
  38. const data = {
  39. className: 'TestPageCtrlService',
  40. fnName: 'liquidFillingPumpDoStop',
  41. params: {},
  42. }
  43. sendCmd(data)
  44. }
  45. // 打开空压机
  46. const airCompressorDoOpen = () => {
  47. const data = {
  48. className: 'TestPageCtrlService',
  49. fnName: 'airCompressorDoOpen',
  50. params: {},
  51. }
  52. sendCmd(data)
  53. }
  54. // 关闭空压机
  55. const airCompressorDoClose = () => {
  56. const data = {
  57. className: 'TestPageCtrlService',
  58. fnName: 'airCompressorDoClose',
  59. params: {},
  60. }
  61. sendCmd(data)
  62. }
  63. // 打开加热
  64. const heatingDoOpen = () => {
  65. const data = {
  66. className: 'TestPageCtrlService',
  67. fnName: 'heatingDoOpen',
  68. params: {},
  69. }
  70. sendCmd(data)
  71. }
  72. // 关闭加热
  73. const heatingDoClose = () => {
  74. const data = {
  75. className: 'TestPageCtrlService',
  76. fnName: 'heatingDoClose',
  77. params: {},
  78. }
  79. sendCmd(data)
  80. }
  81. // 喷液泵控制 喷液(gpm)
  82. const sprayPumpDoForward = () => {
  83. const data = {
  84. className: 'TestPageCtrlService',
  85. fnName: 'sprayPumpDoForward',
  86. params: {
  87. gpm: sprayPumpGpmValue.value,
  88. },
  89. }
  90. sendCmd(data)
  91. }
  92. // 喷液泵控制 回流(gpm)
  93. const sprayPumpDoBackward = () => {
  94. const data = {
  95. className: 'TestPageCtrlService',
  96. fnName: 'sprayPumpDoBackward',
  97. params: {
  98. gpm: sprayPumpGpmValue.value,
  99. },
  100. }
  101. sendCmd(data)
  102. }
  103. // 喷液泵控制 停止
  104. const onClosePump = () => {
  105. const data = {
  106. className: 'TestPageCtrlService',
  107. fnName: 'sprayPumpDoStop',
  108. params: {},
  109. }
  110. sendCmd(data)
  111. }
  112. // 打开风机
  113. const blowerDoOpen = () => {
  114. const data = {
  115. className: 'TestPageCtrlService',
  116. fnName: 'blowerDoOpen',
  117. params: {},
  118. }
  119. sendCmd(data)
  120. }
  121. // 关闭风机
  122. const blowerDoClose = () => {
  123. const data = {
  124. className: 'TestPageCtrlService',
  125. fnName: 'blowerDoClose',
  126. params: {},
  127. }
  128. sendCmd(data)
  129. }
  130. // 气密性测试模式切换
  131. const airLeakDetectTestModeDoSetMode = () => {
  132. const data = {
  133. className: 'TestPageCtrlService',
  134. fnName: 'airLeakDetectTestModeDoSetMode',
  135. params: {
  136. mode: airLeakDetectTestMode.value,
  137. },
  138. }
  139. sendCmd(data)
  140. }
  141. // 打印测试
  142. const printerDoTest = () => {
  143. const data = {
  144. className: 'TestPageCtrlService',
  145. fnName: 'printerDoTest',
  146. params: {},
  147. }
  148. sendCmd(data)
  149. }
  150. </script>
  151. <template>
  152. <div class="dashboard-container">
  153. <main class="main-content">
  154. <!-- 上下布局 -->
  155. <section class="debug-env">
  156. <!-- 左侧HO 传感器数据 -->
  157. <div class="debug-env-left">
  158. <div
  159. v-for="(item, index) in h2O2SensorData"
  160. :key="index"
  161. class="debug-left-lh env-lh"
  162. >
  163. <div class="debug-env-content">
  164. <div class="debug-label env-content-p" style="text-align: right; width: 8rem">
  165. {{ index === 0 ? '仓内环境' : item.title || `探头${index}` }}
  166. </div>
  167. <div class="env-content-p">
  168. <span>温度</span>
  169. <span class="debug-text">{{ roundNumber(item.temp, 2) }}</span>°C
  170. </div>
  171. <div class="env-content-p">
  172. <span>湿度</span>
  173. <span class="debug-text">{{ roundNumber(item.rh, 2) }}</span>%RH
  174. </div>
  175. <div class="env-content-p">
  176. <span>HO浓度</span>
  177. <span class="debug-text">{{ roundNumber(item.h2o2, 2) }}</span>ppm
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. <!-- 右侧电机电流 & 加热温度 -->
  183. <div class="debug-env-right">
  184. <div class="env-content-p">
  185. <span class="label">空压机电流</span>
  186. <span class="value">
  187. <span class="debug-text">{{ debugStore.debugPageState?.airCompressorCurrent ?? 0 }}</span>
  188. <span class="unit">A</span>
  189. </span>
  190. </div>
  191. <div class="env-content-p">
  192. <span class="label">风机电流</span>
  193. <span class="value">
  194. <span class="debug-text">{{ debugStore.debugPageState?.blowerCurrent ?? 0 }}</span>
  195. <span class="unit">A</span>
  196. </span>
  197. </div>
  198. <div class="env-content-p">
  199. <span class="label">加热片电流</span>
  200. <span class="value">
  201. <span class="debug-text">{{ debugStore.debugPageState?.heaterCurrent ?? 0 }}</span>
  202. <span class="unit">A</span>
  203. </span>
  204. </div>
  205. <div class="env-content-p">
  206. <span class="label">加热片温度</span>
  207. <span class="value">
  208. <span class="debug-text">{{ debugStore.debugPageState?.heaterTemperature ?? 0 }}</span>
  209. <span class="unit"></span>
  210. </span>
  211. </div>
  212. </div>
  213. </section>
  214. <hr class="divider">
  215. <div class="debug-lower">
  216. <section>
  217. <div>
  218. <div class="debug-left-lh">
  219. <div class="debug-label">
  220. 加液泵控制
  221. </div>
  222. <div>
  223. <bt-button
  224. type="primary"
  225. button-text="加液"
  226. @click="liquidFillingPumpDoLiquidFilling"
  227. />
  228. </div>
  229. <div>
  230. <bt-button
  231. type="primary"
  232. button-text="排空"
  233. @click="liquidFillingPumpDoLiquidDischarge"
  234. />
  235. </div>
  236. <div>
  237. <bt-button
  238. button-text="停止"
  239. @click="liquidFillingPumpDoStop"
  240. />
  241. </div>
  242. </div>
  243. <div class="debug-left-lh">
  244. <div class="debug-label">
  245. 空压机控制
  246. </div>
  247. <div>
  248. <bt-button
  249. type="primary"
  250. button-text="打开"
  251. @click="airCompressorDoOpen"
  252. />
  253. </div>
  254. <div>
  255. <bt-button
  256. button-text="关闭"
  257. @click="airCompressorDoClose"
  258. />
  259. </div>
  260. </div>
  261. <div class="debug-left-lh">
  262. <div class="debug-label">
  263. 加热片控制
  264. </div>
  265. <div>
  266. <bt-button
  267. type="primary"
  268. button-text="打开"
  269. @click="heatingDoOpen"
  270. />
  271. </div>
  272. <div>
  273. <bt-button
  274. button-text="关闭"
  275. @click="heatingDoClose"
  276. />
  277. </div>
  278. </div>
  279. <div class="debug-left-lh">
  280. <div class="debug-label">
  281. 气密性阀门模式
  282. </div>
  283. <div class="debug-bw">
  284. <el-select v-model="airLeakDetectTestMode" placeholder="请选择模式" style="width: 100%;">
  285. <el-option label="消毒模式" value="disinfection" />
  286. <el-option label="加压模式" value="inflation" />
  287. <el-option label="泄露测试模式" value="leakTest" />
  288. </el-select>
  289. </div>
  290. <div>
  291. <bt-button
  292. type="primary"
  293. button-text="切换"
  294. @click="airLeakDetectTestModeDoSetMode"
  295. />
  296. </div>
  297. </div>
  298. </div>
  299. </section>
  300. <section class="debug-right">
  301. <div>
  302. <div class="debug-left-lh">
  303. <div class="debug-label">
  304. 喷液泵控制
  305. </div>
  306. <div class="debug-bw">
  307. <el-select v-model="sprayPumpGpmValue" placeholder="请选择加液量" style="width: 100%;">
  308. <el-option v-for="opt in [2, 5, 8, 10, 15]" :key="opt" :label="`${opt} gpm`" :value="opt" />
  309. </el-select>
  310. </div>
  311. <div>
  312. <bt-button
  313. type="primary"
  314. button-text="喷液"
  315. @click="sprayPumpDoForward"
  316. />
  317. </div>
  318. <div>
  319. <bt-button
  320. type="primary"
  321. button-text="回流"
  322. @click="sprayPumpDoBackward"
  323. />
  324. </div>
  325. <div>
  326. <bt-button
  327. button-text="停止"
  328. @click="onClosePump"
  329. />
  330. </div>
  331. </div>
  332. <div class="debug-left-lh">
  333. <div class="debug-label">
  334. 风机控制
  335. </div>
  336. <div>
  337. <bt-button
  338. type="primary"
  339. button-text="打开"
  340. @click="blowerDoOpen"
  341. />
  342. </div>
  343. <div>
  344. <bt-button
  345. button-text="关闭"
  346. @click="blowerDoClose"
  347. />
  348. </div>
  349. </div>
  350. <div class="debug-left-lh">
  351. <div class="debug-label">
  352. 打印机测试
  353. </div>
  354. <div>
  355. <bt-button
  356. type="primary"
  357. button-text="测试"
  358. @click="printerDoTest"
  359. />
  360. </div>
  361. </div>
  362. </div>
  363. </section>
  364. </div>
  365. </main>
  366. </div>
  367. </template>
  368. <style lang="scss" scoped>
  369. $lineHeight: 12vh;
  370. .main-content{
  371. height: $main-container-height;
  372. overflow: hidden;
  373. background: $gradient-color;
  374. padding: 4vh;
  375. font-size: 20px;
  376. .debug-upper{
  377. display: grid;
  378. grid-template-columns: repeat(2, 1fr);
  379. grid-template-rows: auto auto;
  380. }
  381. .debug-lower{
  382. display: grid;
  383. grid-template-columns: repeat(2,1fr);
  384. }
  385. .debug-left{
  386. .debug-inside{
  387. display: flex;
  388. gap: 1rem;
  389. }
  390. }
  391. }
  392. .divider{
  393. margin-top: 4vh;
  394. margin-bottom: 4vh;
  395. }
  396. .debug-env {
  397. display: flex;
  398. align-items: flex-start;
  399. }
  400. .debug-left-lh{
  401. display: flex;
  402. gap: 1rem;
  403. height: $lineHeight;
  404. .debug-env-content{
  405. display: flex;
  406. .env-content-p{
  407. padding: 5px;
  408. }
  409. }
  410. }
  411. .debug-env-right {
  412. display: flex;
  413. flex-direction: column;
  414. gap: 0.5rem;
  415. margin-left: 20rem;
  416. align-items: flex-start;
  417. }
  418. .env-content-p {
  419. display: flex;
  420. align-items: center;
  421. gap: 0.5rem;
  422. font-size: 1rem;
  423. }
  424. .debug-env-right .env-content-p {
  425. display: flex;
  426. align-items: center;
  427. }
  428. .debug-env-right .env-content-p .label {
  429. display: inline-block;
  430. width: 6.5rem; /* 根据最长文字“加热片电流”微调 */
  431. text-align: right;
  432. margin-right: 0.75rem;
  433. }
  434. .debug-env-right .env-content-p .value {
  435. display: flex;
  436. align-items: baseline;
  437. gap: 0.2rem;
  438. }
  439. .debug-env-right .env-content-p .debug-text {
  440. font-weight: bold;
  441. color: #2892F3;
  442. }
  443. .debug-env-right .env-content-p .unit {
  444. font-size: 0.9em;
  445. }
  446. .env-lh{
  447. height: 5vh;
  448. }
  449. .debug-bw{
  450. width: 10vw;
  451. }
  452. .debug-label{
  453. width: 18vw;
  454. text-align: end;
  455. }
  456. .debug-text{
  457. color: #2892F3;
  458. padding: 5px;
  459. }
  460. </style>