EconomicTrendChart.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div class="left-card">
  3. <m-card title="监测指标" :height="400">
  4. <div class="fusion-stats-container">
  5. <!-- 上部:圆形统计 -->
  6. <div class="upper-section">
  7. <div class="core-indicator">
  8. <div class="core-circle">
  9. <img src="@/assets/images/pie/pie-zs-bg.png" alt="背景装饰" class="circle-decoration" />
  10. <img src="@/assets/images/椭圆 .png" alt="椭圆装饰" class="ellipse-decoration" />
  11. <img src="@/assets/images/pie/pie-mid-circle.png" alt="圆形背景" class="circle-bg" />
  12. <div class="core-value">{{ coreIndicator.value }}</div>
  13. <div class="core-label">{{ coreIndicator.label }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. <!-- 下部:监测指标 -->
  18. <div class="lower-section">
  19. <div class="water-quality-indicators">
  20. <div class="indicators-scroll">
  21. <div class="indicators-grid">
  22. <div class="indicator-item" v-for="(item, index) in state.indicators" :key="index">
  23. <div class="icon" :style="{ backgroundColor: state.indicatorColors[index % state.indicatorColors.length] }"></div>
  24. <div class="name">{{ item.name }}</div>
  25. <div class="unit">{{ item.unit }}</div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </m-card>
  33. </div>
  34. </template>
  35. <script setup>
  36. import { ref, reactive } from "vue"
  37. import mCard from "@/components/mCard/index.vue"
  38. // 核心指标
  39. const coreIndicator = reactive({
  40. value: "27",
  41. label: "监测指标总数"
  42. })
  43. // 监测指标数据
  44. const state = reactive({
  45. indicatorColors: ["#17E6C3", "#40CFFF", "#1979FF", "#FFC472", "#FF6B6B", "#4ECDC4"],
  46. indicators: [
  47. // 水质指标
  48. { name: "总磷", unit: "mg/L" },
  49. { name: "总氮", unit: "mg/L" },
  50. { name: "氨氮", unit: "mg/L" },
  51. { name: "电导率", unit: "μS/cm" },
  52. { name: "溶解氧", unit: "mg/L" },
  53. { name: "pH值", unit: "-" },
  54. { name: "化学需氧量", unit: "mg/L" },
  55. { name: "生化需氧量", unit: "mg/L" },
  56. { name: "悬浮物", unit: "mg/L" },
  57. // 水文指标
  58. { name: "水位", unit: "m" },
  59. { name: "流量", unit: "m³/s" },
  60. { name: "蒸发量", unit: "mm" },
  61. { name: "降水量", unit: "mm" },
  62. { name: "泥沙含量", unit: "kg/m³" },
  63. { name: "水温", unit: "℃" },
  64. // 水土保持指标
  65. { name: "土壤侵蚀模数", unit: "t/km²·a" },
  66. { name: "植被覆盖度", unit: "%" },
  67. { name: "水土流失面积", unit: "km²" },
  68. { name: "土壤含水量", unit: "%" },
  69. // 环境指标
  70. { name: "二氧化碳", unit: "mg/L" },
  71. { name: "浊度", unit: "NTU" },
  72. { name: "空气质量", unit: "AQI" },
  73. { name: "噪声", unit: "dB" },
  74. // 其他指标
  75. { name: "叶绿素a", unit: "μg/L" },
  76. { name: "重金属含量", unit: "μg/L" },
  77. { name: "微生物指标", unit: "CFU/mL" },
  78. { name: "有机物含量", unit: "mg/L" },
  79. ],
  80. })
  81. </script>
  82. <style lang="scss" scoped>
  83. .fusion-stats-container {
  84. position: relative;
  85. height: 100%;
  86. padding: 15px;
  87. box-sizing: border-box;
  88. overflow: hidden;
  89. display: flex;
  90. flex-direction: column;
  91. gap: 20px;
  92. }
  93. .upper-section {
  94. flex: 1;
  95. display: flex;
  96. align-items: center;
  97. justify-content: center;
  98. }
  99. .core-indicator {
  100. text-align: center;
  101. display: flex;
  102. align-items: center;
  103. justify-content: center;
  104. }
  105. .core-circle {
  106. position: relative;
  107. display: flex;
  108. flex-direction: column;
  109. align-items: center;
  110. justify-content: center;
  111. width: 200px;
  112. height: 140px;
  113. }
  114. .circle-decoration {
  115. position: absolute;
  116. width: 100%;
  117. height: 100%;
  118. z-index: 0;
  119. object-fit: contain;
  120. }
  121. .ellipse-decoration {
  122. position: absolute;
  123. width: 160%;
  124. height: 110%;
  125. left: 50%;
  126. top: 70%;
  127. z-index: 0.5;
  128. object-fit: contain;
  129. transform: translate(-50%, -50%);
  130. opacity: 0.7;
  131. }
  132. .circle-bg {
  133. position: absolute;
  134. width: 100px;
  135. height: 100px;
  136. z-index: 1;
  137. object-fit: contain;
  138. }
  139. .core-value {
  140. font-size: 28px;
  141. font-weight: bold;
  142. color: #30DCFF;
  143. text-shadow: 0 0 10px rgba(48, 220, 255, 0.8);
  144. margin-bottom: 8px;
  145. z-index: 2;
  146. }
  147. .core-label {
  148. font-size: 14px;
  149. color: #D3F8F2;
  150. z-index: 2;
  151. }
  152. .lower-section {
  153. flex: 2;
  154. display: flex;
  155. justify-content: center;
  156. }
  157. .water-quality-indicators {
  158. height: 100%;
  159. width: 100%;
  160. padding: 0 10px;
  161. box-sizing: border-box;
  162. }
  163. .indicators-scroll {
  164. height: 160px;
  165. overflow-y: auto;
  166. overflow-x: hidden;
  167. padding-right: 5px;
  168. }
  169. .indicators-grid {
  170. display: grid;
  171. grid-template-columns: repeat(3, 1fr);
  172. gap: 6px;
  173. }
  174. .indicator-item {
  175. display: flex;
  176. align-items: center;
  177. padding: 6px;
  178. background-color: rgba(10, 40, 60, 0.3);
  179. border-radius: 4px;
  180. border: 1px solid rgba(63, 91, 115, 0.3);
  181. .icon {
  182. width: 6px;
  183. height: 6px;
  184. border-radius: 50%;
  185. margin-right: 6px;
  186. }
  187. .name {
  188. font-size: 11px;
  189. color: #D3F8F2;
  190. flex: 1;
  191. white-space: nowrap;
  192. overflow: hidden;
  193. text-overflow: ellipsis;
  194. }
  195. .unit {
  196. font-size: 9px;
  197. color: #30DCFF;
  198. margin-left: 4px;
  199. white-space: nowrap;
  200. }
  201. }
  202. /* 滚动条样式 */
  203. .indicators-scroll::-webkit-scrollbar {
  204. width: 6px;
  205. }
  206. .indicators-scroll::-webkit-scrollbar-track {
  207. background: rgba(10, 40, 60, 0.3);
  208. border-radius: 3px;
  209. }
  210. .indicators-scroll::-webkit-scrollbar-thumb {
  211. background: rgba(48, 220, 255, 0.5);
  212. border-radius: 3px;
  213. }
  214. .indicators-scroll::-webkit-scrollbar-thumb:hover {
  215. background: rgba(48, 220, 255, 0.8);
  216. }
  217. </style>