|
@@ -52,19 +52,20 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { computed, getCurrentInstance } from 'vue';
|
|
|
|
|
|
|
+import { computed } from 'vue';
|
|
|
import { useTheme } from '@/components/theme/ThemeDefine';
|
|
import { useTheme } from '@/components/theme/ThemeDefine';
|
|
|
import NoticeBar from '@/components/display/NoticeBar.vue';
|
|
import NoticeBar from '@/components/display/NoticeBar.vue';
|
|
|
import type { MapMarker } from '@/types/Map';
|
|
import type { MapMarker } from '@/types/Map';
|
|
|
import ImagesUrls from '@/common/config/ImagesUrls';
|
|
import ImagesUrls from '@/common/config/ImagesUrls';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import Text from '@/components/basic/Text.vue';
|
|
import Text from '@/components/basic/Text.vue';
|
|
|
|
|
+import { isValidLonLat, type LonLat } from '../composeabe/LonLat';
|
|
|
|
|
|
|
|
const emit = defineEmits(['getedCurrentLonlat']);
|
|
const emit = defineEmits(['getedCurrentLonlat']);
|
|
|
const props = withDefaults(defineProps<{
|
|
const props = withDefaults(defineProps<{
|
|
|
markers?: MapMarker[];
|
|
markers?: MapMarker[];
|
|
|
currentNoticeContent?: string;
|
|
currentNoticeContent?: string;
|
|
|
- lonlat?: { longitude: number, latitude: number } | undefined;
|
|
|
|
|
|
|
+ lonlat?: LonLat| undefined;
|
|
|
}>(), {
|
|
}>(), {
|
|
|
currentNoticeContent: '目前厦门市已被点亮一个社区,刚刚小亮贡献了10个光源,让湖里区点亮了一个社区',
|
|
currentNoticeContent: '目前厦门市已被点亮一个社区,刚刚小亮贡献了10个光源,让湖里区点亮了一个社区',
|
|
|
lonlat: () => ({
|
|
lonlat: () => ({
|
|
@@ -74,11 +75,7 @@ const props = withDefaults(defineProps<{
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const isValidLonlat = computed(() => {
|
|
const isValidLonlat = computed(() => {
|
|
|
- return (
|
|
|
|
|
- props.lonlat && props.lonlat.longitude && props.lonlat.latitude &&
|
|
|
|
|
- !isNaN(props.lonlat.longitude) && !isNaN(props.lonlat.latitude) &&
|
|
|
|
|
- props.lonlat.longitude > -180 && props.lonlat.longitude < 180 && props.lonlat.latitude > -90 && props.lonlat.latitude < 90
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ return (!isValidLonLat(props.lonlat));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const themeContext = useTheme();
|
|
const themeContext = useTheme();
|