Browse Source

Merge branch 'master' of http://39.98.38.2:13000/lql/tba-nbhs

viviandjava 5 months ago
parent
commit
5857b2d42e

+ 19 - 8
src/api/gx.ts

@@ -1,5 +1,3 @@
-import request from "@/utils/request";
-
 const gxToken = 'test'
 
 /**
@@ -2568,12 +2566,25 @@ export function getWaterLevelAndFlowListOfPageByStcd(data: any) {
  * 雨量多站最新数据
  */
 export function getRainfallLatest(data: any) {
-  data.accessToken = gxToken
-  return request({
-    url: '/gx_api/gx/yq/rainfall/latest',
-    method: 'get',
-    params: data,
-    timeout: 1000 * 60
+  // data.accessToken = gxToken
+  // return request({
+  //   url: '/gx_api/gx/yq/rainfall/latest',
+  //   method: 'get',
+  //   params: data,
+  //   timeout: 1000 * 60
+  // })
+
+  return Promise.resolve({
+    "msg": "操作成功",
+    "code": 200,
+    "data": [
+      {
+        "stcd": "63304700",
+        "stnm": "太师桥",
+        "tm": "2024-12-06 10:10:00",
+        "drp": 0
+      }
+    ]
   })
 }
 

+ 155 - 116
src/assets/json/63304650_section.json

@@ -1,118 +1,157 @@
 [
-  {
-    "distance": 0.00,
-    "elevation": 2.91
-  },
-  {
-    "distance": 0.00,
-    "elevation": 1.00
-  },
-  {
-    "distance": 1.00,
-    "elevation": 0.98
-  },
-  {
-    "distance": 2.00,
-    "elevation": 0.90
-  },
-  {
-    "distance": 4.00,
-    "elevation": 0.70
-  },
-  {
-    "distance": 6.00,
-    "elevation": -0.42
-  },
-  {
-    "distance": 8.00,
-    "elevation": -0.47
-  },
-  {
-    "distance": 10.00,
-    "elevation": -0.68
-  },
-  {
-    "distance": 12.00,
-    "elevation": -0.96
-  },
-  {
-    "distance": 14.00,
-    "elevation": -1.28
-  },
-  {
-    "distance": 16.00,
-    "elevation": -1.38
-  },
-  {
-    "distance": 18.00,
-    "elevation": -1.57
-  },
-  {
-    "distance": 20.00,
-    "elevation": -1.69
-  },
-  {
-    "distance": 22.00,
-    "elevation": -1.74
-  },
-  {
-    "distance": 24.00,
-    "elevation": -1.87
-  },
-  {
-    "distance": 26.00,
-    "elevation": -1.94
-  },
-  {
-    "distance": 28.00,
-    "elevation": -1.78
-  },
-  {
-    "distance": 30.00,
-    "elevation": -1.72
-  },
-  {
-    "distance": 32.00,
-    "elevation": -1.70
-  },
-  {
-    "distance": 34.00,
-    "elevation": -1.38
-  },
-  {
-    "distance": 36.00,
-    "elevation": -1.01
-  },
-  {
-    "distance": 38.00,
-    "elevation": -0.91
-  },
-  {
-    "distance": 40.00,
-    "elevation": -0.39
-  },
-  {
-    "distance": 42.00,
-    "elevation": -0.03
-  },
-  {
-    "distance": 44.00,
-    "elevation": 0.39
-  },
-  {
-    "distance": 45.50,
-    "elevation": 0.55
-  },
-  {
-    "distance": 47.00,
-    "elevation": 0.87
-  },
-  {
-    "distance": 48.50,
-    "elevation": 1.00
-  },
-  {
-    "distance": 48.50,
-    "elevation": 3.18
-  }
+  [
+    -2,
+    4.75,
+    2.84
+  ],
+  [
+    0,
+    4.75,
+    2.84
+  ],
+  [
+    0.0,
+    -5,
+    2.84
+  ],
+  [
+    1.0,
+    -5,
+    2.82
+  ],
+  [
+    2.0,
+    -5,
+    2.74
+  ],
+  [
+    4.0,
+    -5,
+    2.54
+  ],
+  [
+    6.0,
+    -5,
+    1.42
+  ],
+  [
+    8.0,
+    -5,
+    1.37
+  ],
+  [
+    10.0,
+    -5,
+    1.16
+  ],
+  [
+    12.0,
+    -5,
+    0.88
+  ],
+  [
+    14.0,
+    -5,
+    0.56
+  ],
+  [
+    16.0,
+    -5,
+    0.46
+  ],
+  [
+    18.0,
+    -5,
+    0.27
+  ],
+  [
+    20.0,
+    -5,
+    0.15
+  ],
+  [
+    22.0,
+    -5,
+    0.1
+  ],
+  [
+    24.0,
+    -5,
+    -0.03
+  ],
+  [
+    26.0,
+    -5,
+    -0.1
+  ],
+  [
+    28.0,
+    -5,
+    0.06
+  ],
+  [
+    30.0,
+    -5,
+    0.12
+  ],
+  [
+    32.0,
+    -5,
+    0.14
+  ],
+  [
+    34.0,
+    -5,
+    0.46
+  ],
+  [
+    36.0,
+    -5,
+    0.83
+  ],
+  [
+    38.0,
+    -5,
+    0.93
+  ],
+  [
+    40.0,
+    -5,
+    1.45
+  ],
+  [
+    42.0,
+    -5,
+    1.81
+  ],
+  [
+    44.0,
+    -5,
+    2.23
+  ],
+  [
+    45.5,
+    -5,
+    2.39
+  ],
+  [
+    47.0,
+    -5,
+    2.71
+  ],
+  [
+    48.5,
+    -5,
+    2.84
+  ],
+  [
+    48.5,
+    5.02,
+    2.84
+  ],
+  [
+    50,
+    5.02,
+    2.84
+  ]
 ]

+ 245 - 188
src/assets/json/63304700_section.json

@@ -1,190 +1,247 @@
 [
-  {
-    "distance": 0,
-    "elevation": 2.91
-  },
-  {
-    "distance": 0.01,
-    "elevation": 2.32
-  },
-  {
-    "distance": 1.7,
-    "elevation": 2.2
-  },
-  {
-    "distance": 1.71,
-    "elevation": -0.43
-  },
-  {
-    "distance": 2,
-    "elevation": -0.69
-  },
-  {
-    "distance": 4,
-    "elevation": -1.21
-  },
-  {
-    "distance": 6,
-    "elevation": -1.74
-  },
-  {
-    "distance": 8,
-    "elevation": -2.02
-  },
-  {
-    "distance": 10,
-    "elevation": -2.24
-  },
-  {
-    "distance": 12,
-    "elevation": -2.53
-  },
-  {
-    "distance": 14,
-    "elevation": -2.93
-  },
-  {
-    "distance": 16,
-    "elevation": -3.27
-  },
-  {
-    "distance": 18,
-    "elevation": -3.75
-  },
-  {
-    "distance": 20,
-    "elevation": -4.06
-  },
-  {
-    "distance": 22,
-    "elevation": -4.41
-  },
-  {
-    "distance": 24,
-    "elevation": -4.58
-  },
-  {
-    "distance": 26,
-    "elevation": -4.71
-  },
-  {
-    "distance": 28,
-    "elevation": -4.73
-  },
-  {
-    "distance": 30,
-    "elevation": -4.67
-  },
-  {
-    "distance": 32,
-    "elevation": -4.63
-  },
-  {
-    "distance": 34,
-    "elevation": -4.56
-  },
-  {
-    "distance": 36,
-    "elevation": -4.53
-  },
-  {
-    "distance": 38,
-    "elevation": -4.46
-  },
-  {
-    "distance": 40,
-    "elevation": -4.4
-  },
-  {
-    "distance": 42,
-    "elevation": -4.33
-  },
-  {
-    "distance": 44,
-    "elevation": -4.14
-  },
-  {
-    "distance": 46,
-    "elevation": -4
-  },
-  {
-    "distance": 48,
-    "elevation": -3.77
-  },
-  {
-    "distance": 50,
-    "elevation": -3.69
-  },
-  {
-    "distance": 52,
-    "elevation": -3.48
-  },
-  {
-    "distance": 54,
-    "elevation": -3.03
-  },
-  {
-    "distance": 56,
-    "elevation": -2.8
-  },
-  {
-    "distance": 58,
-    "elevation": -2.75
-  },
-  {
-    "distance": 60,
-    "elevation": -2.7
-  },
-  {
-    "distance": 62,
-    "elevation": -2.56
-  },
-  {
-    "distance": 64,
-    "elevation": -2.29
-  },
-  {
-    "distance": 66,
-    "elevation": -2.22
-  },
-  {
-    "distance": 68,
-    "elevation": -1.8
-  },
-  {
-    "distance": 70,
-    "elevation": -1.49
-  },
-  {
-    "distance": 72,
-    "elevation": -0.93
-  },
-  {
-    "distance": 74,
-    "elevation": -0.48
-  },
-  {
-    "distance": 76,
-    "elevation": -0.24
-  },
-  {
-    "distance": 78,
-    "elevation": -0.1
-  },
-  {
-    "distance": 80,
-    "elevation": -0.22
-  },
-  {
-    "distance": 82,
-    "elevation": 0.2
-  },
-  {
-    "distance": 83,
-    "elevation": 0.57
-  },
-  {
-    "distance": 83,
-    "elevation": 3.29
-  }
+  [
+    -2,
+    4.75,
+    1.41
+  ],
+  [
+    0.0,
+    4.75,
+    1.41
+  ],
+  [
+    0.0,
+    4.16,
+    1.41
+  ],
+  [
+    1.7,
+    4.04,
+    1.41
+  ],
+  [
+    1.7,
+    -5,
+    1.41
+  ],
+  [
+    2.0,
+    -5,
+    1.15
+  ],
+  [
+    4.0,
+    -5,
+    0.63
+  ],
+  [
+    6.0,
+    -5,
+    0.10
+  ],
+  [
+    8.0,
+    -5,
+    -0.18
+  ],
+  [
+    10.0,
+    -5,
+    -0.40
+  ],
+  [
+    12.0,
+    -5,
+    -0.69
+  ],
+  [
+    14.0,
+    -5,
+    -1.09
+  ],
+  [
+    16.0,
+    -5,
+    -1.43
+  ],
+  [
+    18.0,
+    -5,
+    -1.91
+  ],
+  [
+    20.0,
+    -5,
+    -2.22
+  ],
+  [
+    22.0,
+    -5,
+    -2.57
+  ],
+  [
+    24.0,
+    -5,
+    -2.74
+  ],
+  [
+    26.0,
+    -5,
+    -2.87
+  ],
+  [
+    28.0,
+    -5,
+    -2.89
+  ],
+  [
+    30.0,
+    -5,
+    -2.83
+  ],
+  [
+    32.0,
+    -5,
+    -2.79
+  ],
+  [
+    34.0,
+    -5,
+    -2.72
+  ],
+  [
+    36.0,
+    -5,
+    -2.69
+  ],
+  [
+    38.0,
+    -5,
+    -2.62
+  ],
+  [
+    40.0,
+    -5,
+    -2.56
+  ],
+  [
+    42.0,
+    -5,
+    -2.49
+  ],
+  [
+    44.0,
+    -5,
+    -2.30
+  ],
+  [
+    46.0,
+    -5,
+    -2.16
+  ],
+  [
+    48.0,
+    -5,
+    -1.93
+  ],
+  [
+    50.0,
+    -5,
+    -1.85
+  ],
+  [
+    52.0,
+    -5,
+    -1.64
+  ],
+  [
+    54.0,
+    -5,
+    -1.19
+  ],
+  [
+    56.0,
+    -5,
+    -0.96
+  ],
+  [
+    58.0,
+    -5,
+    -0.91
+  ],
+  [
+    60.0,
+    -5,
+    -0.86
+  ],
+  [
+    62.0,
+    -5,
+    -0.72
+  ],
+  [
+    64.0,
+    -5,
+    -0.45
+  ],
+  [
+    66.0,
+    -5,
+    -0.38
+  ],
+  [
+    68.0,
+    -5,
+    0.04
+  ],
+  [
+    70.0,
+    -5,
+    0.35
+  ],
+  [
+    72.0,
+    -5,
+    0.91
+  ],
+  [
+    74.0,
+    -5,
+    1.36
+  ],
+  [
+    76.0,
+    -5,
+    1.60
+  ],
+  [
+    78.0,
+    -5,
+    1.74
+  ],
+  [
+    80.0,
+    -5,
+    1.62
+  ],
+  [
+    82.0,
+    -5,
+    2.04
+  ],
+  [
+    83.0,
+    -5,
+    2.41
+  ],
+  [
+    83.0,
+    5.13,
+    2.41
+  ],
+  [
+    85.0,
+    5.13,
+    2.41
+  ]
 ]

+ 52 - 27
src/components/CrossSection.vue

@@ -1,21 +1,20 @@
 <script lang="ts" setup>
 import * as echarts from "echarts";
 import Chart from "@/components/Chart.vue";
-import {getCurrentInstance, onMounted, reactive, ref} from "vue";
+import {onMounted, reactive, ref} from "vue";
 import section_63304650 from '@/assets/json/63304650_section.json'
 import section_63304700 from '@/assets/json/63304700_section.json'
 import water_area_63304650 from '@/assets/json/63304650_water_area.json'
 import water_area_63304700 from '@/assets/json/63304700_water_area.json'
 import {useStationStore} from '@/stores/station'
-import {CEMENT_COLOR} from "@/assets/scripts/base64image";
+import {CEMENT_COLOR, CLAY} from "@/assets/scripts/base64image";
 import ColorTag from "@/components/tag/ColorTag.vue";
 import {useRoute} from "vue-router";
 
 const route = useRoute()
 const store = useStationStore()
-const {props} = getCurrentInstance()
 const chartRef = ref(null)
-const totalValue = reactive({'水面积': 0, '水位': 0, '水面宽': 111, '高程': 111})
+const totalValue = reactive({'水面积': 0, '水位': 0, '水面宽': (route.params.stcd == '63304650') ? '48.5' : '83.0'})
 let start = 0
 let end = 100
 let data = null;
@@ -40,10 +39,7 @@ function calculateWaterArea() {
 }
 
 async function reloadChart(data) {
-  totalValue['水面宽'] = data[data.length - 1].distance
-  totalValue['高程'] = data[0].elevation
-  totalValue['水位'] = await store.getZ()
-  calculateWaterArea()
+
 
   const option = {
     tooltip: {
@@ -51,18 +47,20 @@ async function reloadChart(data) {
       formatter: (params) => {
         let str = `起点距: ${params[0].axisValue} m<br/>`;
         params.forEach((item, idx) => {
-          str += `${item.marker}${item.seriesName}: ${item.data}`
-          switch (idx) {
-            case 0:
-              str += 'm';
-              break;
-            case 1:
-              str += 'm';
-              break;
-            default:
-              str += 'm'
+          if (idx !== 2) {
+            str += `${item.marker}${item.seriesName}: ${item.data}`
+            switch (idx) {
+              case 0:
+                str += 'm';
+                break;
+              case 1:
+                str += 'm';
+                break;
+              default:
+                str += 'm'
+            }
+            str += idx === params.length - 1 ? '' : '<br/>'
           }
-          str += idx === params.length - 1 ? '' : '<br/>'
         })
         return str
       }
@@ -81,7 +79,7 @@ async function reloadChart(data) {
         formatter: value => Number(value).toFixed(1),
       },
       boundaryGap: false,
-      data: data.map(d => d.distance)
+      data: data.map(d => d[0])
     },
     yAxis: {
       type: 'value',
@@ -112,7 +110,10 @@ async function reloadChart(data) {
         // sampling: 'lttb',
         smooth: true, //是否平滑曲线显示
         itemStyle: {
-          color: '#00ccff'
+          color: '#00ccff',
+          lineStyle: {
+            width: 0
+          }
         },
         areaStyle: {
           origin: 'start',
@@ -133,27 +134,49 @@ async function reloadChart(data) {
         name: '高程',
         type: 'line',
         symbol: 'none',
-        // sampling: 'lttb',
         smooth: true, //是否平滑曲线显示
         itemStyle: {
-          color: '#7999a3'
-          // color: '#75604b'
+          color: '#75604b',
+          lineStyle: {
+            width: 0
+          }
         },
         areaStyle: {
+          opacity: 1,
+          origin: 'start',
+          color: {
+            image: CLAY,
+            repeat: 'repeat'
+          }
+        },
+        data: data.map(d => d[2])
+      },
+      {
+        name: '高程',
+        type: 'line',
+        symbol: 'none',
+        itemStyle: {
+          color: '#7999a3',
+          lineStyle: {
+            width: 0
+          }
+        },
+        areaStyle: {
+          opacity: 1,
           origin: 'start',
           color: {
             image: CEMENT_COLOR,
             repeat: 'repeat'
           }
         },
-        data: data.map(d => (d.elevation).toFixed(2))
-      }
+        data: data.map(d => d[1])
+      },
     ]
   };
   chartRef.value.loadChart(option)
 }
 
-onMounted(() => {
+onMounted(async () => {
   if (route.params.stcd == '63304650') {
     data = section_63304650
     waterAreaData = water_area_63304650
@@ -161,6 +184,8 @@ onMounted(() => {
     data = section_63304700
     waterAreaData = water_area_63304700
   }
+  totalValue['水位'] = await store.getZ()
+  calculateWaterArea()
   reloadChart(data)
 })
 </script>

+ 93 - 0
src/components/DeviceComponent/WaterFlow.vue

@@ -0,0 +1,93 @@
+<script lang="ts" setup>
+import {onMounted, ref} from "vue";
+import {useRoute} from "vue-router";
+import Chart from "@/components/Chart.vue";
+import {getWaterLevelAndFlowListOfPageByStcd} from "@/api/gx";
+import {formatd} from "@/utils/ruoyi";
+
+const route = useRoute()
+const chartRef = ref(null)
+
+async function reloadChart() {
+  const sevenDayAgo = new Date(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
+  const flowData = await getWaterLevelAndFlowListOfPageByStcd({
+    stcd: route.params.stcd,
+    startTime: formatd(sevenDayAgo),
+    endTime: formatd(new Date())
+  }).then(res => {
+    return res.rows
+  })
+  const option = {
+    // backgroundColor: "#0B2D55",
+    tooltip: {
+      trigger: 'axis'
+    },
+    grid: {
+      top: '13%',
+      left: '2%',
+      right: '2%',
+      bottom: '0%',
+      containLabel: true
+    },
+    xAxis: [{
+      type: 'category',
+      boundaryGap: false,
+      axisLine: { // 坐标轴轴线相关设置。数学上的x轴
+        show: true,
+        lineStyle: {
+          color: '#233e64'
+        }
+      },
+      axisLabel: { // 坐标轴刻度标签的相关设置
+        color: '#02cacf'
+      },
+      axisTick: {show: false},
+      data: flowData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
+    }],
+    yAxis: [{
+      name: 'm³/s',
+      nameTextStyle: {
+        color: '#02cacf'
+      },
+      min: value => (value.min - 10).toFixed(0),
+      max: value => (value.max + 10).toFixed(0),
+      axisLabel: {
+        color: '#02cacf'
+      },
+      splitLine: {
+        show: true,
+        lineStyle: {
+          color: '#233e64'
+        }
+      },
+      axisLine: {
+        show: true
+      }
+    }],
+    series: [{
+      name: '流量',
+      type: 'line',
+      areaStyle: {},
+      smooth: true, //是否平滑曲线显示
+      lineStyle: {
+        color: '#3deaff'
+      },
+      // barWidth: 18,
+      // label: {
+      //   show: true,
+      //   position: 'top'
+      // },
+      data: flowData.map(item => item.q)
+    }
+    ]
+  }
+  chartRef.value.loadChart(option)
+}
+
+onMounted(() => {
+  reloadChart()
+})
+</script>
+<template>
+  <chart ref="chartRef"></chart>
+</template>

+ 15 - 11
src/components/tag/DataTag.vue

@@ -1,12 +1,11 @@
 <script lang="ts" setup>
-import { getCurrentInstance } from 'vue'
-import { onMounted, reactive, ref } from 'vue'
+import {getCurrentInstance, ref} from 'vue'
 
 defineProps({
-  data: { type: Object, default: () => ({}) }
+  data: {type: Object, default: () => ({})}
 })
 
-const { props } = getCurrentInstance()
+const {props} = getCurrentInstance()
 const imgSrc = ref(new URL('@/assets/images/szpj.png', import.meta.url).href)
 const szpjTitleSrc = ref(new URL('@/assets/images/szpj_title.png', import.meta.url).href)
 const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).href)
@@ -17,9 +16,10 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
     <el-row>
       <el-col :span="12">
         <div style="position: relative;display: flex;justify-content: center;">
-          <div style="position: absolute;bottom:35%;font-size:36px;">Ⅳ</div>
-          <img :src="szpjTitleSrc" style="position: absolute;bottom:10%;" />
-          <img :src="imgSrc" style="height: 140px;" />
+          <!-- Ⅰ Ⅱ  Ⅲ  Ⅳ Ⅴ Ⅵ   -->
+          <div style="position: absolute;bottom:35%;font-size:36px;">Ⅲ</div>
+          <img :src="szpjTitleSrc" style="position: absolute;bottom:10%;"/>
+          <img :src="imgSrc" style="height: 140px;"/>
         </div>
       </el-col>
       <el-col :span="12">
@@ -51,7 +51,8 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
           <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d5 }}</span>
         </el-row>
         <el-row>
-          <div style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
+          <div
+            style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
         </el-row>
       </el-col>
       <el-col :span="12">
@@ -63,7 +64,8 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
           <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d6 }}</span>
         </el-row>
         <el-row>
-          <div style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
+          <div
+            style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
         </el-row>
       </el-col>
     </el-row>
@@ -77,7 +79,8 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
           <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d7 }}</span>
         </el-row>
         <el-row>
-          <div style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
+          <div
+            style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
         </el-row>
       </el-col>
       <el-col :span="12">
@@ -89,7 +92,8 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
           <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d8 }}</span>
         </el-row>
         <el-row>
