fix
This commit is contained in:
parent
b010d69b99
commit
80c74b338b
@ -33,6 +33,9 @@ const apiKey = import.meta.env.VITE_AMAP_API_KEY
|
|||||||
const { options, currentFocus, getImageUrl, getHeatPoints } = useOptions()
|
const { options, currentFocus, getImageUrl, getHeatPoints } = useOptions()
|
||||||
|
|
||||||
watch(options, async () => {
|
watch(options, async () => {
|
||||||
|
await updateMap()
|
||||||
|
})
|
||||||
|
async function updateMap() {
|
||||||
if (!map || !amapInstance) {
|
if (!map || !amapInstance) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -48,8 +51,7 @@ watch(options, async () => {
|
|||||||
if (mode === 'image') {
|
if (mode === 'image') {
|
||||||
await updateMapImage()
|
await updateMapImage()
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
watch(currentFocus, (newFocus) => {
|
watch(currentFocus, (newFocus) => {
|
||||||
if (!newFocus) {
|
if (!newFocus) {
|
||||||
return
|
return
|
||||||
@ -157,6 +159,8 @@ onMounted(async () => {
|
|||||||
})
|
})
|
||||||
infoWindow.open(map!, e.lnglat)
|
infoWindow.open(map!, e.lnglat)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await updateMap()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
parseDate,
|
parseDate,
|
||||||
} from '@internationalized/date'
|
} from '@internationalized/date'
|
||||||
|
|
||||||
const df = new DateFormatter('en-US', {
|
const df = new DateFormatter('zh-CN', {
|
||||||
dateStyle: 'long',
|
dateStyle: 'long',
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -145,6 +145,7 @@ const isTargetDateDisabled = computed(() => {
|
|||||||
v-model="castBeginDate" class="z-300"
|
v-model="castBeginDate" class="z-300"
|
||||||
initial-focus :is-date-disabled="isDateDisabled"
|
initial-focus :is-date-disabled="isDateDisabled"
|
||||||
prevent-deselect
|
prevent-deselect
|
||||||
|
locale="zh-CN"
|
||||||
/>
|
/>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
@ -171,6 +172,7 @@ const isTargetDateDisabled = computed(() => {
|
|||||||
class="z-300" initial-focus
|
class="z-300" initial-focus
|
||||||
:is-date-disabled="isTargetDateDisabled"
|
:is-date-disabled="isTargetDateDisabled"
|
||||||
prevent-deselect
|
prevent-deselect
|
||||||
|
locale="zh-CN"
|
||||||
/>
|
/>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
const emit = defineEmits(['setFocus'])
|
||||||
|
|
||||||
const {
|
const {
|
||||||
currentTcLoc,
|
currentTcLoc,
|
||||||
currentFocus,
|
currentFocus,
|
||||||
@ -7,6 +9,7 @@ const {
|
|||||||
function jump(postion: [number, number]) {
|
function jump(postion: [number, number]) {
|
||||||
const getter = () => postion
|
const getter = () => postion
|
||||||
currentFocus.value = getter
|
currentFocus.value = getter
|
||||||
|
emit('setFocus')
|
||||||
}
|
}
|
||||||
function getPostionText(position: [number, number]) {
|
function getPostionText(position: [number, number]) {
|
||||||
const [x, y] = position
|
const [x, y] = position
|
||||||
@ -25,10 +28,8 @@ function getPostionText(position: [number, number]) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<fieldset class="grid gap-6 border rounded-lg p-4">
|
<fieldset class="grid gap-2 border rounded-lg p-4">
|
||||||
<legend class="px-1 text-sm font-medium -ml-1">
|
<Label class="px-2 pt-3 text-center">台风位置</Label>
|
||||||
预报台风
|
|
||||||
</legend>
|
|
||||||
<Table v-if="currentTcLoc">
|
<Table v-if="currentTcLoc">
|
||||||
<!-- <TableCaption>预报台风</TableCaption> -->
|
<!-- <TableCaption>预报台风</TableCaption> -->
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
@ -36,7 +37,7 @@ function getPostionText(position: [number, number]) {
|
|||||||
<TableHead>Lat </TableHead>
|
<TableHead>Lat </TableHead>
|
||||||
<TableHead>Lon</TableHead>
|
<TableHead>Lon</TableHead>
|
||||||
<TableHead class="text-right">
|
<TableHead class="text-right">
|
||||||
操作
|
操作
|
||||||
</TableHead>
|
</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
|
|||||||
@ -27,6 +27,7 @@ function _useOptions() {
|
|||||||
}
|
}
|
||||||
if (options.castDayNo >= 29) {
|
if (options.castDayNo >= 29) {
|
||||||
autoPlayer.pause()
|
autoPlayer.pause()
|
||||||
|
setTargetDate(castBeginDate.value!.add({ days: 1 }))
|
||||||
}
|
}
|
||||||
setTargetDate(castTargetDate.value!.add({ days: 1 }))
|
setTargetDate(castTargetDate.value!.add({ days: 1 }))
|
||||||
castTargetDate.value = castTargetDate.value?.add({ days: 1 })
|
castTargetDate.value = castTargetDate.value?.add({ days: 1 })
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import Colorbar from '../assets/colorbar.png'
|
|||||||
const { autoPlayer, options, castBeginDate, castTargetDate } = useOptions()
|
const { autoPlayer, options, castBeginDate, castTargetDate } = useOptions()
|
||||||
|
|
||||||
const isPlaying = ref(false)
|
const isPlaying = ref(false)
|
||||||
|
const posOpen = ref(false)
|
||||||
|
|
||||||
const dark = useDark()
|
const dark = useDark()
|
||||||
|
|
||||||
@ -77,30 +78,6 @@ function flipDark() {
|
|||||||
<img :src="Colorbar" mx-auto max-h="60px">
|
<img :src="Colorbar" mx-auto max-h="60px">
|
||||||
</div>
|
</div>
|
||||||
<div grid="~ cols-2 gap-4">
|
<div grid="~ cols-2 gap-4">
|
||||||
<Drawer class="z-100">
|
|
||||||
<DrawerTrigger as-child>
|
|
||||||
<Button size="icon" variant="outline" class="w-full md:hidden">
|
|
||||||
<span class="i-mingcute-typhoon-fill size-4" />
|
|
||||||
<span class="">台风列表</span>
|
|
||||||
</Button>
|
|
||||||
</DrawerTrigger>
|
|
||||||
<DrawerContent class="z-200 max-h-[80vh] p-5">
|
|
||||||
<DrawerHeader>
|
|
||||||
<DrawerTitle>台风列表</DrawerTitle>
|
|
||||||
<DrawerDescription>
|
|
||||||
点击可以跳转
|
|
||||||
</DrawerDescription>
|
|
||||||
</DrawerHeader>
|
|
||||||
<PosForm />
|
|
||||||
<DrawerClose as-child>
|
|
||||||
<div class="py-3">
|
|
||||||
<Button class="w-full">
|
|
||||||
取消
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</DrawerClose>
|
|
||||||
</DrawerContent>
|
|
||||||
</Drawer>
|
|
||||||
<Drawer class="z-100">
|
<Drawer class="z-100">
|
||||||
<DrawerTrigger as-child>
|
<DrawerTrigger as-child>
|
||||||
<Button size="icon" variant="outline" class="w-full md:hidden">
|
<Button size="icon" variant="outline" class="w-full md:hidden">
|
||||||
@ -125,6 +102,34 @@ function flipDark() {
|
|||||||
</DrawerClose>
|
</DrawerClose>
|
||||||
</DrawerContent>
|
</DrawerContent>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
<Drawer v-model:open="posOpen" class="z-100">
|
||||||
|
<DrawerTrigger as-child>
|
||||||
|
<Button size="icon" variant="outline" class="w-full md:hidden">
|
||||||
|
<span class="i-mingcute-typhoon-fill size-4" />
|
||||||
|
<span class="">台风列表</span>
|
||||||
|
</Button>
|
||||||
|
</DrawerTrigger>
|
||||||
|
<DrawerContent class="z-200 max-h-[80vh] p-5">
|
||||||
|
<DrawerHeader>
|
||||||
|
<DrawerTitle>台风列表</DrawerTitle>
|
||||||
|
<DrawerDescription>
|
||||||
|
点击可以跳转
|
||||||
|
</DrawerDescription>
|
||||||
|
</DrawerHeader>
|
||||||
|
<PosForm
|
||||||
|
@set-focus="() => {
|
||||||
|
posOpen = false
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<DrawerClose as-child>
|
||||||
|
<div class="py-3">
|
||||||
|
<Button class="w-full">
|
||||||
|
取消
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</DrawerClose>
|
||||||
|
</DrawerContent>
|
||||||
|
</Drawer>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user