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.

132 lines
3.2 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
  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 { h, ref } from 'vue'
  6. const clearSpeed = ref()
  7. const syringePipelineWashRef = ref()
  8. const syringePipelineWash = () => {
  9. if (!clearSpeed.value) {
  10. FtMessage.error('请输入清洗速度')
  11. return
  12. }
  13. if (clearSpeed.value > 100) {
  14. FtMessage.error('清洗速度最大为100 uL/min')
  15. return
  16. }
  17. ElMessageBox({
  18. title: '提示',
  19. message: h('div', null, [
  20. h('p', null, '请检查废液瓶是否已满 '),
  21. h('p', null, '请检查设备内是否有异物'),
  22. ]),
  23. confirmButtonText: '确定',
  24. cancelButtonText: '取消',
  25. showCancelButton: true,
  26. showClose: false,
  27. }).then(async () => {
  28. syringePipelineWashRef.value.setLoading(true)
  29. const params = {
  30. cmdCode: 'syringe_pipeline_wash',
  31. cmdId: '',
  32. params: {
  33. speed: clearSpeed.value,
  34. },
  35. }
  36. try {
  37. await sendControl(params)
  38. }
  39. finally {
  40. syringePipelineWashRef.value.setLoading(false)
  41. }
  42. })
  43. }
  44. const nozzlePipelineWashRef = ref()
  45. const nozzlePipelineWash = () => {
  46. if (!clearSpeed.value) {
  47. FtMessage.error('请输入清洗速度')
  48. return
  49. }
  50. if (clearSpeed.value > 100) {
  51. FtMessage.error('清洗速度最大为100 uL/min')
  52. return
  53. }
  54. ElMessageBox({
  55. title: '提示',
  56. message: h('div', null, [
  57. h('p', null, '请检查废液瓶是否已满 '),
  58. h('p', null, '请检查设备内是否有异物'),
  59. ]),
  60. confirmButtonText: '确定',
  61. cancelButtonText: '取消',
  62. showCancelButton: true,
  63. showClose: false,
  64. }).then(async () => {
  65. nozzlePipelineWashRef.value.setLoading(true)
  66. const params = {
  67. cmdCode: 'nozzle_pipeline_wash',
  68. cmdId: '',
  69. params: {
  70. speed: clearSpeed.value,
  71. },
  72. }
  73. try {
  74. await sendControl(params)
  75. }
  76. finally {
  77. nozzlePipelineWashRef.value.setLoading(false)
  78. }
  79. })
  80. }
  81. const syringePipelineWashStop = async () => {
  82. const params = {
  83. cmdCode: 'syringe_pipeline_wash_stop',
  84. cmdId: '',
  85. params: {},
  86. }
  87. await sendControl(params)
  88. }
  89. </script>
  90. <template>
  91. <div class="clear-main">
  92. <div style="display: flex;align-items: center;width: fit-content;margin: 20px">
  93. <span>清洗速度</span>
  94. <el-input v-model="clearSpeed" type="number" style="width: 100px;margin:0 10px" />
  95. <span>uL/min</span>
  96. </div>
  97. <ft-button ref="syringePipelineWashRef" class="button-style" type="primary" @click="syringePipelineWash">
  98. 清洗注射器管路
  99. </ft-button>
  100. <ft-button ref="nozzlePipelineWashRef" class="button-style" type="primary" @click="nozzlePipelineWash">
  101. 清洗喷嘴管路
  102. </ft-button>
  103. <ft-button class="button-style" :click-handle="syringePipelineWashStop">
  104. 结束清洗
  105. </ft-button>
  106. </div>
  107. </template>
  108. <style scoped lang="scss">
  109. .clear-main {
  110. display: flex;
  111. flex-direction: column;
  112. justify-content: center;
  113. align-items: center;
  114. color: var(--el-color-primary);
  115. .ft-button {
  116. margin: 30px;
  117. }
  118. }
  119. :deep(.button-style) {
  120. .my-button {
  121. width: 500px;
  122. display: flex;
  123. justify-content: center;
  124. }
  125. }
  126. </style>