|
@@ -4,6 +4,10 @@ import {useAppStore} from '@/stores/app'
|
|
import {useTimeScrollbarStore} from '@/stores/timeScrollbar'
|
|
import {useTimeScrollbarStore} from '@/stores/timeScrollbar'
|
|
import {useStationStore} from "@/stores/station";
|
|
import {useStationStore} from "@/stores/station";
|
|
import {extractList} from "../list";
|
|
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 waterLevel = "";
|
|
let waterSpeed = "";
|
|
let waterSpeed = "";
|
|
@@ -137,6 +141,16 @@ export function setPointState(stcd: any, name: string, type: string) {
|
|
}
|
|
}
|
|
|
|
|
|
export async function addTyphoonTrack(tfid: 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 appStore = useAppStore()
|
|
const timeScrollbarStore = useTimeScrollbarStore()
|
|
const timeScrollbarStore = useTimeScrollbarStore()
|
|
appStore.changeCurrentView("台风")
|
|
appStore.changeCurrentView("台风")
|
|
@@ -163,6 +177,26 @@ export async function addTyphoonTrack(tfid: string) {
|
|
|
|
|
|
let time = ''
|
|
let time = ''
|
|
timeScrollbarStore.sliderlTooltip = (value: number) => {
|
|
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) {
|
|
if (timeList[value].substring(0, 10) != time) {
|
|
time = timeList[value].substring(0, 10)
|
|
time = timeList[value].substring(0, 10)
|
|
bus.emit('chat', `汇报当前时间 ${time} 台风情况,太湖局应该如何响应,回复内容简单明了,条理清晰,通俗易懂,字数限制200字。如果没有信息就返回null。 台风信息如下:${JSON.stringify(typhoonData.points[value])}`)
|
|
bus.emit('chat', `汇报当前时间 ${time} 台风情况,太湖局应该如何响应,回复内容简单明了,条理清晰,通俗易懂,字数限制200字。如果没有信息就返回null。 台风信息如下:${JSON.stringify(typhoonData.points[value])}`)
|
|
@@ -215,6 +249,8 @@ export function deleteTyphoonTrack(tfid: string) {
|
|
}
|
|
}
|
|
Bus.emit('emitUIInteraction', descriptor);
|
|
Bus.emit('emitUIInteraction', descriptor);
|
|
console.log("-- 删除台风路径:", JSON.stringify(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);
|
|
Bus.emit('emitUIInteraction', descriptor);
|
|
console.log("-- 太湖湖面图层:", JSON.stringify(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));
|
|
|
|
+}
|