DataTag.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <script lang="ts" setup>
  2. import {getCurrentInstance, ref} from 'vue'
  3. defineProps({
  4. data: {type: Object, default: () => ({})}
  5. })
  6. const {props} = getCurrentInstance()
  7. const imgSrc = ref(new URL('@/assets/images/szpj.png', import.meta.url).href)
  8. const szpjTitleSrc = ref(new URL('@/assets/images/szpj_title.png', import.meta.url).href)
  9. const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).href)
  10. </script>
  11. <template>
  12. <div>
  13. <el-row>
  14. <el-col :span="12">
  15. <div style="position: relative;display: flex;justify-content: center;">
  16. <!-- Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ -->
  17. <div style="position: absolute;bottom:35%;font-size:36px;">Ⅲ</div>
  18. <img :src="szpjTitleSrc" style="position: absolute;bottom:10%;"/>
  19. <img :src="imgSrc" style="height: 140px;"/>
  20. </div>
  21. </el-col>
  22. <el-col :span="12">
  23. <div class="background-image">
  24. <span style="font-size:14px;color:#81d4d9;">PH值</span>
  25. <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d1 }}</span>
  26. </div>
  27. <div class="background-image">
  28. <span style="font-size:14px;color:#81d4d9;">溶解氧</span>
  29. <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d2 }}</span>
  30. </div>
  31. <div class="background-image">
  32. <span style="font-size:14px;color:#81d4d9;">氨氮</span>
  33. <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d3 }}</span>
  34. </div>
  35. <div class="background-image">
  36. <span style="font-size:14px;color:#81d4d9;">浊度</span>
  37. <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d4 }}</span>
  38. </div>
  39. </el-col>
  40. </el-row>
  41. <el-row>
  42. <el-col :span="12">
  43. <el-row style="display: flex;justify-content:space-between;width: 100%;">
  44. <div style="display: flex;">
  45. <div class="tubiao-image tempImg"></div>
  46. <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">水温</span>
  47. </div>
  48. <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d5 }}</span>
  49. </el-row>
  50. <el-row>
  51. <div
  52. style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
  53. </el-row>
  54. </el-col>
  55. <el-col :span="12">
  56. <el-row style="display: flex;justify-content:space-between;width: 100%;">
  57. <div style="display: flex;">
  58. <div class="tubiao-image tempImg"></div>
  59. <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">电导率</span>
  60. </div>
  61. <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d6 }}</span>
  62. </el-row>
  63. <el-row>
  64. <div
  65. style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
  66. </el-row>
  67. </el-col>
  68. </el-row>
  69. <el-row style="margin-top: 30px;">
  70. <el-col :span="12">
  71. <el-row style="display: flex;justify-content:space-between;width: 100%;">
  72. <div style="display: flex;">
  73. <div class="tubiao-image tempImg"></div>
  74. <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">总氮</span>
  75. </div>
  76. <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d7 }}</span>
  77. </el-row>
  78. <el-row>
  79. <div
  80. style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
  81. </el-row>
  82. </el-col>
  83. <el-col :span="12">
  84. <el-row style="display: flex;justify-content:space-between;width: 100%;">
  85. <div style="display: flex;">
  86. <div class="tubiao-image tempImg"></div>
  87. <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">总磷</span>
  88. </div>
  89. <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d8 }}</span>
  90. </el-row>
  91. <el-row>
  92. <div
  93. style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
  94. </el-row>
  95. </el-col>
  96. </el-row>
  97. </div>
  98. </template>
  99. <style lang="scss" scoped>
  100. .image-tag {
  101. position: relative;
  102. width: 100%;
  103. height: 100%;
  104. padding: 10px 0;
  105. border-radius: 8px;
  106. color: #fff;
  107. background-image: linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, #064786 100%);
  108. background-size: 100% 100%;
  109. .label {
  110. color: #f3f5f6;
  111. font-size: .9rem;
  112. }
  113. .value {
  114. font-size: 1.4rem;
  115. font-weight: bold;
  116. margin: 10px 0;
  117. }
  118. .unit {
  119. font-size: 0.8rem;
  120. color: #d9dde1;
  121. }
  122. }
  123. .background-image {
  124. background-image: url('@/assets/images/dataImage.png');
  125. height: 32px; /* 设置高度 */
  126. background-size: cover; /* 背景图片覆盖整个区域 */
  127. background-position: center; /* 位置居中 */
  128. padding-top: 12px;
  129. padding-left: 22px;
  130. display: flex;
  131. justify-content: space-between;
  132. padding-right: 50px;
  133. }
  134. .tubiao-image {
  135. width: 24px;
  136. height: 24px; /* 设置高度 */
  137. background-size: 14px 14px; /* 背景图片覆盖整个区域 */
  138. background-position: center; /* 位置居中 */
  139. background-repeat: no-repeat;
  140. margin-left: 10px;
  141. background-color: rgba(0, 199, 227, 0.5);
  142. border-radius: 12px;
  143. }
  144. .tempImg {
  145. background-image: url('@/assets/images/temperature.png');
  146. }
  147. </style>