From 32215357481dc52ad6a153bdce6ad9f3ed3480ff Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 21 May 2024 18:08:38 +0700 Subject: [PATCH] =?UTF-8?q?responsive=20=E0=B8=A3=E0=B8=B0=E0=B8=9A?= =?UTF-8?q?=E0=B8=9A=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2,?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=E0=B8=A5=E0=B8=B2=E0=B8=AD?= =?UTF-8?q?=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableD.vue | 24 +- src/modules/03_retire/views/addRetire.vue | 6 +- src/modules/03_retire/views/main.vue | 72 +- .../05_leave/components/DialogDetail.vue | 960 +++++++++--------- src/modules/05_leave/components/ListView.vue | 555 ++++++---- src/modules/05_leave/components/Table.vue | 7 +- .../components/formDetail/01_SickForm.vue | 188 ++-- .../formDetail/04_HelpWifeBirthForm.vue | 168 ++- .../components/formDetail/05_VacationForm.vue | 194 ++-- .../formDetail/06_OrdinationForm.vue | 202 ++-- .../components/formDetail/07_HajjForm.vue | 156 +-- .../components/formDetail/08_MilitaryForm.vue | 178 ++-- .../components/formDetail/09_StudyForm.vue | 224 ++-- .../components/formDetail/10_TrainForm.vue | 212 ++-- .../formDetail/11_WorkInternationalForm.vue | 168 ++- .../formDetail/12_FollowSpouseForm.vue | 234 ++--- .../formDetail/13_RehabilitationForm.vue | 156 ++- .../components/formDetail/formCancel.vue | 134 ++- .../components/formDetail/formMain.vue | 70 +- src/modules/05_leave/views/Main.vue | 87 +- src/views/MainLayout.vue | 55 +- 21 files changed, 2119 insertions(+), 1931 deletions(-) diff --git a/src/components/TableD.vue b/src/components/TableD.vue index 1c1fbdc..86a2ffd 100644 --- a/src/components/TableD.vue +++ b/src/components/TableD.vue @@ -10,6 +10,7 @@ dense :pagination-label="paginationLabel" v-model:pagination="pagination" + :grid="!$q.screen.gt.xs" > diff --git a/src/modules/05_leave/components/ListView.vue b/src/modules/05_leave/components/ListView.vue index 65a2628..08aba27 100644 --- a/src/modules/05_leave/components/ListView.vue +++ b/src/modules/05_leave/components/ListView.vue @@ -19,13 +19,13 @@ import { useLeaveStore } from "@/modules/05_leave/store"; /**ตัวแปรที่ใช้ */ const mixin = useCounterMixin(); const { - showLoader, - hideLoader, - messageError, - date2Thai, - monthYear2Thai, - dialogRemove, - success, + showLoader, + hideLoader, + messageError, + date2Thai, + monthYear2Thai, + dialogRemove, + success, } = mixin; const LeaveData = useLeaveStore(); const router = useRouter(); @@ -49,41 +49,41 @@ const pageSize = ref(10); /** function เรียกข้อมูลการลา*/ async function fetchDataTable() { - showLoader(); - const body = { - year: year.value, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.) - type: type.value, //*Id ประเภทการลา - status: status.value, //*สถานะการของลา - page: page.value.toString(), //*หน้า - pageSize: pageSize.value.toString(), //*จำนวนแถวต่อหน้า - keyword: filter.value, //keyword ค้นหา - }; - await http - .post(config.API.leaveTableList(), body) - .then((res) => { - const data = res.data.result.data; - LeaveData.fetchListLeave(data); - maxPage.value = Math.ceil(res.data.result.total / pageSize.value); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); + showLoader(); + const body = { + year: year.value, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.) + type: type.value, //*Id ประเภทการลา + status: status.value, //*สถานะการของลา + page: page.value.toString(), //*หน้า + pageSize: pageSize.value.toString(), //*จำนวนแถวต่อหน้า + keyword: filter.value, //keyword ค้นหา + }; + await http + .post(config.API.leaveTableList(), body) + .then((res) => { + const data = res.data.result.data; + LeaveData.fetchListLeave(data); + maxPage.value = Math.ceil(res.data.result.total / pageSize.value); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } /** function เรียกประเภทการลา */ async function fectOptionType() { - await http - .get(config.API.leaveType()) - .then(async (res) => { - leaveType.value = res.data.result; - LeaveData.fetchLeaveType(res.data.result); - }) - .catch((err) => { - messageError($q, err); - }); + await http + .get(config.API.leaveType()) + .then(async (res) => { + leaveType.value = res.data.result; + LeaveData.fetchLeaveType(res.data.result); + }) + .catch((err) => { + messageError($q, err); + }); } /** @@ -92,9 +92,9 @@ async function fectOptionType() { * @param status การลา */ const onClickView = async (id: string, status: string) => { - modal.value = true; - leaveId.value = id; - leaveStatus.value = status; + modal.value = true; + leaveId.value = id; + leaveStatus.value = status; }; /** @@ -102,12 +102,12 @@ const onClickView = async (id: string, status: string) => { * @param id */ const onClickEdit = async (id: string) => { - router.push(`/leave/edit/${id}`); + router.push(`/leave/edit/${id}`); }; //เเจ้งเตือนลบข้อมูล const clickDelete = (id: string) => { - dialogRemove($q, () => onClickDelete(id)); + dialogRemove($q, () => onClickDelete(id)); }; /** @@ -115,20 +115,20 @@ const clickDelete = (id: string) => { * @param id */ const onClickDelete = async (id: string) => { - await http - .delete(config.API.leaveUserId(id)) - .then(async (res) => { - success($q, "ลบข้อมูลสำเร็จ"); - fetchDataTable(); - }) - .catch((err) => { - messageError($q, err); - }); + await http + .delete(config.API.leaveUserId(id)) + .then(async (res) => { + success($q, "ลบข้อมูลสำเร็จ"); + fetchDataTable(); + }) + .catch((err) => { + messageError($q, err); + }); }; /** function closePopup*/ async function onClickClose() { - modal.value = false; + modal.value = false; } /** @@ -139,13 +139,13 @@ async function onClickClose() { * @param k คำค้นหา */ async function updateFilterTable(y: number, t: string, s: string, k: string) { - if (t && s) { - year.value = await y; - type.value = await t; - status.value = await s; - filter.value = await k; - await fetchDataTable(); - } + if (t && s) { + year.value = await y; + type.value = await t; + status.value = await s; + filter.value = await k; + await fetchDataTable(); + } } /** @@ -154,174 +154,295 @@ async function updateFilterTable(y: number, t: string, s: string, k: string) { * @param ps แถวต่อหน้า */ async function updatePagination(p: number, ps: number) { - (page.value = await p), (pageSize.value = await ps); - await fetchDataTable(); + (page.value = await p), (pageSize.value = await ps); + await fetchDataTable(); } /** * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ onMounted(async () => { - await fetchDataTable(); - await fectOptionType(); + await fetchDataTable(); + await fectOptionType(); }); diff --git a/src/modules/05_leave/components/Table.vue b/src/modules/05_leave/components/Table.vue index 238497f..0639bbb 100644 --- a/src/modules/05_leave/components/Table.vue +++ b/src/modules/05_leave/components/Table.vue @@ -100,7 +100,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => { v-if="leaveStore.tabValue === 'list'" menu-class-name="modalfix" v-model="year" - class="col-2" + class="col-xs-12 col-sm-auto" :locale="'th'" autoApply year-picker @@ -217,6 +217,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => { :rows-per-page-options="[10, 25, 50, 100]" :pagination="pagination" @update:pagination="updatePageSize" + :grid="$q.screen.gt.xs ? false : true" > diff --git a/src/modules/05_leave/components/formDetail/01_SickForm.vue b/src/modules/05_leave/components/formDetail/01_SickForm.vue index 5d25c4d..d88d761 100644 --- a/src/modules/05_leave/components/formDetail/01_SickForm.vue +++ b/src/modules/05_leave/components/formDetail/01_SickForm.vue @@ -3,104 +3,104 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/04_HelpWifeBirthForm.vue b/src/modules/05_leave/components/formDetail/04_HelpWifeBirthForm.vue index d232a8a..e7771b7 100644 --- a/src/modules/05_leave/components/formDetail/04_HelpWifeBirthForm.vue +++ b/src/modules/05_leave/components/formDetail/04_HelpWifeBirthForm.vue @@ -3,95 +3,91 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/05_VacationForm.vue b/src/modules/05_leave/components/formDetail/05_VacationForm.vue index f77ea2e..ce76b84 100644 --- a/src/modules/05_leave/components/formDetail/05_VacationForm.vue +++ b/src/modules/05_leave/components/formDetail/05_VacationForm.vue @@ -3,106 +3,108 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/06_OrdinationForm.vue b/src/modules/05_leave/components/formDetail/06_OrdinationForm.vue index 559a43d..2581ea3 100644 --- a/src/modules/05_leave/components/formDetail/06_OrdinationForm.vue +++ b/src/modules/05_leave/components/formDetail/06_OrdinationForm.vue @@ -3,113 +3,109 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/07_HajjForm.vue b/src/modules/05_leave/components/formDetail/07_HajjForm.vue index 76e010d..32f6c31 100644 --- a/src/modules/05_leave/components/formDetail/07_HajjForm.vue +++ b/src/modules/05_leave/components/formDetail/07_HajjForm.vue @@ -3,88 +3,88 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/08_MilitaryForm.vue b/src/modules/05_leave/components/formDetail/08_MilitaryForm.vue index 646d18b..1e77d64 100644 --- a/src/modules/05_leave/components/formDetail/08_MilitaryForm.vue +++ b/src/modules/05_leave/components/formDetail/08_MilitaryForm.vue @@ -3,101 +3,99 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); console.log(props); diff --git a/src/modules/05_leave/components/formDetail/09_StudyForm.vue b/src/modules/05_leave/components/formDetail/09_StudyForm.vue index 4608b90..b5fc281 100644 --- a/src/modules/05_leave/components/formDetail/09_StudyForm.vue +++ b/src/modules/05_leave/components/formDetail/09_StudyForm.vue @@ -3,122 +3,122 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/10_TrainForm.vue b/src/modules/05_leave/components/formDetail/10_TrainForm.vue index a3064d5..d9ecc6c 100644 --- a/src/modules/05_leave/components/formDetail/10_TrainForm.vue +++ b/src/modules/05_leave/components/formDetail/10_TrainForm.vue @@ -3,117 +3,113 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/11_WorkInternationalForm.vue b/src/modules/05_leave/components/formDetail/11_WorkInternationalForm.vue index f26dc2e..6aa6e8e 100644 --- a/src/modules/05_leave/components/formDetail/11_WorkInternationalForm.vue +++ b/src/modules/05_leave/components/formDetail/11_WorkInternationalForm.vue @@ -3,93 +3,89 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/12_FollowSpouseForm.vue b/src/modules/05_leave/components/formDetail/12_FollowSpouseForm.vue index 8f5868d..2087a4d 100644 --- a/src/modules/05_leave/components/formDetail/12_FollowSpouseForm.vue +++ b/src/modules/05_leave/components/formDetail/12_FollowSpouseForm.vue @@ -3,124 +3,124 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/13_RehabilitationForm.vue b/src/modules/05_leave/components/formDetail/13_RehabilitationForm.vue index daaf94f..0c94915 100644 --- a/src/modules/05_leave/components/formDetail/13_RehabilitationForm.vue +++ b/src/modules/05_leave/components/formDetail/13_RehabilitationForm.vue @@ -3,87 +3,83 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/formCancel.vue b/src/modules/05_leave/components/formDetail/formCancel.vue index 28b7933..e1e7fcf 100644 --- a/src/modules/05_leave/components/formDetail/formCancel.vue +++ b/src/modules/05_leave/components/formDetail/formCancel.vue @@ -3,77 +3,75 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/components/formDetail/formMain.vue b/src/modules/05_leave/components/formDetail/formMain.vue index 38cd3f5..558c623 100644 --- a/src/modules/05_leave/components/formDetail/formMain.vue +++ b/src/modules/05_leave/components/formDetail/formMain.vue @@ -3,45 +3,43 @@ * รับ prop จาก component */ const props = defineProps({ - data: { - type: Object, - required: true, - }, + data: { + type: Object, + required: true, + }, }); diff --git a/src/modules/05_leave/views/Main.vue b/src/modules/05_leave/views/Main.vue index 2a1e2d0..46fd6e3 100644 --- a/src/modules/05_leave/views/Main.vue +++ b/src/modules/05_leave/views/Main.vue @@ -18,7 +18,7 @@ const leaveStore = useLeaveStore(); const { showLoader, hideLoader, messageError } = mixin; const router = useRouter(); -const route = useRoute() +const route = useRoute(); const $q = useQuasar(); const filterLeaveType = ref(["ลาป่วย", "ลากิจส่วนตัว", "ลาพักผ่อน"]); @@ -422,37 +422,60 @@ onMounted(async () => { - - - +
+ + + + + +
diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 1356817..75db048 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -378,12 +378,55 @@ const thaiOptions: Intl.DateTimeFormatOptions = {
- + + + + + + + + +
+ + + + + + เปลี่ยนรหัสผ่าน + + + + + + + + ออกจากระบบ + + + +
+
+
+
+
+