From 80c74b338b62516308f898d5ae87ffd6b1dce833 Mon Sep 17 00:00:00 2001 From: Dustella Date: Thu, 13 Feb 2025 16:17:45 +0800 Subject: [PATCH] fix --- src/components/AMapClient.vue | 8 ++++-- src/components/OptForm.vue | 4 ++- src/components/PosForm.vue | 11 ++++---- src/composables/dateOpt.ts | 1 + src/layouts/map.vue | 53 +++++++++++++++++++---------------- 5 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/components/AMapClient.vue b/src/components/AMapClient.vue index 3a3b5d8..92db04d 100644 --- a/src/components/AMapClient.vue +++ b/src/components/AMapClient.vue @@ -33,6 +33,9 @@ const apiKey = import.meta.env.VITE_AMAP_API_KEY const { options, currentFocus, getImageUrl, getHeatPoints } = useOptions() watch(options, async () => { + await updateMap() +}) +async function updateMap() { if (!map || !amapInstance) { return } @@ -48,8 +51,7 @@ watch(options, async () => { if (mode === 'image') { await updateMapImage() } -}) - +} watch(currentFocus, (newFocus) => { if (!newFocus) { return @@ -157,6 +159,8 @@ onMounted(async () => { }) infoWindow.open(map!, e.lnglat) }) + + await updateMap() } }) diff --git a/src/components/OptForm.vue b/src/components/OptForm.vue index dd0967f..9edbca2 100644 --- a/src/components/OptForm.vue +++ b/src/components/OptForm.vue @@ -9,7 +9,7 @@ import { parseDate, } from '@internationalized/date' -const df = new DateFormatter('en-US', { +const df = new DateFormatter('zh-CN', { dateStyle: 'long', }) @@ -145,6 +145,7 @@ const isTargetDateDisabled = computed(() => { v-model="castBeginDate" class="z-300" initial-focus :is-date-disabled="isDateDisabled" prevent-deselect + locale="zh-CN" /> @@ -171,6 +172,7 @@ const isTargetDateDisabled = computed(() => { class="z-300" initial-focus :is-date-disabled="isTargetDateDisabled" prevent-deselect + locale="zh-CN" /> diff --git a/src/components/PosForm.vue b/src/components/PosForm.vue index 20fab51..80ed212 100644 --- a/src/components/PosForm.vue +++ b/src/components/PosForm.vue @@ -1,4 +1,6 @@