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

133 lines
3.6 KiB

3 weeks ago
3 weeks ago
  1. <script lang="ts" setup>
  2. // import homeRound from 'assets/images/home/home-round.svg'
  3. import { useHomeStore } from 'stores/homeStore'
  4. import { ref, watchEffect } from 'vue'
  5. import { useFormulaStore } from '@/stores/formulaStore'
  6. const formulaStore = useFormulaStore()
  7. const homeStore = useHomeStore()
  8. const formulaInfo = ref()
  9. const rate = ref()
  10. const log = ref()
  11. watchEffect(async () => {
  12. if (['idle', 'finished'].includes(homeStore.disinfectionState.state)) {
  13. formulaInfo.value = formulaStore.selectedFormulaInfo
  14. rate.value = formulaStore.selectedFormulaInfo?.injection_pump_speed
  15. log.value = formulaStore.selectedFormulaInfo?.loglevel
  16. }
  17. else {
  18. const realForm = (await formulaStore.getRealtimeConfig()).rely
  19. rate.value = homeStore.realRate || realForm?.injection_pump_speed
  20. log.value = homeStore.realLog || realForm?.loglevel
  21. }
  22. })
  23. </script>
  24. <template>
  25. <div class="home-right-title">
  26. <el-descriptions :column="1">
  27. <el-descriptions-item label="配方">
  28. <el-tooltip :content="formulaInfo?.name || '默认'" placement="bottom-start">
  29. <div class="text">
  30. {{ formulaInfo?.name || '默认' }}
  31. </div>
  32. </el-tooltip>
  33. </el-descriptions-item>
  34. <!-- <el-descriptions-item label="设定注射速率"> -->
  35. <!-- <el-tag> -->
  36. <!-- <span style="color: #31cb7a; font-size: 18px; margin: 0 5px">{{ rate }}</span>g/min -->
  37. <!-- </el-tag> -->
  38. <!-- </el-descriptions-item> -->
  39. <el-descriptions-item label="实时注射速率">
  40. <el-tag>
  41. <span style="color: #31cb7a; font-size: 18px; margin: 0 5px">{{
  42. homeStore.disinfectionState.injectedVelocity
  43. }}</span>g/min
  44. </el-tag>
  45. </el-descriptions-item>
  46. <el-descriptions-item label="目标消毒等级">
  47. <el-tag>
  48. <span style="color: #31cb7a; font-size: 18px; margin: 0 5px">{{ log }}</span>Log
  49. </el-tag>
  50. </el-descriptions-item>
  51. <el-descriptions-item label="实时消毒等级">
  52. <el-tag>
  53. <span style="color: #31cb7a; font-size: 18px; margin: 0 5px">{{
  54. parseInt(homeStore.disinfectionState.nlog?.toString())
  55. }}</span>Log
  56. </el-tag>
  57. </el-descriptions-item>
  58. </el-descriptions>
  59. </div>
  60. </template>
  61. <style lang="scss" scoped>
  62. .home-right-title {
  63. .title-formula {
  64. width: 100%;
  65. display: flex;
  66. align-items: center;
  67. gap: 5px;
  68. padding-left: 10px;
  69. font-size: 1.5rem;
  70. flex-wrap: nowrap;
  71. .name-text {
  72. // 不换行显示省略号
  73. width: 100%;
  74. white-space: nowrap;
  75. overflow: hidden;
  76. text-overflow: ellipsis;
  77. }
  78. }
  79. .title-formula {
  80. flex: 1 1 auto;
  81. min-width: 0;
  82. white-space: normal;
  83. word-break: break-word;
  84. }
  85. .title-spend {
  86. justify-self: end;
  87. display: flex;
  88. align-items: center;
  89. gap: 5px;
  90. padding: 10px;
  91. font-size: 1.5rem;
  92. }
  93. }
  94. :deep(.el-descriptions) {
  95. width: 100%;
  96. .el-descriptions__body {
  97. background: rgba(0, 0, 0, 0);
  98. }
  99. }
  100. :deep(.el-descriptions__cell) {
  101. display: flex;
  102. align-items: center;
  103. background: rgba(255, 255, 255, 0.7);
  104. margin-bottom: 5px;
  105. padding: 5px !important;
  106. .el-descriptions__label {
  107. display: inline-block;
  108. width: 120px;
  109. margin: 0;
  110. font-size: 15px;
  111. font-weight: 600;
  112. color: #606266;
  113. }
  114. .el-descriptions__content {
  115. flex: 1;
  116. text-align: right;
  117. display: flex;
  118. justify-content: flex-end;
  119. }
  120. }
  121. .text {
  122. text-align: right;
  123. width: 150px;
  124. white-space: nowrap;
  125. overflow: hidden;
  126. text-overflow: ellipsis;
  127. }
  128. </style>