PurposeSpecialFunds.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div class="right-card">
  3. <m-card title="水系分布" :height="400">
  4. <div class="water-distribution-container">
  5. <!-- 上部:横向柱状图 -->
  6. <div class="chart-section">
  7. <v-chart ref="vChart" :option="chartOption" :autoresize="true" />
  8. </div>
  9. <!-- 下部:表格 -->
  10. <div class="table-section">
  11. <div class="table-header">
  12. <div class="header-item">名称</div>
  13. <div class="header-item">类型</div>
  14. <div class="header-item">河长/面积</div>
  15. </div>
  16. <div class="table-body">
  17. <div class="table-row" v-for="(item, index) in waterSystemTableData" :key="index">
  18. <div class="row-item">{{ item.name }}</div>
  19. <div class="row-item">{{ item.type }}</div>
  20. <div class="row-item">{{ item.lengthOrArea }}</div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </m-card>
  26. </div>
  27. </template>
  28. <script setup>
  29. import { ref, reactive } from "vue"
  30. import mCard from "@/components/mCard/index.vue"
  31. import * as echarts from "echarts"
  32. import VChart from "vue-echarts"
  33. // 柱状图数据
  34. const chartOption = ref({
  35. grid: {
  36. left: "5%",
  37. top: "10%",
  38. right: "5%",
  39. bottom: "10%",
  40. containLabel: true
  41. },
  42. tooltip: {
  43. trigger: "axis",
  44. axisPointer: {
  45. type: "shadow"
  46. },
  47. backgroundColor: "rgba(0,0,0,0.8)",
  48. borderColor: "#3F5B73",
  49. textStyle: {
  50. color: "#FFFFFF"
  51. }
  52. },
  53. xAxis: {
  54. type: "category",
  55. data: ["河道干流", "河道支流", "湖泊"],
  56. axisLine: {
  57. lineStyle: {
  58. color: "#3F5B73"
  59. }
  60. },
  61. axisLabel: {
  62. color: "#D3F8F2",
  63. fontSize: 12
  64. }
  65. },
  66. yAxis: {
  67. type: "value",
  68. axisLine: {
  69. lineStyle: {
  70. color: "#3F5B73"
  71. }
  72. },
  73. axisLabel: {
  74. color: "#D3F8F2",
  75. fontSize: 12
  76. },
  77. splitLine: {
  78. lineStyle: {
  79. color: "rgba(63, 91, 115, 0.3)"
  80. }
  81. }
  82. },
  83. series: [
  84. {
  85. data: [
  86. {
  87. value: 15,
  88. itemStyle: {
  89. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  90. { offset: 0, color: "rgba(3,65,128,1)" },
  91. { offset: 1, color: "rgba(115,208,255,1)" }
  92. ])
  93. }
  94. },
  95. {
  96. value: 110,
  97. itemStyle: {
  98. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  99. { offset: 0, color: "rgba(11, 77, 44, 1)" },
  100. { offset: 1, color: "rgba(77, 255, 181, 1)" }
  101. ])
  102. }
  103. },
  104. {
  105. value: 38,
  106. itemStyle: {
  107. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  108. { offset: 0, color: "rgba(153, 105, 38, 1)" },
  109. { offset: 1, color: "rgba(255, 200, 89, 1)" }
  110. ])
  111. }
  112. }
  113. ],
  114. type: "bar",
  115. barWidth: "40%",
  116. label: {
  117. show: true,
  118. position: "top",
  119. color: "#D3F8F2",
  120. fontSize: 12
  121. }
  122. }
  123. ]
  124. })
  125. // 表格数据
  126. const waterSystemTableData = reactive([
  127. { name: "娄江", type: "河道", lengthOrArea: "15.2 km" },
  128. { name: "吴淞江", type: "河道", lengthOrArea: "18.7 km" },
  129. { name: "淀山湖", type: "湖泊", lengthOrArea: "62 km²" },
  130. { name: "阳澄湖", type: "湖泊", lengthOrArea: "120 km²" },
  131. { name: "青阳港", type: "河道", lengthOrArea: "8.5 km" },
  132. { name: "杨林塘", type: "河道", lengthOrArea: "12.3 km" },
  133. { name: "急水港", type: "河道", lengthOrArea: "9.8 km" },
  134. { name: "千灯浦", type: "河道", lengthOrArea: "7.6 km" },
  135. { name: "大直港", type: "河道", lengthOrArea: "6.9 km" },
  136. { name: "小直港", type: "河道", lengthOrArea: "5.4 km" },
  137. { name: "茆沙塘", type: "河道", lengthOrArea: "8.2 km" },
  138. { name: "张家港河", type: "河道", lengthOrArea: "10.5 km" },
  139. { name: "七浦塘", type: "河道", lengthOrArea: "11.7 km" },
  140. { name: "白茆塘", type: "河道", lengthOrArea: "9.3 km" },
  141. { name: "傀儡湖", type: "湖泊", lengthOrArea: "3.8 km²" },
  142. { name: "鳗鲡湖", type: "湖泊", lengthOrArea: "2.5 km²" },
  143. { name: "金鸡湖", type: "湖泊", lengthOrArea: "7.4 km²" },
  144. { name: "独墅湖", type: "湖泊", lengthOrArea: "11.5 km²" }
  145. ])
  146. </script>
  147. <style lang="scss">
  148. .water-distribution-container {
  149. height: 100%;
  150. display: flex;
  151. flex-direction: column;
  152. padding: 10px;
  153. box-sizing: border-box;
  154. }
  155. .chart-section {
  156. height: 150px;
  157. margin-bottom: 10px;
  158. }
  159. .table-section {
  160. flex: 1;
  161. min-height: 100px;
  162. background-color: rgba(10, 40, 60, 0.3);
  163. border-radius: 4px;
  164. border: 1px solid rgba(63, 91, 115, 0.3);
  165. overflow: hidden;
  166. display: flex;
  167. flex-direction: column;
  168. }
  169. .table-header {
  170. display: flex;
  171. background-color: rgba(10, 40, 60, 0.5);
  172. padding: 10px 0;
  173. color: #30DCFF;
  174. font-weight: bold;
  175. border-bottom: 1px solid rgba(63, 91, 115, 0.5);
  176. flex-shrink: 0;
  177. }
  178. .header-item {
  179. flex: 1;
  180. text-align: center;
  181. font-size: 12px;
  182. }
  183. .table-body {
  184. flex: 1;
  185. overflow-y: auto;
  186. max-height: 120px;
  187. }
  188. .table-row {
  189. display: flex;
  190. padding: 8px 0;
  191. border-bottom: 1px solid rgba(63, 91, 115, 0.2);
  192. color: #D3F8F2;
  193. font-size: 12px;
  194. &:last-child {
  195. border-bottom: none;
  196. }
  197. }
  198. .row-item {
  199. flex: 1;
  200. text-align: center;
  201. }
  202. /* 滚动条样式 */
  203. .table-body::-webkit-scrollbar {
  204. width: 6px;
  205. }
  206. .table-body::-webkit-scrollbar-track {
  207. background: rgba(10, 40, 60, 0.3);
  208. border-radius: 3px;
  209. }
  210. .table-body::-webkit-scrollbar-thumb {
  211. background: rgba(48, 220, 255, 0.5);
  212. border-radius: 3px;
  213. }
  214. .table-body::-webkit-scrollbar-thumb:hover {
  215. background: rgba(48, 220, 255, 0.8);
  216. }
  217. </style>