linqilong 4 هفته پیش
والد
کامیت
04db6868ad

+ 7 - 7
src/components/RightFrame.vue

@@ -32,14 +32,14 @@ function convertSidebar(modelName) {
 
 
 watch(
-    () => slots.leftModule,
-    (val): void => {
-      if (!val) {
-        leftSidebarShow.value = false
-      }
-    }, {immediate: true}
+  () => slots.leftModule,
+  (val): void => {
+    if (!val) {
+      leftSidebarShow.value = false
+    }
+  }, {immediate: true}
 )
-bus.on('horizontal-expand', (data) => {
+bus.on('horizontal-expand', (data: boolean) => {
   leftSidebarShow.value = data
   rightSidebarShow.value = data
 })

+ 1 - 2
src/components/StationRightButtonGroup.vue

@@ -249,7 +249,7 @@ function handleWavesChange(type) {
     wavesValue.value = '无'
   } else {
     wavesValue.value = type
-    const dateString = "20250519" // TODO formatd(new Date(), "yyyyMMdd")
+    const dateString = formatd(new Date(), "yyyyMMdd")  // TODO "20250519"
 
     const timeList = generateTimeList(dateString + '01', 3, 1);
     const timeScrollbarStore = useTimeScrollbarStore()
@@ -268,7 +268,6 @@ function handleWavesChange(type) {
     }
     timeScrollbarStore.setMarks(timeObj)
     timeScrollbarStore.sliderlTooltip = (value: number) => {
-      debugger
       Layer.taihuForecast(type, formatd(parseTime(timeList[value]), 'yyyy-MM-dd_hh_mm_ss'))
       return formatd(parseTime(timeList[value]), 'yyyy年MM月dd日hh时')
     }

+ 1 - 0
src/permission.ts

@@ -19,6 +19,7 @@ router.beforeEach((to, from, next) => {
     } else {
       // 否则全部重定向到登录页
       window.location.href = 'http://10.8.11.123:8089/cas/login?service=http://10.8.11.98:9888/check'
+      // window.location.href = 'http://10.8.11.123:8089/cas/login?service=http://localhost/check'
     }
   }
 });

+ 7 - 1
src/utils/slopeCalculation.ts

@@ -19,9 +19,15 @@ export function slopeCalculation(data: any[]) {
       `${result.a.toFixed(6)}x + ${result.b.toFixed(6)}y + ${result.c.toFixed(2)}`);
     console.log("坡度:", result.slope.toFixed(6), "米/经度纬度单位");
     console.log("倾斜方向:", result.direction.toFixed(2) + "°(0°为正东,逆时针方向)");
+
+    let max = data.map(a => a.value).reduce((acc, cur) => Math.max(acc, cur), Number.MIN_SAFE_INTEGER);
+    let min = data.map(a => a.value).reduce((acc, cur) => Math.min(acc, cur));
+
     return {
       slope: result.slope.toFixed(6),
-      direction: result.direction.toFixed(2)
+      direction: result.direction.toFixed(2),
+      max: max,
+      min: min,
     }
   } catch (error: any) {
     console.error("计算失败:", error.message);

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

@@ -33,7 +33,6 @@ const hydrologicStationStcds = [...stationList.filter(s => s.stcd).map(s => s.st
 
 async function addHydrologicStationPoints() {
   await getHydrologicStation().then(res => {
-    debugger
     const list = res.data.filter((d: any) => hydrologicStationStcds.includes(d.stcd))
     const data = [...list.map((d: any) => {
       return {id: d.stnm, name: `${d.z}\n${d.stnm}`, type: "水文站", x: d.lgtd, y: d.lttd}

+ 0 - 1
src/utils/tdInstruction/layer.ts

@@ -86,7 +86,6 @@ function addWindField(type: string, time: string) {
 
   windy(time)
   windyIndex++
-  debugger
 }
 
 let windyIndex = 0

+ 52 - 0
src/utils/tdInstruction/operate.ts

@@ -4,6 +4,10 @@ import {useAppStore} from '@/stores/app'
 import {useTimeScrollbarStore} from '@/stores/timeScrollbar'
 import {useStationStore} from "@/stores/station";
 import {extractList} from "../list";
+import {stationList} from "@/assets/js/station";
+import {slopeCalculation} from "@/utils/slopeCalculation";
+import {getYuyanDataList} from "@/api/yuyan";
+import {convertDate} from "@/utils/date";
 
 let waterLevel = "";
 let waterSpeed = "";
@@ -137,6 +141,16 @@ export function setPointState(stcd: any, name: string, type: string) {
 }
 
 export async function addTyphoonTrack(tfid: string) {
+  let yuyanData: any[] = await getYuyanDataList("2025041714054696095")
+    .then(res => {
+      return res.data.map(item => {
+        return {
+          ...item,
+          YMDHM: convertDate(item.YMDHM)
+        }
+      })
+    })
+
   const appStore = useAppStore()
   const timeScrollbarStore = useTimeScrollbarStore()
   appStore.changeCurrentView("台风")
@@ -163,6 +177,26 @@ export async function addTyphoonTrack(tfid: string) {
 
   let time = ''
   timeScrollbarStore.sliderlTooltip = (value: number) => {
+    const date = new Date(timeList[value])
+    const list = yuyanData.filter(y => y.YMDHM.getTime() === date.getTime())
+    const data = list.map(d => {
+      let station = stationList.find(s => s.id === d.STCD)
+
+      if (!station) {
+        console.log(`未找到${d.STCD}`)
+      }
+
+      return {
+        value: `${(d.DATA).toFixed(2)}`,
+        x: station.lgtd,
+        y: station.lttd
+      }
+    })
+    if (data && data.length > 0) {
+      const res: any = slopeCalculation(data);
+      taihuUI(res.direction, res.slope, res.max, res.min);
+    }
+
     if (timeList[value].substring(0, 10) != time) {
       time = timeList[value].substring(0, 10)
       bus.emit('chat', `汇报当前时间 ${time} 台风情况,太湖局应该如何响应,回复内容简单明了,条理清晰,通俗易懂,字数限制200字。如果没有信息就返回null。 台风信息如下:${JSON.stringify(typhoonData.points[value])}`)
@@ -215,6 +249,8 @@ export function deleteTyphoonTrack(tfid: string) {
   }
   Bus.emit('emitUIInteraction', descriptor);
   console.log("-- 删除台风路径:", JSON.stringify(descriptor));
+
+  taihuUI('', '', '', '', false);
 }
 
 /**
@@ -257,3 +293,19 @@ export function strategyMap(direction: string, slope: string, show = true) {
   Bus.emit('emitUIInteraction', descriptor);
   console.log("-- 太湖湖面图层:", JSON.stringify(descriptor));
 }
+
+
+export function taihuUI(direction: string, slope: string, max: string, min: string, show = true) {
+  let descriptor = {
+    "command": "TaihuUI",
+    "data": {
+      "Direction": direction,
+      "Slope": slope,
+      "Max": max,
+      "Min": min,
+      "Display": show ? "true" : "false"
+    }
+  }
+  Bus.emit('emitUIInteraction', descriptor);
+  console.log("-- 台风太湖UI:", JSON.stringify(descriptor));
+}