Home.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <script lang="ts" setup>
  2. import {onMounted, reactive, ref} from 'vue'
  3. import {useMapStore} from '@/stores/map'
  4. import RightFrame from '@/components/RightFrame.vue'
  5. import Card01 from '@/components/card/Card01.vue'
  6. import Chart from '@/components/chart.vue'
  7. import StripeTable from '@/components/StripeTable.vue'
  8. import {getRStLLMaxDate} from '@/api/home'
  9. import bus from '@/utils/bus'
  10. import {stations} from '@/utils/station'
  11. import {jumpPage} from '@/utils'
  12. import {copyObj} from '@/utils/ruoyi'
  13. import {View} from "@/utils/tdInstruction";
  14. const zmwjianjie = new URL('@/assets/images/zmw_jieshao.jpg', import.meta.url).href
  15. const zmwnd = new URL('@/assets/images/zmw_nd.jpg', import.meta.url).href
  16. const zmwhs = new URL('@/assets/images/zmw_hs.jpg', import.meta.url).href
  17. const mapStore = useMapStore()
  18. const left2Ref = ref(null)
  19. const right1Ref = ref(null)
  20. const tableColumns = [
  21. {
  22. label: '站名', prop: 'stnm', convertFn: (data) => {
  23. return data ? data.trim() : ''
  24. }
  25. },
  26. {
  27. label: '时间', prop: 'tm', width: '90', convertFn: (data) => {
  28. return data ? data.substring(5, 16) : ''
  29. }
  30. },
  31. {
  32. label: '水位(m)', prop: 'z', width: '80', convertFn: (data) => {
  33. return Number(data).toFixed(2)
  34. }
  35. },
  36. {
  37. label: '流量', prop: 'q', width: '70', convertFn: (data) => {
  38. return Number(data).toFixed(2)
  39. }
  40. },
  41. {
  42. label: '雨量', prop: 'drp', width: '65', convertFn: (data) => {
  43. return data | 0
  44. }
  45. }
  46. ]
  47. const tableData = reactive([])
  48. function reloadLeft2() {
  49. const option = {
  50. tooltip: {
  51. trigger: 'item'
  52. },
  53. legend: {
  54. textStyle: {
  55. color: '#fff'
  56. }
  57. },
  58. series: [
  59. {
  60. type: 'pie',
  61. radius: '70%',
  62. label: {
  63. show: true,
  64. color: '#fff'
  65. },
  66. data: [
  67. {value: 6, name: '水文站'},
  68. {value: 5, name: '河道水文站'},
  69. {value: 1, name: '实验站'}
  70. ]
  71. }
  72. ]
  73. }
  74. left2Ref.value.loadChart(option)
  75. }
  76. function reloadRight1() {
  77. const option = {
  78. color: ['#fac858', '#ee6666'],
  79. tooltip: {
  80. trigger: 'axis',
  81. axisPointer: {
  82. type: 'shadow'
  83. },
  84. formatter(params) {
  85. let circle = `<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:`
  86. let info = params[0].axisValueLabel
  87. for (let i = 0; i < params.length; i++) {
  88. let param = params[i]
  89. // if (param.value > 0) {
  90. info += `<br/>${circle}${param.color}"></span> ${param.seriesName}: ${param.value}个`
  91. // break
  92. // }
  93. }
  94. return info
  95. }
  96. },
  97. legend: {
  98. type: 'scroll',
  99. icon: 'circle',
  100. selectedMode: false,
  101. textStyle: {
  102. color: '#fff'
  103. }
  104. },
  105. grid: {
  106. top: '14%',
  107. left: '2%',
  108. right: '2%',
  109. bottom: '0%',
  110. containLabel: true
  111. },
  112. yAxis: {
  113. type: 'value',
  114. name: '个',
  115. max: value => value.max + 1,
  116. nameTextStyle: {
  117. color: '#02cacf'
  118. },
  119. axisLabel: {
  120. color: '#02cacf'
  121. }
  122. },
  123. xAxis: {
  124. type: 'category',
  125. axisLabel: {
  126. // interval: 0,
  127. // rotate: -45, //旋转的角度从 -90 度到 90 度。
  128. color: '#02cacf'
  129. },
  130. data: ['河道水文', '水文', '实验']
  131. },
  132. series: [
  133. {
  134. name: '超警戒(汛限)',
  135. type: 'bar',
  136. // stack: 'total',
  137. // barWidth: '20%',
  138. label: {
  139. show: true,
  140. position: 'top',
  141. color: '#fff',
  142. formatter: params => params.value > 0 ? params.value + '个' : ''
  143. },
  144. data: [0, 0, 0]
  145. },
  146. {
  147. name: '超保证(设计)',
  148. type: 'bar',
  149. label: {
  150. show: true,
  151. position: 'top',
  152. color: '#fff',
  153. formatter: params => params.value > 0 ? params.value + '个' : ''
  154. },
  155. data: [0, 0, 0]
  156. }
  157. ]
  158. }
  159. right1Ref.value.loadChart(option)
  160. }
  161. function getStationList() {
  162. getRStLLMaxDate().then(res => {
  163. tableData.push(...res)
  164. initPoints()
  165. }).catch(() => {
  166. })
  167. }
  168. /**
  169. * 初始化测站点位
  170. */
  171. function initPoints() {
  172. const data = copyObj(tableData)
  173. data.forEach(s => {
  174. const station = stations.find(item => item.stcd === s.stcd)
  175. s.jump = !!station
  176. })
  177. const option = {
  178. view: {
  179. center: [104.114129, 37.550339],
  180. zoom: 5
  181. },
  182. layers: [
  183. {
  184. type: 'point',
  185. data: data,
  186. dataOptions: {
  187. parser: {
  188. type: 'json',
  189. x: 'lgtd',
  190. y: 'lttd'
  191. }
  192. },
  193. label: {
  194. show: true,
  195. field: 'stnm'
  196. },
  197. emphasis: {
  198. show: true,
  199. label: {
  200. show: true
  201. }
  202. },
  203. size: [20, 20],
  204. shape: {
  205. isConstant: false,
  206. field: 'jump',
  207. value: value => {
  208. return value ? 'stationPointBlue' : 'stationPointGray'
  209. }
  210. },
  211. popup: {
  212. enabled: true,
  213. trigger: 'click',
  214. content: ''
  215. }
  216. }
  217. ]
  218. }
  219. mapStore.setOption(option)
  220. }
  221. onMounted(() => {
  222. reloadLeft2()
  223. reloadRight1()
  224. getStationList()
  225. })
  226. // 订阅一个具体的事件
  227. bus.on('point_click', (data: any) => {
  228. console.log('data', data.data, data.e)
  229. const station = stations.find(item => item.stcd === data.data.stcd)
  230. if (station) {
  231. if (station.isExternalAddress) {
  232. jumpPage(station.path, null, true)
  233. } else {
  234. jumpPage(`/station/${station.stcd}`)
  235. View.changeView(station.stnm)
  236. }
  237. }
  238. })
  239. </script>
  240. <template>
  241. <right-frame>
  242. <template #leftModule>
  243. <card01 style="height: 69%" title="简介">
  244. <el-carousel :autoplay="true" :interval="5000" arrow="never" style="width: 100%;height: 100%;" trigger="click">
  245. <el-carousel-item>
  246. <h2 class="introduce-title">嘉兴监测中心</h2>
  247. <p class="introduce-text">
  248. 位于浙江省嘉兴市经济技术开发区龙舟路753号,土地面积4.98亩,建筑面积1699.87平方米。
  249. </p>
  250. <p class="introduce-text">
  251. 浙闽皖水文水资源监测中心主要负责太湖流域片浙闽、浙皖边界河流、湖泊(千岛湖)、新安江水文实验区水文测站运行管理、水文水资源水环境监测评价分析工作;负责太湖流域地下水监测管理、资料汇交,提供地下水信息服务;负责杭州湾、钱塘江河口区域风暴潮监测与研究,负责太湖流域片沿海潮位站的风暴潮信息收集、分析等工作。
  252. 浙闽皖水文水资源监测中心内设综合科、测验与技术科、黄山水文水资源监测分中心、宁德水文水资源监测分中心。
  253. </p>
  254. <img :src="zmwjianjie" alt="" class="introduce-img"/>
  255. </el-carousel-item>
  256. <el-carousel-item>
  257. <h2 class="introduce-title">宁德水文水资源监测分中心</h2>
  258. <p class="introduce-text">
  259. 位于福建省宁德市蕉城区金涵畲族乡金漳路10号,征地3亩,建筑面积1800平方米。紧邻福建省福建省宁德水文水资源勘测分中心管理的蕉城水文站。
  260. </p>
  261. <p class="introduce-text">
  262. 宁德水文水资源监测分中心拥有甲类实验室1个,配备气相色谱仪1台、多功能自动进样系统1套、原子吸收分光光度计1台、电感耦合等离子体发射光谱仪1台、原子荧光光度计1台、离子色谱仪1台、紫外可见分光光度仪(带自动进样器)2台、连续流动分析仪(氰化物、挥发酚、阴离子表面活性剂)1台、连续流动分析仪(硫化物、氨氮、总氮)1台、微波消解仪1台、便携式多参数监测仪1台等各类监测仪器设备40台。
  263. </p>
  264. <img :src="zmwnd" alt="" class="introduce-img"/>
  265. </el-carousel-item>
  266. <el-carousel-item>
  267. <h2 class="introduce-title">黄山水文水资源监测分中心</h2>
  268. <p class="introduce-text">
  269. 位于安徽省黄山市高新区蓬莱路3号,占地4亩,基地建成684平方米实验室及附属办公设施。
  270. </p>
  271. <p class="introduce-text">
  272. 黄山分中心业务工作主要为水文水资源和生态监测,配有雨量计、激光水位计、浮子水位计、雷达水位计、走航ADCP、固定ADCP、流速仪、侧扫雷达、OBS浊度仪等各类水文监测仪器设备70余套;配有气相色谱仪、液相色谱仪、原子吸收分光光度计、原子荧光光度计、紫外可见分光光度仪、连续流动分析仪、核酸蛋白分析仪、通用突变检测系统等各类监测仪器设备60台套。
  273. </p>
  274. <img :src="zmwhs" alt="" class="introduce-img"/>
  275. </el-carousel-item>
  276. </el-carousel>
  277. </card01>
  278. <card01 style="height: 30%" title="站点统计">
  279. <chart ref="left2Ref"></chart>
  280. </card01>
  281. </template>
  282. <template #rightModule>
  283. <card01 style="height: 66%" title="站点清单">
  284. <stripe-table :columns="tableColumns" :data="tableData"></stripe-table>
  285. </card01>
  286. <card01 style="height: 33%" title="超警超保统计">
  287. <chart ref="right1Ref"></chart>
  288. </card01>
  289. </template>
  290. </right-frame>
  291. </template>
  292. <style lang="scss" scoped>
  293. @use "@/assets/styles/introduce.scss";
  294. .el-carousel :deep(.el-carousel__container) {
  295. height: 500px;
  296. }
  297. </style>