linqilong 5 mesiacov pred
rodič
commit
504b0bca10

+ 11 - 0
package-lock.json

@@ -20,6 +20,7 @@
         "echarts": "^5.5.1",
         "echarts-gl": "^2.0.9",
         "element-plus": "^2.8.6",
+        "jsencrypt": "^3.3.2",
         "mitt": "^3.0.1",
         "moment": "^2.30.1",
         "pinia": "^2.2.4",
@@ -6451,6 +6452,11 @@
         "node": ">=18"
       }
     },
+    "node_modules/jsencrypt": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmmirror.com/jsencrypt/-/jsencrypt-3.3.2.tgz",
+      "integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
+    },
     "node_modules/jsesc": {
       "version": "3.0.2",
       "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-3.0.2.tgz",
@@ -14608,6 +14614,11 @@
         }
       }
     },
+    "jsencrypt": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmmirror.com/jsencrypt/-/jsencrypt-3.3.2.tgz",
+      "integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
+    },
     "jsesc": {
       "version": "3.0.2",
       "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-3.0.2.tgz",

+ 2 - 2
src/api/alarm.ts

@@ -4,11 +4,11 @@ import request from '@/utils/request'
  * 水文测站实时信息
  */
 
-export function getAlarmInfo(data) {
+export function getAlarmInfo(data: any) {
   return request({
     url: '/lantai_api/warnRecord/getPage',
     method: 'get',
-    params:data,
+    params: data,
     headers: {
       Authorization: localStorage.getItem('Authorization'),
     },

+ 98 - 81
src/api/gx.ts

@@ -9,7 +9,7 @@ const gxToken = 'test'
 export function getWaterQualityLatest(data: any) {
   data.accessToken = gxToken
   return request({
-    url: '/gx_api/gx/awq/waterQuality/latest',
+    url: '/gx_api/sz/tba-gx/gx/awq/waterQuality/latest',
     method: 'get',
     params: data,
     timeout: 1000 * 60
@@ -218,7 +218,7 @@ export function getWaterQualityLatest(data: any) {
 export function getWaterQualityListOfPageByStcd(data: any) {
   data.accessToken = gxToken
   return request({
-    url: '/gx_api/gx/awq/waterQuality/listOfPageByStcd',
+    url: '/gx_api/sz/tba-gx/gx/awq/waterQuality/listOfPageByStcd',
     method: 'get',
     params: data,
     timeout: 1000 * 60
@@ -464,83 +464,83 @@ export function getWaterQualityListOfPageByStcd(data: any) {
  * 水位流量多站最新数据
  */
 export function getWaterLevelAndFlowLatest(data: any) {
-    data.accessToken = gxToken
-    return request({
-        url: '/gx_api/gx/sq/waterLevelAndFlow/latest',
-        method: 'get',
-        params: data,
-        timeout: 1000 * 60 * 6
-    })
+  data.accessToken = gxToken
+  return request({
+    url: '/gx_api/sz/tba-gx/gx/sq/waterLevelAndFlow/latest',
+    method: 'get',
+    params: data,
+    timeout: 1000 * 60 * 6
+  })
 
-    // return Promise.resolve({
-    //   "msg": "操作成功",
-    //   "code": 200,
-    //   "data": [
-    //     {
-    //       "stcd": "63202740",
-    //       "stnm": "常州(三堡街)",
-    //       "tm": "2024-12-10 17:30:00",
-    //       "z": 3.34,
-    //       "q": null
-    //     },
-    //     {
-    //       "stcd": "63202850",
-    //       "stnm": "无锡南门",
-    //       "tm": "2024-12-10 17:30:00",
-    //       "z": 3.35,
-    //       "q": null
-    //     },
-    //     {
-    //       "stcd": "63202900",
-    //       "stnm": "望亭(大)",
-    //       "tm": "2024-12-10 17:25:00",
-    //       "z": 3.36,
-    //       "q": null
-    //     },
-    //     {
-    //       "stcd": "63203000",
-    //       "stnm": "苏州(枫桥)",
-    //       "tm": "2024-12-10 17:30:00",
-    //       "z": 3.26,
-    //       "q": null
-    //     },
-    //     {
-    //       "stcd": "63203040",
-    //       "stnm": "苏州(觅渡桥)",
-    //       "tm": "2024-12-10 17:00:00",
-    //       "z": 2.92,
-    //       "q": null
-    //     },
-    //     {
-    //       "stcd": "63203050",
-    //       "stnm": "苏州(二)",
-    //       "tm": "2024-12-10 17:00:00",
-    //       "z": 3.09,
-    //       "q": null
-    //     },
-    //     {
-    //       "stcd": "63300200",
-    //       "stnm": "拱宸桥",
-    //       "tm": "2024-12-10 17:00:00",
-    //       "z": 3.171,
-    //       "q": null
-    //     },
-    //     {
-    //       "stcd": "63304650",
-    //       "stnm": "思源大桥",
-    //       "tm": "2024-12-10 17:25:00",
-    //       "z": 2.97,
-    //       "q": 5.553
-    //     },
-    //     {
-    //       "stcd": "63304700",
-    //       "stnm": "太师桥",
-    //       "tm": "2024-12-10 17:25:00",
-    //       "z": 3.02,
-    //       "q": 64.847
-    //     }
-    //   ],
-    // })
+  // return Promise.resolve({
+  //   "msg": "操作成功",
+  //   "code": 200,
+  //   "data": [
+  //     {
+  //       "stcd": "63202740",
+  //       "stnm": "常州(三堡街)",
+  //       "tm": "2024-12-10 17:30:00",
+  //       "z": 3.34,
+  //       "q": null
+  //     },
+  //     {
+  //       "stcd": "63202850",
+  //       "stnm": "无锡南门",
+  //       "tm": "2024-12-10 17:30:00",
+  //       "z": 3.35,
+  //       "q": null
+  //     },
+  //     {
+  //       "stcd": "63202900",
+  //       "stnm": "望亭(大)",
+  //       "tm": "2024-12-10 17:25:00",
+  //       "z": 3.36,
+  //       "q": null
+  //     },
+  //     {
+  //       "stcd": "63203000",
+  //       "stnm": "苏州(枫桥)",
+  //       "tm": "2024-12-10 17:30:00",
+  //       "z": 3.26,
+  //       "q": null
+  //     },
+  //     {
+  //       "stcd": "63203040",
+  //       "stnm": "苏州(觅渡桥)",
+  //       "tm": "2024-12-10 17:00:00",
+  //       "z": 2.92,
+  //       "q": null
+  //     },
+  //     {
+  //       "stcd": "63203050",
+  //       "stnm": "苏州(二)",
+  //       "tm": "2024-12-10 17:00:00",
+  //       "z": 3.09,
+  //       "q": null
+  //     },
+  //     {
+  //       "stcd": "63300200",
+  //       "stnm": "拱宸桥",
+  //       "tm": "2024-12-10 17:00:00",
+  //       "z": 3.171,
+  //       "q": null
+  //     },
+  //     {
+  //       "stcd": "63304650",
+  //       "stnm": "思源大桥",
+  //       "tm": "2024-12-10 17:25:00",
+  //       "z": 2.97,
+  //       "q": 5.553
+  //     },
+  //     {
+  //       "stcd": "63304700",
+  //       "stnm": "太师桥",
+  //       "tm": "2024-12-10 17:25:00",
+  //       "z": 3.02,
+  //       "q": 64.847
+  //     }
+  //   ],
+  // })
 }
 
 /**
@@ -549,7 +549,7 @@ export function getWaterLevelAndFlowLatest(data: any) {
 export function getWaterLevelAndFlowListOfPageByStcd(data: any) {
   data.accessToken = gxToken
   return request({
-    url: '/gx_api/gx/sq/waterLevelAndFlow/listOfPageByStcd',
+    url: '/gx_api/sz/tba-gx/gx/sq/waterLevelAndFlow/listOfPageByStcd',
     method: 'get',
     params: data,
     timeout: 1000 * 60
@@ -2586,7 +2586,7 @@ export function getWaterLevelAndFlowListOfPageByStcd(data: any) {
 export function getRainfallLatest(data: any) {
   data.accessToken = gxToken
   return request({
-    url: '/gx_api/gx/yq/rainfall/latest',
+    url: '/gx_api/sz/tba-gx/gx/yq/rainfall/latest',
     method: 'get',
     params: data,
     timeout: 1000 * 60
@@ -2612,7 +2612,7 @@ export function getRainfallLatest(data: any) {
 export function getRainfallListOfPageByStcd(data: any) {
   data.accessToken = gxToken
   return request({
-    url: '/gx_api/gx/yq/rainfall/listOfPageByStcd',
+    url: '/gx_api/sz/tba-gx/gx/yq/rainfall/listOfPageByStcd',
     method: 'get',
     params: data,
     timeout: 1000 * 60
@@ -12221,6 +12221,23 @@ export function getRainfallListOfPageByStcd(data: any) {
   // });
 }
 
+/**
+ * 查询水质评价
+ */
+export async function getWaterQualityAssessment(data: any) {
+  return request({
+    url: '/szybh_api/szybh/openInterface/station/wq/getLevel',
+    method: 'post',
+    headers: {
+      "Content-Type": 'x-www-form-urlencoded'
+    },
+    data: {
+      method: 1,
+      source: JSON.stringify(data)
+    }
+  })
+}
+
 /**
  * 获取水位流量雨量多站最新数据
  */

+ 51 - 11
src/api/nanshui.ts

@@ -1,21 +1,11 @@
 import request from "@/utils/request";
 
-/**
- * 登录
- */
-export function nanshuiLogin() {
-  return request({
-    url: '/nanshui_api/login',
-    method: 'get'
-  })
-}
-
 /**
  * 查询空调运行状态、UPS运行状态和温湿度数据,返回结果:envstatus空调状态、upsstatusups状态、tmpstatus温湿度数据
  */
 export function getEnvStatus() {
   // return request({
-  //   url: '/nanshui_api/env-status',
+  //   url: '/tsq_api/env-status',
   //   method: 'get'
   // })
   return Promise.resolve({
@@ -221,3 +211,53 @@ export function setDeviceStatus(devid: string, cmd = true) {
     }
   })
 }
+
+/**
+ * 查看现在的定时任务
+ * @param stcd 站码
+ */
+export function getTaskRead(stcd: string) {
+  return request({
+    url: '/nanshui_api/task-read?taskid=SZCD',
+    method: 'post',
+  })
+  // .then(res => {
+  //   res.data.hour.split(',')
+  // })
+  // return Promise.resolve({
+  //   "result": true,
+  //   "msg": "成功",
+  //   "data": {
+  //     "mday": null,
+  //     "wday": null,
+  //     "hour": "8,20",
+  //     "minute": "0",
+  //     "pretype": "hour",
+  //     "taskid": "SZCD"
+  //   }
+  // })
+}
+
+/**
+ * 修改定时任务
+ * @param stcd 站码
+ * @param hour 小时数组
+ */
+export function setTaskRead(stcd: string, hour: Number[]) {
+  return request({
+    url: `/nanshui_api/task-edit?taskid=SZCD&hour=${hour.join(',')}&minute=0&pretype=hour`,
+    method: 'post',
+  })
+}
+
+/**
+ * 获取最新的水质检测数据
+ * @param stcd 站码
+ * @param hour 小时数组
+ */
+export function getWaterQualityData(stcd: any) {
+  return request({
+    url: `/nanshui_api/get-data`,
+    method: 'post',
+  })
+}

+ 1 - 1
src/api/rolldata.ts

@@ -2,7 +2,7 @@ import request from "@/utils/request";
 
 export function getAlarmData(){
   return request({
-    url: '/gx_gj_api/Orcl_Idbs3.asmx/rollData?accessToken=test&type=1',
+    url: '/gx_api/sq_zh/Orcl_Idbs3.asmx/rollData?accessToken=test&type=1',
     method: 'get'
   })
 }

BIN
src/assets/images/map/station-point-green.png


BIN
src/assets/images/map/station-point-green1.png


BIN
src/assets/video/BGM.WAV


BIN
src/assets/video/openAnimation.mp4


+ 2 - 0
src/components/AntvMap/index.vue

@@ -5,6 +5,7 @@ import {useMapStore} from "@/stores/map";
 
 const store = useMapStore()
 const stationPointBlueImage = new URL('@/assets/images/map/station-point-blue.png', import.meta.url).href
+const stationPointGreenImage = new URL('@/assets/images/map/station-point-green.png', import.meta.url).href
 const stationPointYellowImage = new URL('@/assets/images/map/station-point-yellow.png', import.meta.url).href
 const stationPointGrayImage = new URL('@/assets/images/map/station-point-gray.png', import.meta.url).href
 
@@ -13,6 +14,7 @@ onMounted(() => {
   init({
     images: [
       {name: 'stationPointBlue', src: stationPointBlueImage},
+      {name: 'stationPointGreen', src: stationPointGreenImage},
       {name: 'stationPointYellow', src: stationPointYellowImage},
       {name: 'stationPointGray', src: stationPointGrayImage},
     ]

+ 6 - 3
src/components/UePlayer.vue

@@ -3,6 +3,7 @@ import {onMounted, ref} from "vue";
 import {Config, PixelStreaming} from '@epicgames-ps/lib-pixelstreamingfrontend-ue5.2';
 import {Application, PixelStreamingApplicationStyle} from '@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.2';
 import bus from "@/utils/bus";
+import {NumericParameters} from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.2/src/Config/Config";
 
 const uePlayerRef = ref(null)
 let stream;
@@ -16,16 +17,18 @@ onMounted(() => {
     useUrlParams: true,
     initialSettings: {
       // ss: "ws://192.168.0.136:85",
-      ss: "ws://192.168.0.120:85",
+      // ss: "ws://192.168.0.120:85",
       // ss: "ws://192.168.0.121:85",
-      // ss: "ws://10.8.48.235:85",
+      ss: "ws://10.8.48.235:85",
       AutoConnect: true,
       AutoPlayVideo: true,
       StartVideoMuted: false,
       KeyboardInput: false,
       TouchInput: true,
       HoveringMouse: true,
-      MouseInput: true
+      MouseInput: true,
+      MinQP: 25,
+      MaxQP: 51,
     }
   });
 

+ 24 - 9
src/components/tag/DataTag.vue

@@ -1,5 +1,6 @@
 <script lang="ts" setup>
-import {getCurrentInstance, ref} from 'vue'
+import {getCurrentInstance, ref, watch} from 'vue'
+import {getWaterQualityAssessment} from "@/api/gx";
 
 defineProps({
   data: {type: Object, default: () => ({})}
@@ -9,6 +10,20 @@ 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)
+
+watch(() => props.data, (val) => {
+  if (val && val.length > 0) {
+    const waterQuery = Object.keys(val.wqdata).reduce((acc, key) => {
+      acc[key.toLowerCase()] = val.wqdata[key];
+      return acc;
+    }, {});
+
+    getWaterQualityAssessment([waterQuery]).then(res => {
+      debugger
+    })
+
+  }
+}, {deep: true})
 </script>
 
 <template>
@@ -25,19 +40,19 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
       <el-col :span="12">
         <div class="background-image">
           <span style="font-size:14px;color:#81d4d9;">PH值</span>
-          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d1 }}</span>
+          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.ph }}</span>
         </div>
         <div class="background-image">
           <span style="font-size:14px;color:#81d4d9;">溶解氧</span>
-          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d2 }}</span>
+          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.dox }}</span>
         </div>
         <div class="background-image">
           <span style="font-size:14px;color:#81d4d9;">氨氮</span>
-          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d3 }}</span>
+          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.nh3n }}</span>
         </div>
         <div class="background-image">
           <span style="font-size:14px;color:#81d4d9;">浊度</span>
-          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.d4 }}</span>
+          <span style="font-size:18px;font-weight: bold;font-style: italic;">{{ props.data.turb }}</span>
         </div>
       </el-col>
     </el-row>
@@ -48,7 +63,7 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
             <div class="tubiao-image tempImg"></div>
             <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">水温</span>
           </div>
-          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d5 }}</span>
+          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.wt }}</span>
         </el-row>
         <el-row>
           <div
