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.

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