-          <div style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
+          <div
+            style="height: 5px;width: 200px;background:linear-gradient(to right, #00cbe6, #beebf1);margin-left: 10px;margin-top:6px;border-radius: 5px;"></div>
         </el-row>
       </el-col>
     </el-row>

+ 18 - 0
src/utils/rainfall.ts

@@ -0,0 +1,18 @@
+export function getRainfallLevel(rainfall: number) {
+  if (rainfall === 0) {
+    return "无雨"
+  } else if (0 < rainfall && rainfall < 10) {
+    return '小雨'
+  } else if (10 <= rainfall && rainfall < 25) {
+    return '中雨'
+  } else if (25 <= rainfall && rainfall < 50) {
+    return '大雨'
+  } else if (50 <= rainfall && rainfall < 100) {
+    return '暴雨'
+  } else if (100 <= rainfall && rainfall < 250) {
+    return '大暴雨'
+  } else if (250 <= rainfall) {
+    return '特大暴雨'
+  }
+  return '晴'
+}

+ 9 - 0
src/utils/tdInstruction/label.ts

@@ -35,3 +35,12 @@ export function adcpfx(stcd: any, show = true) {
   Bus.emit('emitUIInteraction', descriptor)
   console.log("-- H-ADCP特效与标签显隐", JSON.stringify(descriptor));
 }