@@ -61,7 +76,7 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
             <div class="tubiao-image tempImg"></div>
             <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">电导率</span>
           </div>
-          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d6 }}</span>
+          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.cond }}</span>
         </el-row>
         <el-row>
           <div
@@ -76,7 +91,7 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
             <div class="tubiao-image tempImg"></div>
             <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">总氮</span>
           </div>
-          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d7 }}</span>
+          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.tn }}</span>
         </el-row>
         <el-row>
           <div
@@ -89,7 +104,7 @@ const tempImg = ref(new URL('@/assets/images/temperature.png', import.meta.url).
             <div class="tubiao-image tempImg"></div>
             <span style="font-size: 14px;padding-left:15px;color:#81d4d9;">总磷</span>
           </div>
-          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.d8 }}</span>
+          <span style="padding-right: 10px;font-size: 20px;font-weight: bold;">{{ data.tp }}</span>
         </el-row>
         <el-row>
           <div

+ 1 - 1
src/utils/request.ts

@@ -18,7 +18,7 @@ service.interceptors.request.use(
     if (
       !config.url.startsWith("/tbazmw_api") &&
       !config.url.startsWith("/gx_api") &&
-      !config.url.startsWith("/gx_gj_api") &&
+      !config.url.startsWith("/szybh_api") &&
       !config.url.startsWith("/lantai_api") &&
       !config.url.startsWith("/nmc_api") &&
       !config.url.startsWith("/video_api") &&

+ 1 - 1
src/views/Home.vue

@@ -178,7 +178,7 @@ function initPoints() {
           isConstant: false,
           field: 'jump',
           value: value => {
-            return value ? 'stationPointBlue' : 'stationPointBlue'
+            return value ? 'stationPointGreen' : 'stationPointGreen'
           }
         },
         popup: {

+ 2 - 14
src/views/Situational.vue

@@ -30,7 +30,7 @@ const left2Ref = ref(null)
 const left3Ref = ref(null)
 const right1Ref = ref(null)
 const right3Ref = ref(null)
-const wqData = ref({d1: '6', d2: '22.3', d3: '5', d4: '20', d5: '6', d6: '22.3', d7: '5', d8: '20'})
+const wqData = ref({})
 const station = computed(() => getStation(route.params.stcd))
 const wlData = reactive({
   ss: '0',
@@ -371,19 +371,7 @@ async function reloadRight3() {
  * 获取最新水质数据
  */
 function getLatestWaterQuality() {
-  getWaterQualityLatest({stcds: route.params.stcd}).then(res => {
-    const data = res.data[0]
-    wqData.value = {
-      d1: data.ph,
-      d2: data.dox,
-      d3: data.nh3n,
-      d4: data.turb,
-      d5: data.wt,
-      d6: data.cond,
-      d7: data.tn,
-      d8: data.tp
-    }
-  })
+  getWaterQualityLatest({stcds: route.params.stcd}).then(res => wqData.value = res.data[0])
 }
 
 function handleControlWaterLevel(value) {

+ 58 - 76
src/views/StationHouse.vue

@@ -7,18 +7,17 @@ import stop from '@/assets/svg/stop2.svg'
 import RightFrame from '@/components/RightFrame.vue'
 import Card01 from '@/components/card/Card01.vue'
 import Chart from '@/components/Chart.vue'
-import {getWaterQualityLatest} from '@/api/gx'
 import StripeTable from '@/components/StripeTable.vue'
 import {getAlarmInfo} from '@/api/alarm.ts'
 import StationRightButtonGroup from "@/components/StationRightButtonGroup.vue";
 import GwVideo from "@/components/Video/index.vue";
 import {getVideoCodeByMark} from "@/components/Video/video";
 import {Operate} from "@/utils/tdInstruction";
-import {getDeviceByType} from "@/utils/device";
-import {getDeviceStatus} from "@/api/nanshui";
+import {getWaterQualityData} from "@/api/nanshui";
 import {HexToRgb} from "@/utils/color";
 import bus from "@/utils/bus";
 import DataTag from "@/components/tag/DataTag.vue";
+import {Timer, VideoPlay} from '@element-plus/icons-vue'
 
 const route = useRoute()
 const videoSrc = ref(new URL('@/assets/images/video.png', import.meta.url).href)
@@ -40,14 +39,36 @@ const RGB_RED = HexToRgb(RED)
 const LIGHT_RED = `rgba(${RGB_RED[0]}, ${RGB_RED[1]}, ${RGB_RED[2]}, 0.3)`
 
 const frequency = ref([2, 8])
-
-const wqData = ref({d1: '6', d2: '22.3', d3: '5', d4: '20', d5: '6', d6: '22.3', d7: '5', d8: '20'})
-// 设备列表
-const deviceList = reactive(getDeviceByType('水质测验设备').filter(d => d.deviceName !== '控制单元'))
+const wqData = ref({})
 // 水质测验模拟 0:结束 1:播放 2:暂停
 const testSimulationStatus = ref(0)
 // 获取视频CODE
 const videoCode = ref(getVideoCodeByMark(route.params.stcd + '', "室内"))
+const alarmType = ref({
+  '1': '巡检维护',
+  '2': '故障',
+  '3': '仪器校准',
+  '4': '提醒'
+})
+const alarmColumns = [
+  {
+    label: '报警类型', prop: 'warnType', width: '100', convertFn: (data) => {
+      return data ? alarmType.value[data.trim()] : ''
+    }
+  },
+  {
+    label: '时间', prop: 'reportTime', convertFn: (data) => {
+      return data ? data.substring(5, 16) : ''
+    }
+  },
+  {
+    label: '告警内容', prop: 'warnContent', width: '180', convertFn: (data) => {
+      return data ? data.trim() : ''
+    }
+  },
+]
+const alarmData = reactive([])
+const left1Ref = ref(null)
 
 /**
  * 测验模拟
@@ -75,87 +96,36 @@ function handleTestSimulation(mode) {
   }
 }
 
-function jumpDevicePage(name) {
-  // View.changeDeviceView('打开模型', route.params.stcd, name)
-}
-
-/**
- * 获取设备状态
- */
-function deviceStatus() {
-  getDeviceStatus().then(res => {
-    const status = res.data?.devstatus
-    if (status) {
-      deviceList.forEach(d => {
-        d['status'] = status[d['nanshuiDevId']]
-      })
-    }
-  })
-}
-
 /**
  * 获取最新水质数据
  */
 function getLatestWaterQuality() {
-  getWaterQualityLatest({stcds: route.params.stcd}).then(res => {
-    const data = res.data[0]
-    wqData.value = {
-      d1: data.ph,
-      d2: data.dox,
-      d3: data.chla,
-      d4: data.turb,
-      d5: data.wt,
-      d6: data.cond,
-      d7: data.tn,
-      d8: data.tp
+  getWaterQualityData(route.params.stcd).then(res => {
+    if (res.data.wqdata && res.data.wqdata.length > 0) {
+      wqData.value = Object.keys(res.data.wqdata).reduce((acc, key) => {
+        acc[key.toLowerCase()] = res.data.wqdata[key];
+        return acc;
+      }, {});
     }
   })
 }
 
-const alarmType = ref({
-  '1': '巡检维护',
-  '2': '故障',
-  '3': '仪器校准',
-  '4': '提醒'
-})
-
-const alarmColumns = [
-  {
-    label: '报警类型', prop: 'warnType', width: '100', convertFn: (data) => {
-      return data ? alarmType.value[data.trim()] : ''
-    }
-  },
-  {
-    label: '时间', prop: 'reportTime', convertFn: (data) => {
-      return data ? data.substring(5, 16) : ''
-    }
-  },
-  {
-    label: '告警内容', prop: 'warnContent', width: '180', convertFn: (data) => {
-      return data ? data.trim() : ''
-    }
-  },
-]
-const alarmData = reactive([])
-const left1Ref = ref(null)
-
 function getAlarmList() {
-  var data = {
+  const data = {
     'page': 1,
     'pageSize': 200,
     'stationCode': route.params.stcd
-  }
+  };
   getAlarmInfo(data).then(res => {
     if (res.status == 200) {
       alarmData.push(...res.data.records)
     }
-    // initPoints()
   })
 }
 
 async function reloadLeft1() {
   const colors = ['#5470C6', '#91CC75', '#EE6666'];
-  var option = {
+  const option = {
     // title: {
     //   text: '环境温湿度',
     //   textStyle: {
@@ -237,7 +207,7 @@ async function reloadLeft1() {
 onMounted(() => {
   reloadLeft1()
   getAlarmList()
-  deviceStatus()
+  getLatestWaterQuality()
 })
 
 onUnmounted(() => {
@@ -284,13 +254,19 @@ bus.on('test_simulation', (data) => {
       <card01 style="height: 65%" title="监测流程">
         <el-form label-width="auto">
           <el-form-item label="检测频率">
-            <el-select v-model="frequency" multiple placeholder="Select" style="width: 240px">
-              <el-option v-for="item in 24" :key="item" :label="item + '时'" :value="item"></el-option>
-              <template #tag>
-                <el-tag v-for="color in frequency" :key="color" color="#4167F0" style="color: #fff;">{{ color + '时' }}
-                </el-tag>
-              </template>
-            </el-select>
+            <div style="width: 100%;display: flex;align-items: center;justify-content: space-between;">
+              <el-select v-model="frequency" multiple placeholder="Select" style="width: 200px">
+                <el-option v-for="item in 24" :key="item" :label="item + '时'" :value="item"></el-option>
+                <template #tag>
+                  <el-tag v-for="color in frequency" :key="color" color="#4167F0" style="color: #fff;">{{
+                      color + '时'
+                    }}
+                  </el-tag>
+                </template>
+              </el-select>
+              <el-button :icon="VideoPlay" style="margin-left: 10px;width: 6rem;" type="primary" @click="">水质测验
+              </el-button>
+            </div>
           </el-form-item>
         </el-form>
         <div :style="{ 'background-image': `url(${simulateSrc})`}" class="video-control-bar test-simulation">
@@ -301,7 +277,13 @@ bus.on('test_simulation', (data) => {
           <icon v-if="testSimulationStatus != 0" :data="stop" class="video-btn" @click="handleTestSimulation('stop')"/>
         </div>
         <div>
-          <h3>测验结果:</h3>
+          <h3 style="display: flex;align-items: center;justify-content: space-between;">
+            测验结果:
+            <span style="font-size: 1rem;display: flex;align-items: center;">
+              <Timer style="width: 1em; height: 1em; margin-right: 8px"/>
+              {{ wqData.tm }}
+            </span>
+          </h3>
           <DataTag :data="wqData"></DataTag>
         </div>
       </card01>

+ 10 - 4
vite.config.ts

@@ -28,15 +28,15 @@ export default defineConfig({
       },
       '/gx_api': {
         // 共享平台
-        target: 'http://10.8.4.136:8881/api/sz/tba-gx/',
+        target: 'http://10.8.4.136:8881/api/',
         changeOrigin: true,
         rewrite: path => path.replace(/^\/gx_api/, '')
       },
-      '/gx_gj_api': {
+      '/szybh_api': {
         // 共享平台
-        target: 'http://10.8.4.136:8881/api/sq_zh/',
+        target: 'http://10.8.4.135:8083/',
         changeOrigin: true,
-        rewrite: path => path.replace(/^\/gx_gj_api/, '')
+        rewrite: path => path.replace(/^\/szybh_api/, '')
       },
       '/lantai': {
         // 共享平台
@@ -56,6 +56,12 @@ export default defineConfig({
         changeOrigin: true,
         rewrite: path => path.replace(/^\/video_api/, '')
       },
+      '/tsq_api': {
+        // 地听视频
+        target: 'http://10.8.251.166:8001/',
+        changeOrigin: true,
+        rewrite: path => path.replace(/^\/tsq_api/, '')
+      },
     }
   },
   plugins: [