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

137 lines
3.1 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
2 months ago
2 months ago
2 months ago
2 months ago
  1. <script lang="ts" setup>
  2. import homeInside from 'assets/images/home/home-inside.svg'
  3. import homeProbe1 from 'assets/images/home/home-probe1.svg'
  4. import homeProbe2 from 'assets/images/home/home-probe2.svg'
  5. import { roundNumber } from 'libs/utils'
  6. import { onMounted } from 'vue'
  7. /**
  8. * 环境参数展示组件
  9. * @description 用于展示仓内或探头的环境数据温度湿度过氧化氢浓度等
  10. * @props {object} envParams - 环境参数对象
  11. * @props {string} lineColor - 线条颜色默认值red
  12. */
  13. defineProps({
  14. envParams: {
  15. type: Object,
  16. default: () => ({
  17. type: 'inside', // 环境类型(inside/env1/env2)
  18. title: '仓内', // 环境名称
  19. temp: 0, // 温度
  20. rh: 0, // 相对湿度
  21. rs: 0, // 相对饱和度
  22. h2o2: 0, // 过氧化氢浓度
  23. }),
  24. },
  25. lineColor: {
  26. type: String,
  27. default: 'red',
  28. },
  29. })
  30. /**
  31. * 图片资源映射对象
  32. * @type {Record<string, any>}
  33. * @property {string} inside - 仓内图标路径
  34. * @property {string} env1 - 探头1图标路径
  35. * @property {string} env2 - 探头2图标路径
  36. */
  37. const imgs: Record<string, any> = {
  38. inside: homeInside,
  39. env1: homeProbe1,
  40. env2: homeProbe2,
  41. }
  42. /**
  43. * @hook 生命周期钩子 - 组件挂载完成时执行
  44. * @description 可在此处添加初始化逻辑当前为空实现
  45. */
  46. onMounted(() => {
  47. // 可扩展初始化操作
  48. })
  49. </script>
  50. <template>
  51. <div class="title">
  52. <img :src="imgs[envParams.type]"> {{ envParams.title }}
  53. </div>
  54. <div class="env-row odd">
  55. <div class="env-row-label ">
  56. 温度
  57. </div>
  58. <div class="env-row-value ">
  59. {{ roundNumber(envParams.temp || 0, 2) }}°C
  60. </div>
  61. </div>
  62. <div class="env-row">
  63. <div class="env-row-label ">
  64. 相对湿度
  65. </div>
  66. <div class="env-row-value">
  67. {{ roundNumber(envParams.rh || 0, 2) }}%RH
  68. </div>
  69. </div>
  70. <div class="env-row odd">
  71. <div class="env-row-label ">
  72. 相对饱和度
  73. </div>
  74. <div class="env-row-value ">
  75. {{ roundNumber(envParams.rs || 0, 2) }}%RS
  76. </div>
  77. </div>
  78. <div class="env-row">
  79. <div class="env-row-label ">
  80. 汽化过氧化氢
  81. </div>
  82. <div class="env-row-value ">
  83. {{ roundNumber(envParams.h2o2 || 0, 2) }}ppm
  84. </div>
  85. </div>
  86. </template>
  87. <style lang="scss" scoped>
  88. div{
  89. font-family: 思源黑体;
  90. font-size: 18px;
  91. font-weight: normal;
  92. line-height: normal;
  93. letter-spacing: 0.06em;
  94. }
  95. .title{
  96. display: flex;
  97. align-items: center;
  98. gap: 10px;
  99. font-size: 26px;
  100. padding: 1rem;
  101. }
  102. .title-line{
  103. height: 1vw;
  104. position: absolute;
  105. width: 100%;
  106. border-radius: 10px 10px 0 0;
  107. margin: -2.12rem;
  108. }
  109. .env-row{
  110. display: grid;
  111. grid-template-columns: repeat(2, 1fr);
  112. height: 7.8vh;
  113. padding: 7px;
  114. .env-row-label{
  115. display: flex;
  116. align-items: center;
  117. justify-self: start;
  118. justify-content: center;
  119. padding-left: 10px;
  120. }
  121. .env-row-value{
  122. display: flex;
  123. align-items: center;
  124. justify-self: end;
  125. justify-content: center;
  126. padding-right: 10px;
  127. }
  128. }
  129. .odd {
  130. background: rgba(139, 190, 239, 0.2);
  131. }
  132. </style>