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.

529 lines
15 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <script setup lang="ts">
  2. import { ElMessageBox } from 'element-plus'
  3. import { FtMessage } from 'libs/message'
  4. import { sendControl } from 'libs/utils'
  5. import { useSystemStore } from 'stores/useSystemStore'
  6. import { computed, h, ref } from 'vue'
  7. import { useRouter } from 'vue-router'
  8. const router = useRouter()
  9. const systemStore = useSystemStore() // 使用 systemStore
  10. const startWork = () => {
  11. ElMessageBox({
  12. title: '提示',
  13. message: h('div', null, [
  14. h('p', null, '请确认清洗/预充/除湿均已完成 '),
  15. h('p', null, '请确认外部氮气压力大于0.35Mpa'),
  16. ]),
  17. confirmButtonText: '确定',
  18. cancelButtonText: '取消',
  19. showCancelButton: true,
  20. showClose: false,
  21. }).then(() => {
  22. setTimeout(() => {
  23. router.push('/spray')
  24. }, 100)
  25. })
  26. }
  27. const humidity = ref()
  28. const slideTemperature = ref()
  29. const nozzleTemperature = ref()
  30. const speed = ref()
  31. const clearSpeed = ref()
  32. const slideStart = () => {
  33. if (!systemStore.systemSensor.slideTemperature) {
  34. FtMessage.error('未检测到当前温度')
  35. return
  36. }
  37. if (!slideTemperature.value) {
  38. FtMessage.error('请输入目标温度')
  39. return
  40. }
  41. if (slideTemperature.value > 100 || slideTemperature.value < 0) {
  42. FtMessage.error('温度参数有误')
  43. return
  44. }
  45. if (slideTemperature.value <= systemStore.systemSensor.slideTemperature) {
  46. FtMessage.info('当前不需要加热')
  47. return
  48. }
  49. ElMessageBox.confirm('载玻台即将开始加热', '提示', {
  50. confirmButtonText: '确定',
  51. cancelButtonText: '取消',
  52. showCancelButton: true,
  53. showClose: false,
  54. })
  55. .then(async () => {
  56. slideStartRef.value.setLoading(true)
  57. const params = {
  58. cmdCode: 'slide_plat_heat_start',
  59. cmdId: '',
  60. params: {
  61. temperature: slideTemperature.value,
  62. },
  63. }
  64. await sendControl(params)
  65. systemStore.updateSlideTemperature(slideTemperature.value)
  66. slideStartRef.value.setLoading(false)
  67. })
  68. .catch(() => {
  69. FtMessage.error('取消加热')
  70. })
  71. }
  72. const nozzleStart = () => {
  73. if (!systemStore.systemSensor.nozzleTemperature) {
  74. FtMessage.error('未检测到当前温度')
  75. return
  76. }
  77. if (!nozzleTemperature.value) {
  78. FtMessage.error('请输入目标温度')
  79. return
  80. }
  81. if (nozzleTemperature.value > 100 || nozzleTemperature.value < 0) {
  82. FtMessage.error('温度参数有误')
  83. return
  84. }
  85. if (nozzleTemperature.value <= systemStore.systemSensor.nozzleTemperature) {
  86. FtMessage.info('当前不需要加热')
  87. return
  88. }
  89. ElMessageBox.confirm('即将开始加热', '提示', {
  90. confirmButtonText: '确定',
  91. cancelButtonText: '取消',
  92. showCancelButton: true,
  93. showClose: false,
  94. })
  95. .then(async () => {
  96. nozzleStartRef.value.setLoading(true)
  97. const params = {
  98. cmdCode: 'nozzle_heat_start',
  99. cmdId: '',
  100. params: {
  101. temperature: nozzleTemperature.value,
  102. },
  103. }
  104. await sendControl(params)
  105. systemStore.updateTargetNozzleTemperature(nozzleTemperature.value)
  106. nozzleStartRef.value.setLoading(false)
  107. })
  108. .catch(() => {
  109. FtMessage.error('取消加热')
  110. })
  111. }
  112. const slideStartRef = ref()
  113. const nozzleStartRef = ref()
  114. const dehumidifierStartRef = ref()
  115. const dehumidifierStart = () => {
  116. if (!systemStore.systemSensor.humidity) {
  117. FtMessage.error('未检测到当前湿度')
  118. return
  119. }
  120. if (!humidity.value) {
  121. FtMessage.error('请输入目标湿度')
  122. return
  123. }
  124. if (humidity.value > 100 || humidity.value < 0) {
  125. FtMessage.error('湿度参数有误')
  126. return
  127. }
  128. if (humidity.value >= systemStore.systemSensor.humidity) {
  129. FtMessage.info('当前不需要除湿')
  130. return
  131. }
  132. ElMessageBox.confirm('即将开始除湿,请确认关闭注射泵门和玻片托盘出口门', '提示', {
  133. confirmButtonText: '确定',
  134. cancelButtonText: '取消',
  135. showCancelButton: true,
  136. showClose: false,
  137. })
  138. .then(async () => {
  139. dehumidifierStartRef.value.setLoading(true)
  140. const params = {
  141. cmdCode: 'dehumidifier_start',
  142. cmdId: '',
  143. params: {
  144. humidity: humidity.value,
  145. },
  146. }
  147. await sendControl(params)
  148. systemStore.updateTargetHumidity(humidity.value)
  149. dehumidifierStartRef.value.setLoading(false)
  150. })
  151. .catch(() => {
  152. FtMessage.error('取消除湿')
  153. })
  154. }
  155. const cleanRemainingTime = computed(() => systemStore.cleanRemainingTime)
  156. const syringePipelineWashRef = ref()
  157. const syringePipelineWash = async () => {
  158. if (!clearSpeed.value) {
  159. FtMessage.error('请输入清洗速度')
  160. return
  161. }
  162. if (clearSpeed.value > 100) {
  163. FtMessage.error('清洗速度最大为100 uL/min')
  164. return
  165. }
  166. ElMessageBox({
  167. title: '提示',
  168. message: h('div', null, [h('p', null, '请检查废液瓶是否已满 '), h('p', null, '请检查设备内是否有异物')]),
  169. confirmButtonText: '确定',
  170. cancelButtonText: '取消',
  171. showCancelButton: true,
  172. showClose: false,
  173. })
  174. .then(async () => {
  175. syringePipelineWashRef.value.setLoading(true)
  176. const params = {
  177. cmdCode: 'syringe_pipeline_wash',
  178. cmdId: '',
  179. params: {
  180. speed: clearSpeed.value,
  181. },
  182. }
  183. console.log('sendControl', params)
  184. await sendControl(params)
  185. syringePipelineWashRef.value.setLoading(false)
  186. systemStore.startCleanTimer()
  187. })
  188. .catch(() => {
  189. FtMessage.error('取消清洗')
  190. systemStore.stopCleanTimer()
  191. })
  192. }
  193. const nozzlePipelineWashRef = ref()
  194. const nozzlePipelineWash = () => {
  195. if (!clearSpeed.value) {
  196. FtMessage.error('请输入清洗速度')
  197. return
  198. }
  199. if (clearSpeed.value > 100) {
  200. FtMessage.error('清洗速度最大为100 uL/min')
  201. return
  202. }
  203. ElMessageBox({
  204. title: '提示',
  205. message: h('div', null, [h('p', null, '请检查废液瓶是否已满 '), h('p', null, '请检查设备内是否有异物')]),
  206. confirmButtonText: '确定',
  207. cancelButtonText: '取消',
  208. showCancelButton: true,
  209. showClose: false,
  210. }).then(async () => {
  211. nozzlePipelineWashRef.value.setLoading(true)
  212. const params = {
  213. cmdCode: 'nozzle_pipeline_wash',
  214. cmdId: '',
  215. params: {
  216. speed: clearSpeed.value,
  217. },
  218. }
  219. try {
  220. await sendControl(params)
  221. }
  222. finally {
  223. nozzlePipelineWashRef.value.setLoading(false)
  224. }
  225. })
  226. }
  227. console.log(nozzlePipelineWash)
  228. const preRemainingTime = computed(() => systemStore.preRemainingTime)
  229. const matrixPrefillRef = ref()
  230. const matrixPrefill = () => {
  231. if (!speed.value) {
  232. FtMessage.error('请输入预充速度')
  233. return
  234. }
  235. if (speed.value > 100) {
  236. FtMessage.error('预充速度最大为100 uL/min')
  237. return
  238. }
  239. ElMessageBox({
  240. title: '提示',
  241. message: h('div', null, [h('p', null, '请检查废液瓶是否已满 '), h('p', null, '请检查设备内是否有异物')]),
  242. confirmButtonText: '确定',
  243. cancelButtonText: '取消',
  244. showCancelButton: true,
  245. showClose: false,
  246. })
  247. .then(async () => {
  248. matrixPrefillRef.value.setLoading(true)
  249. const params = {
  250. cmdCode: 'matrix_prefill',
  251. cmdId: '',
  252. params: {
  253. speed: speed.value,
  254. },
  255. }
  256. systemStore.startPreTimer()
  257. await sendControl(params)
  258. matrixPrefillRef.value.setLoading(false)
  259. })
  260. .catch(() => {
  261. FtMessage.error('取消预充')
  262. systemStore.stopPreTimer()
  263. })
  264. }
  265. const pipelineWashStop = async () => {
  266. const params = {
  267. cmdCode: 'syringe_pipeline_wash_stop',
  268. cmdId: '',
  269. }
  270. systemStore.stopCleanTimer()
  271. await sendControl(params)
  272. }
  273. const matrixPrefillStop = async () => {
  274. const params = {
  275. cmdCode: 'matrix_prefill_stop',
  276. cmdId: '',
  277. }
  278. systemStore.stopPreTimer()
  279. await sendControl(params)
  280. }
  281. const dehumidifierStop = async () => {
  282. const params = {
  283. cmdCode: 'dehumidifier_stop',
  284. cmdId: '',
  285. }
  286. await sendControl(params)
  287. }
  288. const slideStop = async () => {
  289. const params = {
  290. cmdCode: 'slide_plat_heat_stop',
  291. cmdId: '',
  292. }
  293. await sendControl(params)
  294. }
  295. const nozzleStop = async () => {
  296. const params = {
  297. cmdCode: 'nozzle_heat_stop',
  298. cmdId: '',
  299. }
  300. await sendControl(params)
  301. }
  302. </script>
  303. <template>
  304. <div>
  305. <el-card>
  306. <template #header>
  307. <div class="card-header">
  308. <div class="num-box">
  309. 1
  310. </div>
  311. <span> 清洗管道</span>
  312. </div>
  313. </template>
  314. <div style="display: flex; align-items: center; margin-top: 10px">
  315. <div style="display: flex; align-items: center; width: fit-content; margin-right: 30px">
  316. <span>清洗速度</span>
  317. <el-input v-model="clearSpeed" type="number" style="width: 100px; margin: 0 10px" />
  318. <span>uL/min</span>
  319. </div>
  320. <ft-button
  321. ref="syringePipelineWashRef"
  322. type="primary"
  323. :click-handle="syringePipelineWash"
  324. :disabled="
  325. systemStore.systemStatus.spraying
  326. || systemStore.systemStatus.cleaningSyringePipeline
  327. || systemStore.systemStatus.cleaningNozzlePipeline
  328. || systemStore.systemStatus.prefilling
  329. "
  330. >
  331. 清洗注射器管路
  332. </ft-button>
  333. <!-- <ft-button -->
  334. <!-- ref="nozzlePipelineWashRef" type="primary" :click-handle="nozzlePipelineWash" :disabled="systemStore.systemStatus.spraying -->
  335. <!-- || systemStore.systemStatus.cleaningSyringePipeline -->
  336. <!-- || systemStore.systemStatus.cleaningNozzlePipeline -->
  337. <!-- || systemStore.systemStatus.prefilling" -->
  338. <!-- > -->
  339. <!-- 清洗喷嘴管路 -->
  340. <!-- </ft-button> -->
  341. <ft-button
  342. :click-handle="pipelineWashStop"
  343. :disabled="
  344. !systemStore.systemStatus.cleaningSyringePipeline && !systemStore.systemStatus.cleaningNozzlePipeline
  345. "
  346. >
  347. 停止清洗
  348. </ft-button>
  349. <span> 清洗计时 {{ cleanRemainingTime }}</span>
  350. </div>
  351. </el-card>
  352. <el-card>
  353. <template #header>
  354. <div class="card-header">
  355. <div class="num-box">
  356. 2
  357. </div>
  358. <span> 预充管道</span>
  359. </div>
  360. </template>
  361. <div style="display: flex; align-items: center; margin-top: 10px">
  362. <div style="display: flex; align-items: center; width: fit-content; margin-right: 30px">
  363. <span>预充速度</span>
  364. <el-input v-model="speed" type="number" style="width: 100px; margin: 0 10px" />
  365. <span>uL/min</span>
  366. </div>
  367. <ft-button
  368. ref="matrixPrefillRef"
  369. type="primary"
  370. :click-handle="matrixPrefill"
  371. :disabled="
  372. systemStore.systemStatus.spraying
  373. || systemStore.systemStatus.cleaningSyringePipeline
  374. || systemStore.systemStatus.cleaningNozzlePipeline
  375. || systemStore.systemStatus.prefilling
  376. "
  377. >
  378. 开始预充
  379. </ft-button>
  380. <ft-button :click-handle="matrixPrefillStop" :disabled="!systemStore.systemStatus.prefilling">
  381. 结束预充
  382. </ft-button>
  383. <span> 预充计时 {{ preRemainingTime }}</span>
  384. </div>
  385. </el-card>
  386. <el-card>
  387. <template #header>
  388. <div class="card-header">
  389. <div class="num-box">
  390. 3
  391. </div>
  392. <span> 环境设置</span>
  393. </div>
  394. </template>
  395. <div style="display: flex; align-items: center; margin-top: 10px">
  396. <div style="display: flex; align-items: center; width: 20%; margin-right: 30px">
  397. <span>当前湿度</span>
  398. <span class="num-text">{{ systemStore.systemSensor.humidity }}</span>
  399. <span>%RH</span>
  400. </div>
  401. <div style="display: flex; align-items: center; width: 30%; margin-right: 30px">
  402. <span>要求湿度</span>
  403. <el-input v-model="humidity" type="number" style="width: 100px; margin: 0 10px" />
  404. <span>%RH</span>
  405. </div>
  406. <ft-button ref="dehumidifierStartRef" type="primary" :click-handle="dehumidifierStart">
  407. 开始除湿
  408. </ft-button>
  409. <ft-button :click-handle="dehumidifierStop" :disabled="!systemStore.systemStatus.dehumidifierRunning">
  410. 停止除湿
  411. </ft-button>
  412. </div>
  413. <div style="display: flex; align-items: center; margin-top: 10px">
  414. <div style="display: flex; align-items: center; width:20%; margin-right: 30px">
  415. <span>载玻台温度</span>
  416. <span class="num-text">{{ systemStore.systemSensor.slideTemperature }}</span>
  417. <span></span>
  418. </div>
  419. <div style="display: flex; align-items: center; width: 30%; margin-right: 30px">
  420. <span>要求温度</span>
  421. <el-input v-model="slideTemperature" type="number" style="width: 100px; margin: 0 10px" />
  422. <span></span>
  423. </div>
  424. <ft-button ref="slideStartRef" type="primary" :click-handle="slideStart">
  425. 开始加热
  426. </ft-button>
  427. <ft-button :click-handle="slideStop" :disabled="!systemStore.systemStatus.slidePlatHeating">
  428. 停止加热
  429. </ft-button>
  430. </div>
  431. <div style="display: flex; align-items: center; margin-top: 10px">
  432. <div style="display: flex; align-items: center; width: 20%; margin-right: 30px">
  433. <span>喷头温度</span>
  434. <span class="num-text">{{ systemStore.systemSensor.nozzleTemperature }}</span>
  435. <span></span>
  436. </div>
  437. <div style="display: flex; align-items: center; width: 30%; margin-right: 30px">
  438. <span>要求温度</span>
  439. <el-input v-model="nozzleTemperature" type="number" style="width: 100px; margin: 0 10px" />
  440. <span></span>
  441. </div>
  442. <ft-button ref="nozzleStartRef" type="primary" :click-handle="nozzleStart">
  443. 开始加热
  444. </ft-button>
  445. <ft-button :click-handle="nozzleStop" :disabled="!systemStore.systemStatus.nozzleHeating">
  446. 停止加热
  447. </ft-button>
  448. </div>
  449. </el-card>
  450. <div class="button-footer">
  451. <ft-button type="primary" class="set-button" @click="startWork">
  452. 喷涂参数设置
  453. </ft-button>
  454. </div>
  455. </div>
  456. </template>
  457. <style scoped lang="scss">
  458. .el-card {
  459. margin: 30px;
  460. color: var(--el-color-primary);
  461. border-radius: 20px;
  462. }
  463. :deep(.el-card__body) {
  464. padding: 40px;
  465. }
  466. .card-header {
  467. display: flex;
  468. align-items: center;
  469. }
  470. .num-box {
  471. margin: 0 20px;
  472. width: 50px;
  473. height: 50px;
  474. border-radius: 50%;
  475. background: var(--el-color-primary);
  476. font-size: 30px;
  477. color: #ffffff;
  478. display: flex;
  479. justify-content: center;
  480. align-items: center;
  481. }
  482. .button-footer {
  483. display: flex;
  484. justify-content: center;
  485. margin: 50px;
  486. }
  487. .hint-text {
  488. display: flex;
  489. height: 400px;
  490. flex-direction: column;
  491. justify-content: center;
  492. align-items: center;
  493. font-size: 50px;
  494. color: var(--el-color-primary);
  495. }
  496. .num-text {
  497. color: var(--el-color-primary);
  498. font-weight: 900;
  499. font-size: 70px;
  500. }
  501. :deep(.set-button) {
  502. margin-top: 50px;
  503. .my-button {
  504. width: 500px;
  505. height: 150px;
  506. display: flex;
  507. font-size: 50px;
  508. justify-content: center;
  509. }
  510. }
  511. </style>