From 049143a385168f3ff03c00146e2d7131a6c9da8d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 20 May 2026 17:25:06 +0700 Subject: [PATCH 1/3] fix: fetchCheckTime fetchCheckStatus --- src/components/AscGISMap.vue | 43 ++++++++++++++++++++++++++++-------- src/views/HomeView.vue | 26 ++++++++++------------ 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/components/AscGISMap.vue b/src/components/AscGISMap.vue index ec1eb0b..bfe0e9c 100644 --- a/src/components/AscGISMap.vue +++ b/src/components/AscGISMap.vue @@ -163,8 +163,19 @@ function reattachAndResizeMap(retry = 0) { mapView.value.container = activeContainer } - mapView.value.resize() - mapView.value.requestRender?.() + // เรียก resize() อย่างปลอดภัยด้วยการตรวจสอบว่ามี method นี้หรือไม่ + try { + if (typeof mapView.value.resize === 'function') { + mapView.value.resize() + } + } catch (error) { + console.warn('Map resize failed:', error) + } + + if (typeof mapView.value.requestRender === 'function') { + mapView.value.requestRender?.() + } + mapView.value .goTo( { @@ -285,7 +296,11 @@ async function initializeMap() { geometry: userPoint, symbol: userSymbol, }) - mapView.value.graphics.add(userGraphic) + + // เพิ่มการตรวจสอบความปลอดภัยก่อนเข้าถึง graphics + if (mapView.value && mapView.value.graphics && !mapView.value.destroyed) { + mapView.value.graphics.add(userGraphic) + } // Get POI place ยิงไปขอที่ server ของกทม.ก่อน // await axios // .get( @@ -381,12 +396,22 @@ async function initializeMap() { geometry: poiPoint, symbol: poiSymbol, }) - mapView.value.graphics.add(poiGraphic) - // อัปเดตการแสดงผลให้แสดงทั้งตำแหน่งของผู้ใช้และ POI - mapView.value.goTo({ - target: [userPoint, poiPoint], - zoom: zoomMap.value, - }) + + // เพิ่มการตรวจสอบความปลอดภัยก่อนเข้าถึง graphics และ goTo + if (mapView.value && !mapView.value.destroyed) { + if (mapView.value.graphics) { + mapView.value.graphics.add(poiGraphic) + } + // อัปเดตการแสดงผลให้แสดงทั้งตำแหน่งของผู้ใช้และ POI + if (typeof mapView.value.goTo === 'function') { + mapView.value.goTo({ + target: [userPoint, poiPoint], + zoom: zoomMap.value, + }).catch(() => { + // Ignore goTo errors + }) + } + } updateLocation(latitude, longitude, poiPlaceName.value) }) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index b5ffaa2..3d1a5bb 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -638,19 +638,18 @@ async function fetchCheckStatus() { /** inQueue เป็น true */ isDisabledCheckTime.value = true msgCheckTime.value = 'ระบบกำลังประมวลผล' - if (intervalId.value === undefined) { - intervalId.value = setInterval(async () => { - try { - await fetchCheckStatus() - } catch (error) { - console.error('Error in interval fetchCheckStatus:', error) - // หยุด interval ถ้าเกิด error - stopChecking() - } - }, 3000) - console.log('startChecking called, intervalId:', intervalId.value) - } - // hideLoader() + // if (intervalId.value === undefined) { + // intervalId.value = setInterval(async () => { + // try { + // await fetchCheckStatus() + // } catch (error) { + // console.error('Error in interval fetchCheckStatus:', error) + // // หยุด interval ถ้าเกิด error + // stopChecking() + // } + // }, 3000) + // console.log('startChecking called, intervalId:', intervalId.value) + // } } else { /** inQueue เป็น false */ isDisabledCheckTime.value = false @@ -1126,7 +1125,6 @@ async function onClickConfirm() { if (!statusCheckin.value) { statusCheckin.value = true } - await startChecking() } finally { hideLoader() } From ef5e6d901725d040985c987e38dc6d21b7b1e04b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 21 May 2026 09:00:40 +0700 Subject: [PATCH 2/3] fix: startChecking onClickConfirm Dialog --- src/views/HomeView.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 3d1a5bb..8485b25 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1125,6 +1125,7 @@ async function onClickConfirm() { if (!statusCheckin.value) { statusCheckin.value = true } + await startChecking() } finally { hideLoader() } From 5c05df26cf4b93dd0ee32ffbf3cf193738a5f990 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 25 May 2026 15:49:56 +0700 Subject: [PATCH 3/3] fix(camera): btn refreshPhoto --- src/views/HomeView.vue | 76 ++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 8485b25..84a3e77 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1413,13 +1413,13 @@ watch(notificationCounter, () => { -
+
{ @click="switchCamera" /> { color="positive" @click="capturePhoto" /> +
+
+
+ + +
+
+
+ + +
+
{ style="background: #00000021" > - -
@@ -1549,13 +1562,13 @@ watch(notificationCounter, () => {
-
+
{ /> +
+
+ + +
+