diff --git a/package.json b/package.json index fe271a7..8405cf4 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "register-service-worker": "^1.7.2", "simple-vue-camera": "^1.1.3", "vite-plugin-pwa": "^0.16.7", - "vue": "^3.2.45", + "vue": "^3.4.15", "vue-router": "^4.1.6", "vue3-google-map": "^0.18.0" }, diff --git a/src/components/PopUp.vue b/src/components/PopUp.vue index 2955b22..2da62b5 100644 --- a/src/components/PopUp.vue +++ b/src/components/PopUp.vue @@ -41,7 +41,7 @@ watch( - + ([]) @@ -38,36 +35,6 @@ const props = defineProps({ defualt: '', required: true, }, - nornmalData: { - type: Boolean, - defualt: false, - }, - nextPageVisible: { - type: Boolean, - defualt: false, - }, - publicData: { - type: Boolean, - defualt: true, - required: false, - }, - updateData: { - type: Boolean, - defualt: true, - required: false, - }, - statusPayment: { - type: Boolean, - required: false, - }, - setSeat: { - type: Boolean, - required: false, - }, - publicNoBtn: { - type: Boolean, - defualt: false, - }, fetchData: { type: Function, default: () => console.log('not function'), @@ -121,71 +88,121 @@ async function filterFn() { } /** column history table */ -const columns = ref([ - { - name: 'checkInDate', - align: 'left', - label: 'วัน/เดือน/ปี', - sortable: true, - field: 'checkInDate', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:15%;', - }, - { - name: 'checkInTime', - align: 'left', - label: 'เวลาเข้างาน', - sortable: true, - field: 'checkInTime', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:15%;', - }, - { - name: 'checkInLocation', - align: 'left', - label: 'พิกัด', - sortable: true, - field: 'checkInLocation', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px', - }, - { - name: 'checkInStatus', - align: 'left', - label: 'สถานะช่วงเช้า', - sortable: true, - field: 'checkInStatus', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:15%;', - }, - { - name: 'checkOutTime', - align: 'left', - label: 'เวลาออกงาน', - sortable: true, - field: 'checkOutTime', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:15%;', - }, - { - name: 'checkOutLocation', - align: 'left', - label: 'พิกัด', - sortable: true, - field: 'checkOutLocation', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px', - }, - { - name: 'checkOutStatus', - align: 'left', - label: 'สถานะช่วงบ่าย', - sortable: true, - field: 'checkOutStatus', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:15%;', - }, -]) +const columns = ref( + props.tab == 'history' + ? [ + { + name: 'checkInDate', + align: 'left', + label: 'วัน/เดือน/ปี', + sortable: true, + field: 'checkInDate', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkInTime', + align: 'left', + label: 'เวลาเข้างาน', + sortable: true, + field: 'checkInTime', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkInLocation', + align: 'left', + label: 'พิกัด', + sortable: true, + field: 'checkInLocation', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px', + }, + { + name: 'checkInStatus', + align: 'left', + label: 'สถานะช่วงเช้า', + sortable: true, + field: 'checkInStatus', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkOutTime', + align: 'left', + label: 'เวลาออกงาน', + sortable: true, + field: 'checkOutTime', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkOutLocation', + align: 'left', + label: 'พิกัด', + sortable: true, + field: 'checkOutLocation', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px', + }, + { + name: 'checkOutStatus', + align: 'left', + label: 'สถานะช่วงบ่าย', + sortable: true, + field: 'checkOutStatus', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + ] + : [ + { + name: 'checkInDate', + align: 'left', + label: 'วัน/เดือน/ปี', + sortable: true, + field: 'checkInDate', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkInTime', + align: 'left', + label: 'เวลาเข้างาน', + sortable: true, + field: 'checkInTime', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkInLocation', + align: 'left', + label: 'พิกัด', + sortable: true, + field: 'checkInLocation', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px', + }, + { + name: 'checkOutTime', + align: 'left', + label: 'เวลาออกงาน', + sortable: true, + field: 'checkOutTime', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkOutLocation', + align: 'left', + label: 'พิกัด', + sortable: true, + field: 'checkOutLocation', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px', + }, + ] +) const visibleColumns = ref([ 'checkInDate', 'checkInTime', diff --git a/src/interface/response/Main.ts b/src/interface/response/Main.ts index b3a1426..574f78b 100644 --- a/src/interface/response/Main.ts +++ b/src/interface/response/Main.ts @@ -5,7 +5,7 @@ interface Noti { type: string payload: null isOpen: false - receiveDate: Date | null + receiveDate: Date openDate: null createdFullName: string } diff --git a/src/views/HistoryView.vue b/src/views/HistoryView.vue index 9116822..3cbf114 100644 --- a/src/views/HistoryView.vue +++ b/src/views/HistoryView.vue @@ -47,10 +47,7 @@ function functionFetch() { stores.tab === 'history' ? fetchlistHistory() : fetchlistTime() } -/** - * ฟังก์ชั่นดึงข้อมูลรายการประวัติการลงเวลาจาก api มาแสดง - * @param loading แสดง loading ไหม true คือแสดง, false คือไม่แสดง - */ +/*** ฟังก์ชั่นดึงข้อมูลรายการประวัติการลงเวลาจาก api มาแสดง */ async function fetchlistHistory() { showLoader() await http @@ -74,6 +71,7 @@ async function fetchlistHistory() { }) } +/** ฟังก์ชั่นดึงรายการลงเวลากรณีพิเศษ */ async function fetchlistTime() { showLoader() await http @@ -124,6 +122,7 @@ watch( } ) + @@ -211,4 +210,4 @@ watch( - + \ No newline at end of file diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 900305a..ec75625 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,20 +1,12 @@ + @@ -351,6 +357,7 @@ onMounted(async () => { +