diff --git a/src/components/AscGISMap.vue b/src/components/AscGISMap.vue index 72192fc..001e79e 100644 --- a/src/components/AscGISMap.vue +++ b/src/components/AscGISMap.vue @@ -136,7 +136,7 @@ onMounted(async () => { -
+
import { ref, reactive, onMounted } from 'vue' import { useRouter } from 'vue-router' import { useQuasar } from 'quasar' +import keycloak from '@/plugins/keycloak' import moment from 'moment' import Camera from 'simple-vue-camera' import http from '@/plugins/http' import config from '@/app.config' -import keycloak from '@/plugins/keycloak' // import Type import type { FormRef } from '@/interface/response/checkin' -import type { Noti } from '@/interface/response/Main' import type { notiType } from '@/interface/index/Main' // import components -import MapCheck from '@/components/MapCheckin.vue' -// import AscMaps from '@/components/AscMaps.vue' +import MapCheck from '@/components/AscGISMap.vue' // import Stores import { useCounterMixin } from '@/stores/mixin' @@ -140,9 +139,9 @@ const checkInId = ref('') //Id ลงเวลา check-in ล่าส * @param location พิกัดละติจูด พิกัดลองติจูด * @param namePOI ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ */ -async function updateLocation(location: any, namePOI: string) { - formLocation.lat = location.lat - formLocation.lng = location.lng +async function updateLocation(latitude: any, longitude: any, namePOI: string) { + formLocation.lat = latitude + formLocation.lng = longitude formLocation.POI = namePOI } @@ -246,6 +245,7 @@ function validateForm() { const timeChickin = ref() /** function ยืนยันการลงเวลาเข้า - ออก*/ async function confirm() { + showLoader() const isLocation = workplace.value === 'in-place' //*true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง const formdata = new FormData() formdata.append('lat', formLocation.lat.toString()) @@ -277,6 +277,9 @@ async function confirm() { console.log(err) messageError($q, err) }) + .finally(() => { + hideLoader() + }) } async function onClickConfirm() { @@ -306,6 +309,7 @@ const getClass = (val: boolean) => { 'bg-red-9 text-white col-12 row items-center q-px-md q-py-sm': !val, } } + const fullName = ref('') /** Hook*/ onMounted(async () => { @@ -324,7 +328,7 @@ onMounted(async () => {
- +
{ :class="$q.screen.gt.xs ? 'q-px-md' : ''" @click="router.push('/history')" /> - - - ลงเวลาเข้างาน - ลงเวลาออกงาน - - - - - - {{ notiList.length }} - -
-
- การแจ้งเตือน -
-
- - - - - - {{ - n.sender - }} - - - - {{ - n.body - }} - {{ date2Thai(n.timereceive) }} - - - - - -
-
- - - -
- - - - - - - {{ fullName }} - - - - - - - - - -
-
-
- - - - +
@@ -767,6 +662,9 @@ onMounted(async () => {
+
+ พื้นที่ใกล้เคียง {{ formLocation.POI ?? formLocation.POI }} +
{{ location }}
@@ -803,7 +701,7 @@ onMounted(async () => { .card-container { position: relative; overflow: hidden; - height: 350px; /* Adjust as needed */ + height: 39vh; /* Adjust as needed */ background: #f6f5f5; } .image-container { @@ -825,4 +723,4 @@ onMounted(async () => { width: 100%; height: 100%; } - + \ No newline at end of file diff --git a/src/views/MapView.vue b/src/views/MapView.vue index 4cfb15e..d4db139 100644 --- a/src/views/MapView.vue +++ b/src/views/MapView.vue @@ -2,18 +2,20 @@ import { ref, reactive, onMounted } from 'vue' import { useRouter } from 'vue-router' import { useQuasar } from 'quasar' -import keycloak from '@/plugins/keycloak' import moment from 'moment' import Camera from 'simple-vue-camera' import http from '@/plugins/http' import config from '@/app.config' +import keycloak from '@/plugins/keycloak' // import Type import type { FormRef } from '@/interface/response/checkin' +import type { Noti } from '@/interface/response/Main' import type { notiType } from '@/interface/index/Main' // import components -import MapCheck from '@/components/AscGISMap.vue' +import MapCheck from '@/components/MapCheckin.vue' +// import AscMaps from '@/components/AscMaps.vue' // import Stores import { useCounterMixin } from '@/stores/mixin' @@ -138,9 +140,9 @@ const checkInId = ref('') //Id ลงเวลา check-in ล่าส * @param location พิกัดละติจูด พิกัดลองติจูด * @param namePOI ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ */ -async function updateLocation(latitude: any, longitude: any, namePOI: string) { - formLocation.lat = latitude - formLocation.lng = longitude +async function updateLocation(location: any, namePOI: string) { + formLocation.lat = location.lat + formLocation.lng = location.lng formLocation.POI = namePOI } @@ -244,7 +246,6 @@ function validateForm() { const timeChickin = ref() /** function ยืนยันการลงเวลาเข้า - ออก*/ async function confirm() { - showLoader() const isLocation = workplace.value === 'in-place' //*true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง const formdata = new FormData() formdata.append('lat', formLocation.lat.toString()) @@ -276,9 +277,6 @@ async function confirm() { console.log(err) messageError($q, err) }) - .finally(() => { - hideLoader() - }) } async function onClickConfirm() { @@ -308,7 +306,6 @@ const getClass = (val: boolean) => { 'bg-red-9 text-white col-12 row items-center q-px-md q-py-sm': !val, } } - const fullName = ref('') /** Hook*/ onMounted(async () => { @@ -327,7 +324,7 @@ onMounted(async () => {
-
+ { :class="$q.screen.gt.xs ? 'q-px-md' : ''" @click="router.push('/history')" /> -
- + + + ลงเวลาเข้างาน + ลงเวลาออกงาน + + + + + + {{ notiList.length }} + +
+
+ การแจ้งเตือน +
+
+ + + + + + {{ + n.sender + }} + + + + {{ + n.body + }} + {{ date2Thai(n.timereceive) }} + + + + + +
+
+ + + +
+ + + + + + + {{ fullName }} + + + + + + + + + +
+
+
+ + + +
@@ -719,4 +825,4 @@ onMounted(async () => { width: 100%; height: 100%; } - + \ No newline at end of file