From 748b8e7aa7c63d89cf92745f5044b5ddf9ab4cf1 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 26 Oct 2023 16:42:47 +0700 Subject: [PATCH 1/2] =?UTF-8?q?UI=20=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=87=E0=B9=80=E0=B8=A7=E0=B8=A5?= =?UTF-8?q?=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interface/request/main/main.ts | 10 +- .../components/3_WorkTime/DialogForm.vue | 216 ++++++++++++++++++ .../components/3_WorkTime/MainPage.vue | 211 +++++++++++++++++ .../09_leave/interface/request/workTime.ts | 21 ++ src/modules/09_leave/router.ts | 11 + src/modules/09_leave/stores/WorkTimeStore.ts | 117 ++++++++++ .../2_InvestigateFacts/MainPage.vue | 4 +- 7 files changed, 586 insertions(+), 4 deletions(-) create mode 100644 src/modules/09_leave/components/3_WorkTime/DialogForm.vue create mode 100644 src/modules/09_leave/components/3_WorkTime/MainPage.vue create mode 100644 src/modules/09_leave/interface/request/workTime.ts create mode 100644 src/modules/09_leave/stores/WorkTimeStore.ts diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index a0b52f8d0..7571508d3 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -378,18 +378,24 @@ const menuList = readonly([ children: [ { key: 9.1, + label: "รอบการปฏิบัติงาน", + path: "/working-time", + role: "leave", + }, + { + key: 9.2, label: "รายการลงเวลาปฏิบัติงาน", path: "/work-list", role: "leave", }, { - key: 9.2, + key: 9.3, label: "รายการลา", path: "/leave-list", role: "leave", }, { - key: 9.3, + key: 9.4, label: "รายงานสถิติ", path: "/statistics-report", role: "leave", diff --git a/src/modules/09_leave/components/3_WorkTime/DialogForm.vue b/src/modules/09_leave/components/3_WorkTime/DialogForm.vue new file mode 100644 index 000000000..1cd0e7aaf --- /dev/null +++ b/src/modules/09_leave/components/3_WorkTime/DialogForm.vue @@ -0,0 +1,216 @@ + + + + diff --git a/src/modules/09_leave/components/3_WorkTime/MainPage.vue b/src/modules/09_leave/components/3_WorkTime/MainPage.vue new file mode 100644 index 000000000..859550277 --- /dev/null +++ b/src/modules/09_leave/components/3_WorkTime/MainPage.vue @@ -0,0 +1,211 @@ + + + diff --git a/src/modules/09_leave/interface/request/workTime.ts b/src/modules/09_leave/interface/request/workTime.ts new file mode 100644 index 000000000..ebffb8c71 --- /dev/null +++ b/src/modules/09_leave/interface/request/workTime.ts @@ -0,0 +1,21 @@ +interface workingTimeDataRowType { + morning: string + morningEnd: string + afternoon: string + afternoonEnd: string + reason: string + status: number +} + +interface formData { + morning:string + morningEnd:string + afternoon:string + afternoonEnd:string + reason:string + status:boolean +} +export type { + workingTimeDataRowType, + formData +} \ No newline at end of file diff --git a/src/modules/09_leave/router.ts b/src/modules/09_leave/router.ts index 936a99a6a..1f90e0b96 100644 --- a/src/modules/09_leave/router.ts +++ b/src/modules/09_leave/router.ts @@ -3,6 +3,7 @@ const workMain = () => import("@/modules/09_leave/views/WorkingMain.vue") const leaveMain = () => import("@/modules/09_leave/views/LeaveListMain.vue"); const reportMain = () => import("@/modules/09_leave/views/ReportMain.vue") const leaveDetail = () => import("@/modules//09_leave/components/2_Leave/DetailLeave.vue") +const workingtime = () => import('@/modules/09_leave/components/3_WorkTime/MainPage.vue') export default [ { @@ -45,5 +46,15 @@ export default [ Role: "coin", }, }, + { + path: "/workingtime", + name: "/working-time", + component: workingtime, + meta: { + Auth: true, + Key: [9], + Role: "coin", + }, + }, ] \ No newline at end of file diff --git a/src/modules/09_leave/stores/WorkTimeStore.ts b/src/modules/09_leave/stores/WorkTimeStore.ts new file mode 100644 index 000000000..778469448 --- /dev/null +++ b/src/modules/09_leave/stores/WorkTimeStore.ts @@ -0,0 +1,117 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { QTableProps } from "quasar"; +import type { workingTimeDataRowType } from '@/modules/09_leave/interface/request/workTime' + +export const useWorkTimeStore = defineStore("WorkTimeStore", () => { + const rows = ref([]) + + const visibleColumns = ref([ + "round", + "morning", + "morningEnd", + "afternoon", + "afternoonEnd", + "reason", + "status", + ]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง + + // หัวตาราง + const columns = ref([ + + { + name: "round", + align: "left", + label: "รอบ", + sortable: true, + field: "round", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "morning", + align: "left", + label: "รอบเช้า", + sortable: true, + field: "morning", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "morningEnd", + align: "left", + label: "รอบออก", + sortable: true, + field: "morningEnd", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "afternoon", + align: "left", + label: "รอบบ่าย", + sortable: true, + field: "afternoon", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "afternoonEnd", + align: "left", + label: "รอบออก", + sortable: true, + field: "afternoonEnd", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "reason", + align: "left", + label: "คำอธิบาย", + sortable: true, + field: "reason", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "status", + align: "center", + label: "สถานะการใช้งาน", + sortable: false, + field: "status", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + ]); + function fecthList(data: workingTimeDataRowType[]) { + let datalist: workingTimeDataRowType[] = data.map((e: workingTimeDataRowType) => { + return { + round:`${e.morning}-${e.afternoonEnd}`, + morning: e.morning, + morningEnd: e.morningEnd, + afternoon: e.afternoon, + afternoonEnd: e.afternoonEnd, + reason: e.reason === '' ? '-':e.reason, + status: e.status, + }; + }); + rows.value = datalist; + } + + return { + fecthList, + rows, + visibleColumns, + columns + }; +}) \ No newline at end of file diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue index cc1a92d0f..8f038ca43 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue @@ -49,8 +49,8 @@ const paginationLabel = (start: string, end: string, total: string) => { const clickAdd = () => { router.push(`/discipline/investigatefacts/add`); }; -onMounted(() => { - fecthList([ +onMounted(async() => { + await fecthList([ { subject: "ทุจริตในหน้าที่", interrogated: "ศิรินภา คงน้อยี่", From fea2d8f972a1be3128822d3b2030f238f1989f60 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 26 Oct 2023 16:55:20 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20UI?= =?UTF-8?q?=20-=20=E0=B8=AA=E0=B8=B7=E0=B8=9A=E0=B8=AA=E0=B8=A7=E0=B8=99?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B9=80=E0=B8=97=E0=B9=87=E0=B8=88?= =?UTF-8?q?=E0=B8=88=E0=B8=A3=E0=B8=B4=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/2_InvestigateFacts/MainPage.vue | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue index 8f038ca43..72eb8c80f 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue @@ -34,17 +34,13 @@ const resetFilter = () => { }; const attrs = ref(useAttrs()); -const paging = ref(true); const pagination = ref({ // sortBy: "desc", descending: false, page: 1, rowsPerPage: 10, }); -const paginationLabel = (start: string, end: string, total: string) => { - if (paging.value == true) return " " + start + "-" + end + " ใน " + total; - else return start + "-" + end + " ใน " + total; -}; + const clickAdd = () => { router.push(`/discipline/investigatefacts/add`); @@ -156,7 +152,6 @@ onMounted(async() => { class="custom-header-table" v-bind="attrs" :visible-columns="dataInvestigate.visibleColumns" - :pagination-label="paginationLabel" v-model:pagination="pagination" >