+
+export function setLED(data: any) {
+  let descriptor = {
+    "command": "SetLED",
+    "data": data
+  }
+  Bus.emit('emitUIInteraction', descriptor)
+  console.log("-- 修改LED大屏内容", JSON.stringify(descriptor));
+}

+ 3 - 3
src/views/Device.vue

@@ -14,6 +14,7 @@ import WaterQualityAnalysis from "@/components/DeviceComponent/WaterQualityAnaly
 import WaterLevel from "@/components/DeviceComponent/WaterLevel.vue";
 import Rainfall from "@/components/DeviceComponent/Rainfall.vue";
 import AdcpFlow from "@/components/DeviceComponent/AdcpFlow.vue";
+import WaterFlow from "@/components/DeviceComponent/WaterFlow.vue";
 
 const route = useRoute()
 const right3Ref = ref(null)
@@ -357,9 +358,8 @@ onUnmounted(() => {
       </template>
       <template v-if="deviceType=== 'flow'">
         <card01 style="height: 36%" title="流量监测">
-          <adcp-flow></adcp-flow>
-          <!--          <adcp-flow v-if="device.ueDeviceName === '无人船'"></adcp-flow>-->
-          <!--          <flow v-else></flow>-->
+          <adcp-flow v-if="device.ueDeviceName === '无人船'"/>
+          <water-flow v-else/>
         </card01>
       </template>
       <template v-if="deviceType=== 'waterQuality'">

+ 26 - 8
src/views/Station.vue

@@ -11,7 +11,9 @@ import {getTypicalData, getTypicalEvents} from "@/utils/typicalYear";
 import TypicalChart from "@/components/TypicalChart.vue";
 import {getVideoCodeByMark} from "@/components/Video/video";
 import TimeScrollbar from "@/components/TimeScrollbar.vue";
-import {Operate, View} from "@/utils/tdInstruction";
+import {Label, Operate, View} from "@/utils/tdInstruction";
+import {getRainfallLatest, getWaterLevelAndFlowLatest} from "@/api/gx";
+import {getRainfallLevel} from "@/utils/rainfall";
 
 const route = useRoute()
 const stationStore = useStationStore()
@@ -55,16 +57,32 @@ function handleTimeChange(status) {
   }
 }
 
+async function handleSetLED() {
+  // 获取水位流量数据
+  const waterData = await getWaterLevelAndFlowLatest({stcds: `63201999,${route.params.stcd}`}).then(res => res.data)
+  // 获取雨量
+  const rainfallData = await getRainfallLatest({stcds: route.params.stcd}).then(res => res.data)
+  const thsw = waterData.find(d => d.stcd === '63201999') || {z: 0}
+  const tsq = waterData.find(d => d.stcd === route.params.stcd) || {z: 0, q: 0}
+  let drp = 0
+  if (rainfallData) {
+    drp = rainfallData[0].drp
+  }
+  Label.setLED({
+    "太湖水位": `${thsw.z}m`,
+    "太湖警戒水位": "3.80m",
+    "太湖保证水位": "4.65m",
+    "太师桥实时水位": `${tsq.z}m`,
+    "太师桥历史水位": "4.39m",
+    "流量": `${tsq.q}m³/s`,
+    "雨量": `${drp}mm(${getRainfallLevel(drp)})`
+  })
+}
+
 onMounted(() => {
   handleEventChange(currentTypicalEventName.value)
-
   // 获取最新水雨情数据,更新大屏
-
-
-})
-
-watch(() => route.path, path => {
-
+  handleSetLED()
 })
 </script>
 <template>

+ 0 - 1
src/views/Zhyw.vue

@@ -12,7 +12,6 @@ const baseUrl_yw = ref('http://10.8.48.235:8100/homePage.html#/inspectionmainten
 // 查询分析
 const baseUrl_cx = ref('http://10.8.48.235:8100/homePage.html#/dataManagement/watermultiplestations')
 onMounted(() => {
-  debugger
   const stcd = route.params.stcd
   const srcType = route.params.type
   const code='4a3569fd-73b3-42a4-b3d0-ba752e020c19'