From 23d6801f80ac13990dbd967bd8ceb98a96e6d7a8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 2 Sep 2024 17:37:08 +0700 Subject: [PATCH] refector code --- src/components/AscGISMap.vue | 9 +-- src/components/FormTime.vue | 122 +++++++++++++++++--------------- src/components/PopUp.vue | 33 ++++++--- src/components/TableHistory.vue | 102 ++++++++++++++++---------- src/components/ToolBar.vue | 53 +++++++++----- src/interface/index/Main.ts | 19 ++++- src/stores/chekin.ts | 3 +- src/views/HistoryView.vue | 121 +++++++++++++++---------------- src/views/HomeView.vue | 93 ++++++++++++++++-------- 9 files changed, 338 insertions(+), 217 deletions(-) diff --git a/src/components/AscGISMap.vue b/src/components/AscGISMap.vue index 4678ab2..0433376 100644 --- a/src/components/AscGISMap.vue +++ b/src/components/AscGISMap.vue @@ -2,17 +2,18 @@ import { onMounted, ref } from 'vue' import { loadModules } from 'esri-loader' import axios from 'axios' + import type { LocationObject } from '@/interface/index/Main' const emit = defineEmits(['update:location']) -function updateLocation(latitude: any, longitude: any, namePOI: string) { +function updateLocation(latitude: number, longitude: number, namePOI: string) { // ส่ง event ไปยัง parent component เพื่ออัพเดทค่า props emit('update:location', latitude, longitude, namePOI) } -const currentPosition = ref() -const poiPlaceName = ref('') +const currentPosition = ref() //ตำแหน่งปัจจุบัน +const poiPlaceName = ref('') // ชื่อพื้นที่ใกล้เคียง // Replace ArcGIS api key const apiKey = ref( @@ -123,7 +124,7 @@ async function initializeMap() { } onMounted(async () => { - initializeMap() + await initializeMap() }) diff --git a/src/components/FormTime.vue b/src/components/FormTime.vue index 4c10ec1..e433642 100644 --- a/src/components/FormTime.vue +++ b/src/components/FormTime.vue @@ -1,24 +1,32 @@