From fe6c712a18ec4c358dc0bc188fce675ef2abde01 Mon Sep 17 00:00:00 2001 From: Thanit Konmek Date: Fri, 9 Jun 2023 14:25:41 +0700 Subject: [PATCH] new loader --- .../01_metadata/components/Calendar.vue | 13 ++- .../01_metadata/components/CalendarList.vue | 16 ++- .../components/insignia/Insignia.vue | 20 ++-- .../components/insignia/InsigniaType.vue | 18 +-- .../components/organization/Agency.vue | 18 +-- .../components/organization/Fax.vue | 18 +-- .../organization/GovernmentAgency.vue | 18 +-- .../components/organization/Level.vue | 18 +-- .../components/organization/Organization.vue | 18 +-- .../components/organization/ShortName.vue | 18 +-- .../components/organization/Status.vue | 18 +-- .../components/organization/TelExternal.vue | 18 +-- .../components/organization/TelInternal.vue | 18 +-- .../components/organization/Type.vue | 18 +-- .../01_metadata/components/person/Blood.vue | 18 +-- .../components/person/District.vue | 18 +-- .../components/person/Education.vue | 18 +-- .../01_metadata/components/person/Gender.vue | 18 +-- .../01_metadata/components/person/Prefix.vue | 14 +-- .../components/person/Province.vue | 18 +-- .../components/person/Relationship.vue | 18 +-- .../components/person/Religion.vue | 18 +-- .../components/person/SubDistrict.vue | 18 +-- .../components/position/Executive.vue | 18 +-- .../components/position/ExecutiveSide.vue | 18 +-- .../01_metadata/components/position/Level.vue | 18 +-- .../01_metadata/components/position/Line.vue | 18 +-- .../01_metadata/components/position/Path.vue | 18 +-- .../components/position/PathSide.vue | 18 +-- .../components/position/Status.vue | 18 +-- .../01_metadata/components/position/Type.vue | 18 +-- .../components/positionEmployee/Group.vue | 18 +-- .../components/positionEmployee/Level.vue | 18 +-- .../components/positionEmployee/Line.vue | 18 +-- .../components/positionEmployee/Position.vue | 18 +-- .../positionEmployee/PositionSide.vue | 18 +-- .../components/positionEmployee/Status.vue | 18 +-- src/modules/01_metadata/views/Main.vue | 14 +-- .../01_metadata/views/MainCalendar.vue | 8 +- .../components/AddMappingPositions.vue | 41 ++++--- .../components/Tree/MappingPositions.vue | 10 +- .../components/Tree/OrganizationDialog.vue | 58 +++++----- .../Tree/OrganizationDialogAddEdit.vue | 65 ++++++----- .../02_organizational/views/MainReport.vue | 8 +- .../02_organizational/views/MainTree.vue | 54 ++++----- .../02_organizational/views/ManageReport2.vue | 27 +++-- .../views/ManageReport2Add.vue | 52 ++++----- .../views/ManageReport2History.vue | 12 +- .../02_organizational/views/Report.vue | 8 +- .../03_recruiting/components/Address.vue | 8 +- .../03_recruiting/components/Career.vue | 20 +++- .../03_recruiting/components/Document.vue | 14 +-- .../03_recruiting/components/Education.vue | 16 +-- .../03_recruiting/components/ExamFinished.vue | 6 +- .../03_recruiting/components/Family.vue | 6 +- .../03_recruiting/components/Information.vue | 15 +-- .../03_recruiting/components/Occupation.vue | 6 +- .../03_recruiting/components/Profile.vue | 22 ++-- .../components/TableCandidate.vue | 18 +-- .../03_recruiting/views/01_compete/Detail.vue | 20 ++-- .../views/01_compete/DetailEx.vue | 68 +++++++---- .../03_recruiting/views/01_compete/Period.vue | 33 +++--- .../views/01_compete/PeriodAdd.vue | 93 ++++++++++----- .../views/02_qualify/DisableDetail.vue | 20 ++-- .../views/02_qualify/DisableDetailEx.vue | 73 ++++++++---- .../views/02_qualify/DisablePeriod.vue | 28 ++--- .../views/02_qualify/DisablePeriodAdd.vue | 36 +++--- .../views/02_qualify/ExamForm.vue | 18 +-- .../03_recruiting/views/02_qualify/Manage.vue | 8 +- .../views/02_qualify/Payment.vue | 16 +-- .../03_recruiting/views/02_qualify/Period.vue | 19 +++- .../views/02_qualify/PeriodAdd.vue | 39 +++---- .../views/02_qualify/manageDetail.vue | 27 +++-- .../03_recruiting/views/03_editor/index.vue | 30 ++--- .../04_registry/components/Assessment.vue | 17 +-- src/modules/04_registry/components/Coin.vue | 17 +-- .../04_registry/components/Discipline.vue | 17 +-- .../04_registry/components/Document.vue | 10 +- .../04_registry/components/Education.vue | 25 ++-- .../components/Information/Address.vue | 24 ++-- .../components/Information/Certicate.vue | 17 +-- .../components/Information/Family.vue | 16 +-- .../components/Information/Government.vue | 17 +-- .../components/Information/Information.vue | 28 +++-- .../components/Information/layout.vue | 9 +- .../04_registry/components/Insignia.vue | 21 ++-- src/modules/04_registry/components/Leave.vue | 16 +-- src/modules/04_registry/components/Other.vue | 16 +-- .../04_registry/components/Profile.vue | 107 +++++++++++++----- src/modules/04_registry/components/Record.vue | 17 +-- src/modules/04_registry/components/Salary.vue | 33 +++--- src/modules/04_registry/components/Talent.vue | 17 +-- src/modules/04_registry/components/Train.vue | 17 +-- src/modules/04_registry/components/Work.vue | 17 +-- src/modules/04_registry/views/Main.vue | 8 +- 95 files changed, 1189 insertions(+), 950 deletions(-) diff --git a/src/modules/01_metadata/components/Calendar.vue b/src/modules/01_metadata/components/Calendar.vue index 27fd54cee..c9be4e2ea 100644 --- a/src/modules/01_metadata/components/Calendar.vue +++ b/src/modules/01_metadata/components/Calendar.vue @@ -247,7 +247,8 @@ const props = defineProps({ const store = useDataStore(); const { loaderPage } = store; const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { success, dateToISO, date2Thai, messageError } = mixin; +const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } = + mixin; const $q = useQuasar(); //ใช้ noti quasar const modalAdd = ref(false); //modal เพิ่มวันหยุด const modalDelete = ref(false); //modal ลบวันหยุด @@ -284,7 +285,7 @@ const dataSixDaysRaw = ref([]); * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ onMounted(async () => { - loaderPage(false); + hideLoader(); const calen = fullCalendar.value.getApi(); const date = new Date(props.dateYear, props.dateMonth); calen.gotoDate(date); @@ -424,7 +425,7 @@ const onSubmit = async () => { */ const fetchData = async () => { calendarOptions.value.events = []; - loaderPage(true); + showLoader(); await http .get( config.API.listHolidayHistoryYearMonth( @@ -577,7 +578,7 @@ const editData = async () => { }); }); - loaderPage(true); + showLoader(); await http .post(config.API.listHolidayHistoryEdit(type.value), { history: _dataHistory.value, @@ -620,7 +621,7 @@ const addDate = async () => { ) ); } while (new Date(dateStart.value) <= new Date(dateRange.value[1])); - loaderPage(true); + showLoader(); await http .post(config.API.listHolidayHistoryAdd(category.value), dataAdd.value) .then((res) => { @@ -657,7 +658,7 @@ const deleteData = async () => { new Date(dateStart.value).setDate(new Date(dateStart.value).getDate() + 1) ); } while (new Date(dateStart.value) <= new Date(dateRange.value[1])); - loaderPage(true); + showLoader(); await http .post(config.API.listHolidayHistoryDelete(type.value), dataDelete.value) .then((res) => { diff --git a/src/modules/01_metadata/components/CalendarList.vue b/src/modules/01_metadata/components/CalendarList.vue index b131139af..bf5989b9a 100644 --- a/src/modules/01_metadata/components/CalendarList.vue +++ b/src/modules/01_metadata/components/CalendarList.vue @@ -244,7 +244,15 @@ const props = defineProps({ const store = useDataStore(); const { loaderPage } = store; const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { success, dateToISO, dateMonth2Thai, weekThai, messageError } = mixin; +const { + success, + dateToISO, + dateMonth2Thai, + weekThai, + messageError, + showLoader, + hideLoader, +} = mixin; const $q = useQuasar(); //ใช้ noti quasar const calendarData = ref([]); //data วันหยุด const modalAdd = ref(false); //modal เพิ่มวันหยุด @@ -329,7 +337,7 @@ const deleteClick = async (val: DataDateListsObject) => { */ const fetchData = async () => { calendarData.value = []; - loaderPage(true); + showLoader(); await http .get(config.API.listHolidayHistoryYear(props.dateYear)) .then((res) => { @@ -409,7 +417,7 @@ const deleteConfirm = async () => { } else { return; } - loaderPage(true); + showLoader(); await http .post( config.API.listHolidayHistoryDelete(currentTab.value), @@ -462,7 +470,7 @@ const editData = async () => { } ); } - loaderPage(true); + showLoader(); await http .post(config.API.listHolidayHistoryEdit(currentTab.value), { history: _dataHistory.value, diff --git a/src/modules/01_metadata/components/insignia/Insignia.vue b/src/modules/01_metadata/components/insignia/Insignia.vue index 01420283f..7434cdc4e 100644 --- a/src/modules/01_metadata/components/insignia/Insignia.vue +++ b/src/modules/01_metadata/components/insignia/Insignia.vue @@ -301,7 +301,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -577,7 +577,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listInsigniaHistory) .then((res) => { @@ -620,7 +620,7 @@ const fetchData = async () => { * รายการลำดับเครื่องราชฯ */ const fetchinsigniaType = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.insigniaType) .then((res) => { @@ -636,7 +636,7 @@ const fetchinsigniaType = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -644,7 +644,7 @@ const fetchinsigniaType = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listInsigniaPublishedHistory) .then((res) => { @@ -676,7 +676,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -685,7 +685,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listInsigniaHistory) .then((res) => { @@ -705,7 +705,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listInsigniaPublished) .then((res) => { @@ -772,7 +772,7 @@ const save = async (publish: boolean) => { lastUpdateUserId: e.lastUpdateUserId, insigniaType: e.insigniaType, })); - loaderPage(true); + showLoader(); await http .post(config.API.listInsigniaHistoryId(idVersion.value), { id: idVersion.value, @@ -792,7 +792,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/insignia/InsigniaType.vue b/src/modules/01_metadata/components/insignia/InsigniaType.vue index 856b9870f..e84b36ba1 100644 --- a/src/modules/01_metadata/components/insignia/InsigniaType.vue +++ b/src/modules/01_metadata/components/insignia/InsigniaType.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listInsigniaTypeHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listInsigniaTypePublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listInsigniaTypeHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listInsigniaTypePublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listInsigniaTypeHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/Agency.vue b/src/modules/01_metadata/components/organization/Agency.vue index 6f0c3c73e..b6b52f80e 100644 --- a/src/modules/01_metadata/components/organization/Agency.vue +++ b/src/modules/01_metadata/components/organization/Agency.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationAgencyHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationAgencyPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationAgencyHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationAgencyPublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationAgencyHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/Fax.vue b/src/modules/01_metadata/components/organization/Fax.vue index 8e746a11e..e778fbbae 100644 --- a/src/modules/01_metadata/components/organization/Fax.vue +++ b/src/modules/01_metadata/components/organization/Fax.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationFaxHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationFaxPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationFaxHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationFaxPublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationFaxHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/GovernmentAgency.vue b/src/modules/01_metadata/components/organization/GovernmentAgency.vue index dc1a697da..fef75a7f7 100644 --- a/src/modules/01_metadata/components/organization/GovernmentAgency.vue +++ b/src/modules/01_metadata/components/organization/GovernmentAgency.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationGovernmentAgencyHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationGovernmentAgencyPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationGovernmentAgencyHistory) .then((res) => { @@ -456,7 +456,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationGovernmentAgencyPublished) .then((res) => { @@ -516,7 +516,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post( config.API.listOrganizationGovernmentAgencyHistoryId(idVersion.value), @@ -539,7 +539,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/Level.vue b/src/modules/01_metadata/components/organization/Level.vue index 368ff4ae6..e7fc9bdf9 100644 --- a/src/modules/01_metadata/components/organization/Level.vue +++ b/src/modules/01_metadata/components/organization/Level.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationLevelHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationLevelPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationLevelHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationLevelPublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationLevelHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/Organization.vue b/src/modules/01_metadata/components/organization/Organization.vue index 3fd2eb260..3848e3449 100644 --- a/src/modules/01_metadata/components/organization/Organization.vue +++ b/src/modules/01_metadata/components/organization/Organization.vue @@ -214,7 +214,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -402,7 +402,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationOrganizationHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationOrganizationPublishedHistory) .then((res) => { @@ -466,7 +466,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -475,7 +475,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationOrganizationHistory) .then((res) => { @@ -495,7 +495,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationOrganizationPublished) .then((res) => { @@ -556,7 +556,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationOrganizationHistoryId(idVersion.value), { id: idVersion.value, @@ -576,7 +576,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/ShortName.vue b/src/modules/01_metadata/components/organization/ShortName.vue index 355769bfb..5e0bb01c0 100644 --- a/src/modules/01_metadata/components/organization/ShortName.vue +++ b/src/modules/01_metadata/components/organization/ShortName.vue @@ -255,7 +255,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -491,7 +491,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationShortNameHistory) .then((res) => { @@ -520,7 +520,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -528,7 +528,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationShortNamePublishedHistory) .then((res) => { @@ -559,7 +559,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -568,7 +568,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationShortNameHistory) .then((res) => { @@ -588,7 +588,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationShortNamePublished) .then((res) => { @@ -654,7 +654,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationShortNameHistoryId(idVersion.value), { id: idVersion.value, @@ -674,7 +674,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/Status.vue b/src/modules/01_metadata/components/organization/Status.vue index 8c1adb00a..f905e1047 100644 --- a/src/modules/01_metadata/components/organization/Status.vue +++ b/src/modules/01_metadata/components/organization/Status.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationStatusHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationStatusPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationStatusHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationStatusPublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationStatusHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/TelExternal.vue b/src/modules/01_metadata/components/organization/TelExternal.vue index c30cfac60..ea9e3131c 100644 --- a/src/modules/01_metadata/components/organization/TelExternal.vue +++ b/src/modules/01_metadata/components/organization/TelExternal.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTelExternalHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTelExternalPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationTelExternalHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTelExternalPublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationTelExternalHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/TelInternal.vue b/src/modules/01_metadata/components/organization/TelInternal.vue index 6da9b58f2..fde6cea92 100644 --- a/src/modules/01_metadata/components/organization/TelInternal.vue +++ b/src/modules/01_metadata/components/organization/TelInternal.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTelInternalHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTelInternalPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationTelInternalHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTelInternalPublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationTelInternalHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/organization/Type.vue b/src/modules/01_metadata/components/organization/Type.vue index b65a3818a..4badf69e7 100644 --- a/src/modules/01_metadata/components/organization/Type.vue +++ b/src/modules/01_metadata/components/organization/Type.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTypeHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTypePublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listOrganizationTypeHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationTypePublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listOrganizationTypeHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/Blood.vue b/src/modules/01_metadata/components/person/Blood.vue index cb026329e..6fda942df 100644 --- a/src/modules/01_metadata/components/person/Blood.vue +++ b/src/modules/01_metadata/components/person/Blood.vue @@ -206,7 +206,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -370,7 +370,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listBloodGroupHistory) .then((res) => { @@ -396,7 +396,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -404,7 +404,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listBloodGroupPublishedHistory) .then((res) => { @@ -432,7 +432,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -441,7 +441,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listBloodGroupHistory) .then((res) => { @@ -461,7 +461,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listBloodGroupPublished) .then((res) => { @@ -521,7 +521,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listBloodGroupHistoryId(idVersion.value), { id: idVersion.value, @@ -541,7 +541,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/District.vue b/src/modules/01_metadata/components/person/District.vue index 6c187fc8b..cd90fdb26 100644 --- a/src/modules/01_metadata/components/person/District.vue +++ b/src/modules/01_metadata/components/person/District.vue @@ -232,7 +232,7 @@ import { useRoute, useRouter } from "vue-router"; import { useDataStore } from "@/stores/data"; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const dataStore = useDataStore(); const { manageData, changeManageColumns, changeManageCurrentTab } = store; @@ -405,7 +405,7 @@ const $q = useQuasar(); */ const fetchData = async () => { rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listDistrictHistoryId(provinceId.value)) .then((res) => { @@ -432,7 +432,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -440,7 +440,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listDistrictPublishedHistory(provinceId.value)) .then((res) => { @@ -468,7 +468,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -477,7 +477,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listDistrictHistoryId(provinceId.value)) .then((res) => { @@ -497,7 +497,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listProvincePublished) .then((res) => { @@ -557,7 +557,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listDistrictHistoryId(idVersion.value), { id: idVersion.value, @@ -578,7 +578,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/Education.vue b/src/modules/01_metadata/components/person/Education.vue index 571452185..a4a696381 100644 --- a/src/modules/01_metadata/components/person/Education.vue +++ b/src/modules/01_metadata/components/person/Education.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listEducationLevelHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listEducationLevelPublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listEducationLevelHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listEducationLevelPublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listEducationLevelHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/Gender.vue b/src/modules/01_metadata/components/person/Gender.vue index 2e523269d..40ffa0e28 100644 --- a/src/modules/01_metadata/components/person/Gender.vue +++ b/src/modules/01_metadata/components/person/Gender.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listGenderHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listGenderPublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listGenderHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listGenderPublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listGenderHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/Prefix.vue b/src/modules/01_metadata/components/person/Prefix.vue index df071c2e5..369243e93 100644 --- a/src/modules/01_metadata/components/person/Prefix.vue +++ b/src/modules/01_metadata/components/person/Prefix.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, @@ -381,7 +381,7 @@ const fetchData = async () => { updateData.value = false; console.log(result); // rows.value.splice(0); - // loaderPage(true); + // showLoader(); // await http // .get(config.API.listPrefixHistory) // .then((res) => { @@ -407,7 +407,7 @@ const fetchData = async () => { // }) // .finally(() => { // updateData.value = false; - // loaderPage(false); + // hideLoader(); // }); }; @@ -448,7 +448,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - // loaderPage(true); + // showLoader(); await http .delete(config.API.listPrefixHistory) .then((res) => { @@ -468,7 +468,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.listPrefixPublished) .then((res) => { @@ -528,7 +528,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - // loaderPage(true); + // showLoader(); await http .post(config.API.listPrefixHistoryId(idVersion.value), { id: idVersion.value, @@ -548,7 +548,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/Province.vue b/src/modules/01_metadata/components/person/Province.vue index 2b753c3dc..07cfdb53d 100644 --- a/src/modules/01_metadata/components/person/Province.vue +++ b/src/modules/01_metadata/components/person/Province.vue @@ -215,7 +215,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; //ขึ้นหน้า load ขณะเรียก api const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -379,7 +379,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listProvinceHistory) .then((res) => { @@ -405,7 +405,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -413,7 +413,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listProvincePublishedHistory) .then((res) => { @@ -441,7 +441,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -450,7 +450,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listProvinceHistory) .then((res) => { @@ -470,7 +470,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listProvincePublished) .then((res) => { @@ -530,7 +530,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listProvinceHistoryId(idVersion.value), { id: idVersion.value, @@ -550,7 +550,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/Relationship.vue b/src/modules/01_metadata/components/person/Relationship.vue index a13b3deea..31f56149f 100644 --- a/src/modules/01_metadata/components/person/Relationship.vue +++ b/src/modules/01_metadata/components/person/Relationship.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listRelationshipHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listRelationshipPublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listRelationshipHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listRelationshipPublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listRelationshipHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/Religion.vue b/src/modules/01_metadata/components/person/Religion.vue index 217552dcb..dc5ecde94 100644 --- a/src/modules/01_metadata/components/person/Religion.vue +++ b/src/modules/01_metadata/components/person/Religion.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listReligionHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listReligionPublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listReligionHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listReligionPublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listReligionHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/person/SubDistrict.vue b/src/modules/01_metadata/components/person/SubDistrict.vue index b321a3035..270b8d48d 100644 --- a/src/modules/01_metadata/components/person/SubDistrict.vue +++ b/src/modules/01_metadata/components/person/SubDistrict.vue @@ -242,7 +242,7 @@ import { useRoute, useRouter } from "vue-router"; import { useDataStore } from "@/stores/data"; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const dataStore = useDataStore(); const { manageData, changeManageColumns, changeManageCurrentTab } = store; @@ -435,7 +435,7 @@ const $q = useQuasar(); */ const fetchData = async () => { rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get( config.API.listSubDistrictHistoryProvinceId( @@ -468,7 +468,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -476,7 +476,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listSubDistrictPublishedHistory(districtId.value)) .then((res) => { @@ -505,7 +505,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -514,7 +514,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listSubDistrictHistoryId(districtId.value)) .then((res) => { @@ -534,7 +534,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listProvincePublished) .then((res) => { @@ -597,7 +597,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listSubDistrictHistoryId(idVersion.value), { id: idVersion.value, @@ -618,7 +618,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/Executive.vue b/src/modules/01_metadata/components/position/Executive.vue index fb98d366f..6d1ccc198 100644 --- a/src/modules/01_metadata/components/position/Executive.vue +++ b/src/modules/01_metadata/components/position/Executive.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionExecutiveHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionExecutivePublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionExecutiveHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionExecutivePublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionExecutiveHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/ExecutiveSide.vue b/src/modules/01_metadata/components/position/ExecutiveSide.vue index ebe3709d4..0598667c8 100644 --- a/src/modules/01_metadata/components/position/ExecutiveSide.vue +++ b/src/modules/01_metadata/components/position/ExecutiveSide.vue @@ -215,7 +215,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -403,7 +403,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionExecutiveSideHistory) .then((res) => { @@ -430,7 +430,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionExecutiveSidePublishedHistory) .then((res) => { @@ -467,7 +467,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -476,7 +476,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionExecutiveSideHistory) .then((res) => { @@ -496,7 +496,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionExecutiveSidePublished) .then((res) => { @@ -557,7 +557,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionExecutiveSideHistoryId(idVersion.value), { id: idVersion.value, @@ -577,7 +577,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/Level.vue b/src/modules/01_metadata/components/position/Level.vue index c3638b88d..73210d632 100644 --- a/src/modules/01_metadata/components/position/Level.vue +++ b/src/modules/01_metadata/components/position/Level.vue @@ -266,7 +266,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -478,7 +478,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionLevelHistory) .then((res) => { @@ -512,7 +512,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -520,7 +520,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionLevelPublishedHistory) .then((res) => { @@ -550,7 +550,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -559,7 +559,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionLevelHistory) .then((res) => { @@ -579,7 +579,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionLevelPublished) .then((res) => { @@ -643,7 +643,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionLevelHistoryId(idVersion.value), { id: idVersion.value, @@ -663,7 +663,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/Line.vue b/src/modules/01_metadata/components/position/Line.vue index 25aa5fdfe..7801b6b5a 100644 --- a/src/modules/01_metadata/components/position/Line.vue +++ b/src/modules/01_metadata/components/position/Line.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionLineHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionLinePublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionLineHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionLinePublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionLineHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/Path.vue b/src/modules/01_metadata/components/position/Path.vue index 7dab02415..1e7160b25 100644 --- a/src/modules/01_metadata/components/position/Path.vue +++ b/src/modules/01_metadata/components/position/Path.vue @@ -215,7 +215,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -403,7 +403,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionPathHistory) .then((res) => { @@ -430,7 +430,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionPathPublishedHistory) .then((res) => { @@ -467,7 +467,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -476,7 +476,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionPathHistory) .then((res) => { @@ -496,7 +496,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionPathPublished) .then((res) => { @@ -557,7 +557,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionPathHistoryId(idVersion.value), { id: idVersion.value, @@ -577,7 +577,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/PathSide.vue b/src/modules/01_metadata/components/position/PathSide.vue index a3ac3d150..eafb36d93 100644 --- a/src/modules/01_metadata/components/position/PathSide.vue +++ b/src/modules/01_metadata/components/position/PathSide.vue @@ -215,7 +215,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -403,7 +403,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionSideHistory) .then((res) => { @@ -430,7 +430,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionSidePublishedHistory) .then((res) => { @@ -467,7 +467,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -476,7 +476,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionSideHistory) .then((res) => { @@ -496,7 +496,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionSidePublished) .then((res) => { @@ -557,7 +557,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionSideHistoryId(idVersion.value), { id: idVersion.value, @@ -577,7 +577,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/Status.vue b/src/modules/01_metadata/components/position/Status.vue index 506130d03..b0bb855ac 100644 --- a/src/modules/01_metadata/components/position/Status.vue +++ b/src/modules/01_metadata/components/position/Status.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionStatusHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionStatusPublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionStatusHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionStatusPublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionStatusHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/position/Type.vue b/src/modules/01_metadata/components/position/Type.vue index e22c1340c..736ece356 100644 --- a/src/modules/01_metadata/components/position/Type.vue +++ b/src/modules/01_metadata/components/position/Type.vue @@ -203,7 +203,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -367,7 +367,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionTypeHistory) .then((res) => { @@ -393,7 +393,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -401,7 +401,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionTypePublishedHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -438,7 +438,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionTypeHistory) .then((res) => { @@ -458,7 +458,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionTypePublished) .then((res) => { @@ -518,7 +518,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionTypeHistoryId(idVersion.value), { id: idVersion.value, @@ -538,7 +538,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/positionEmployee/Group.vue b/src/modules/01_metadata/components/positionEmployee/Group.vue index 729f96bdb..36d83bf4c 100644 --- a/src/modules/01_metadata/components/positionEmployee/Group.vue +++ b/src/modules/01_metadata/components/positionEmployee/Group.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeGroupHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeGroupPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionEmployeeGroupHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeGroupPublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionEmployeeGroupHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/positionEmployee/Level.vue b/src/modules/01_metadata/components/positionEmployee/Level.vue index 1dc16a377..15896590b 100644 --- a/src/modules/01_metadata/components/positionEmployee/Level.vue +++ b/src/modules/01_metadata/components/positionEmployee/Level.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -365,7 +365,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeLevelHistory) .then((res) => { @@ -391,7 +391,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -399,7 +399,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeLevelPublishedHistory) .then((res) => { @@ -427,7 +427,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -436,7 +436,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionEmployeeLevelHistory) .then((res) => { @@ -456,7 +456,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeLevelPublished) .then((res) => { @@ -516,7 +516,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionEmployeeLevelHistoryId(idVersion.value), { id: idVersion.value, @@ -536,7 +536,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/positionEmployee/Line.vue b/src/modules/01_metadata/components/positionEmployee/Line.vue index 9f9914462..037e47d18 100644 --- a/src/modules/01_metadata/components/positionEmployee/Line.vue +++ b/src/modules/01_metadata/components/positionEmployee/Line.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeLineHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeLinePublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionEmployeeLineHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeLinePublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionEmployeeLineHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/positionEmployee/Position.vue b/src/modules/01_metadata/components/positionEmployee/Position.vue index 626cc52f6..6d8f6663d 100644 --- a/src/modules/01_metadata/components/positionEmployee/Position.vue +++ b/src/modules/01_metadata/components/positionEmployee/Position.vue @@ -214,7 +214,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -402,7 +402,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeePositionHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeePositionPublishedHistory) .then((res) => { @@ -466,7 +466,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -475,7 +475,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionEmployeePositionHistory) .then((res) => { @@ -495,7 +495,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeePositionPublished) .then((res) => { @@ -556,7 +556,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionEmployeePositionHistoryId(idVersion.value), { id: idVersion.value, @@ -576,7 +576,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/positionEmployee/PositionSide.vue b/src/modules/01_metadata/components/positionEmployee/PositionSide.vue index 80f9e7dda..b40942375 100644 --- a/src/modules/01_metadata/components/positionEmployee/PositionSide.vue +++ b/src/modules/01_metadata/components/positionEmployee/PositionSide.vue @@ -214,7 +214,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -402,7 +402,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeePositionSideHistory) .then((res) => { @@ -429,7 +429,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeePositionSidePublishedHistory) .then((res) => { @@ -466,7 +466,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -475,7 +475,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionEmployeePositionSideHistory) .then((res) => { @@ -495,7 +495,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeePositionSidePublished) .then((res) => { @@ -556,7 +556,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post( config.API.listPositionEmployeePositionSideHistoryId(idVersion.value), @@ -579,7 +579,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/components/positionEmployee/Status.vue b/src/modules/01_metadata/components/positionEmployee/Status.vue index ca65c90e0..f636feec4 100644 --- a/src/modules/01_metadata/components/positionEmployee/Status.vue +++ b/src/modules/01_metadata/components/positionEmployee/Status.vue @@ -202,7 +202,7 @@ const props = defineProps({ const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { success, dateText, messageError } = mixin; +const { success, dateText, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const { manageData, changeManageColumns } = store; const rows = ref([]); //list data table @@ -366,7 +366,7 @@ const $q = useQuasar(); const fetchData = async () => { await props.fetchDataComponent(); rows.value.splice(0); - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeStatusHistory) .then((res) => { @@ -392,7 +392,7 @@ const fetchData = async () => { }) .finally(() => { updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -400,7 +400,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeStatusPublishedHistory) .then((res) => { @@ -428,7 +428,7 @@ const fetchHistory = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -437,7 +437,7 @@ const fetchHistory = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.listPositionEmployeeStatusHistory) .then((res) => { @@ -457,7 +457,7 @@ const clearPublishedData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const publishedData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listPositionEmployeeStatusPublished) .then((res) => { @@ -517,7 +517,7 @@ const save = async (publish: boolean) => { lastUpdateFullName: e.lastUpdateFullName, lastUpdateUserId: e.lastUpdateUserId, })); - loaderPage(true); + showLoader(); await http .post(config.API.listPositionEmployeeStatusHistoryId(idVersion.value), { id: idVersion.value, @@ -537,7 +537,7 @@ const save = async (publish: boolean) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/views/Main.vue b/src/modules/01_metadata/views/Main.vue index b842eb3ff..1f1fee168 100644 --- a/src/modules/01_metadata/views/Main.vue +++ b/src/modules/01_metadata/views/Main.vue @@ -407,7 +407,7 @@ import { useQuasar } from "quasar"; const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { genColor15, messageError } = mixin; +const { genColor15, messageError, showLoader, hideLoader } = mixin; const store = useManageDataStore(); const dataStore = useDataStore(); const { loaderPage } = dataStore; //ขึ้นหน้า load ขณะเรียก api @@ -598,7 +598,7 @@ const changeList = async (val: number) => { */ const fetchDataSummary = async () => { lists.value = []; - loaderPage(true); + showLoader(); await http .get(config.API.countDashbordHistory) .then((res) => { @@ -615,7 +615,7 @@ const fetchDataSummary = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -630,7 +630,7 @@ const fetchDataSummarySubComponent = async () => { */ const fetchDataSummarySub = async (val: number) => { dataNum.value = []; - // loaderPage(true); + // showLoader(); await http .get(config.API.countDashbordSubHistory(val)) .then((res) => { @@ -648,7 +648,7 @@ const fetchDataSummarySub = async (val: number) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -656,7 +656,7 @@ const fetchDataSummarySub = async (val: number) => { * สรุปวันหยุด */ const fetchDataSummaryCalendar = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.summaryHolidayHistoryYear(yearSum.value)) .then((res) => { @@ -676,7 +676,7 @@ const fetchDataSummaryCalendar = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/01_metadata/views/MainCalendar.vue b/src/modules/01_metadata/views/MainCalendar.vue index 1e05ef7e2..4b5aba21b 100644 --- a/src/modules/01_metadata/views/MainCalendar.vue +++ b/src/modules/01_metadata/views/MainCalendar.vue @@ -365,6 +365,8 @@ const { date2Thai, messageError, dialogMessage, + showLoader, + hideLoader, } = mixin; const { loaderPage } = dataStore; //รอโหลด const store = useManageDataStore(); @@ -491,7 +493,7 @@ const onSubmit = async () => { ) ); } while (new Date(dateStart.value) <= new Date(dateAdd.value[1])); - loaderPage(true); + showLoader(); await http .post(config.API.listHolidayHistoryAdd(category.value), dataAdd.value) .then((res) => { @@ -503,7 +505,7 @@ const onSubmit = async () => { }) .finally(() => { refreshData.value = !refreshData.value; - loaderPage(false); + hideLoader(); }); } }); @@ -528,7 +530,7 @@ const onSubmitCopy = async () => { ); return; } - loaderPage(true); + showLoader(); await http .post(config.API.listHolidayCopy, { fromYear: dateYearStart.value, diff --git a/src/modules/02_organizational/components/AddMappingPositions.vue b/src/modules/02_organizational/components/AddMappingPositions.vue index 1d63860a0..e99b8d772 100644 --- a/src/modules/02_organizational/components/AddMappingPositions.vue +++ b/src/modules/02_organizational/components/AddMappingPositions.vue @@ -431,7 +431,14 @@ const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); -const { success, modalConfirm, modalError, modalDelete } = mixin; +const { + success, + modalConfirm, + modalError, + modalDelete, + showLoader, + hideLoader, +} = mixin; const { date2Thai } = mixin; const store = useOrganizationalDataStore(); const { organizationalData, changeOrganizationalColumns } = store; @@ -809,7 +816,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => { }); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchPosition(); await fetchData(); await fetchHistory(); @@ -819,7 +826,7 @@ onMounted(async () => { * ฟังก์ชัน get data ล่าสุด */ const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getPostionMasterDraft(true)) .then((res) => { @@ -862,7 +869,7 @@ const fetchData = async () => { }) .finally(() => { // updateData.value = false; - loaderPage(false); + hideLoader(); }); }; @@ -870,7 +877,7 @@ const fetchData = async () => { * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด */ const fetchHistory = async () => { - // loaderPage(true); + // showLoader(); // await http // .get(config.API.listxxxxxxxxPublishedHistory) // .then((res) => { @@ -902,7 +909,7 @@ const fetchHistory = async () => { // statusCode.value = e.response.data.status; // }) // .finally(async () => { - // loaderPage(false); + // hideLoader(); // }); }; @@ -910,7 +917,7 @@ const fetchHistory = async () => { * get รายการ ตำแหน่ง */ const fetchPosition = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.position) .then((res) => { @@ -1001,7 +1008,7 @@ const fetchPosition = async () => { }) .catch((e: any) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1150,7 +1157,7 @@ const clickSave = async () => { */ const saveData = async () => { modal.value = false; - loaderPage(true); + showLoader(); await http .post(config.API.getPositionMaster, { positionTypeId: positionTypeId.value, @@ -1182,7 +1189,7 @@ const saveData = async () => { */ const editData = async () => { modal.value = false; - loaderPage(true); + showLoader(); await http .put(config.API.getPositionMasterId(positionMasterId.value), { positionMasterId: positionMasterId.value, @@ -1215,7 +1222,7 @@ const editData = async () => { * เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่ */ const clearPublishedData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.getPositionMasterSync) .then((res) => { @@ -1228,7 +1235,7 @@ const clearPublishedData = async () => { statusCode.value = e.response.data.status; }) .finally(async () => { - loaderPage(false); + hideLoader(); await fetchHistory(); await fetchData(); }); @@ -1240,7 +1247,7 @@ const clearPublishedData = async () => { */ const publishedData = async () => { // editvisible.value = false; - loaderPage(true); + showLoader(); await http .put(config.API.getPositionMasterPublish) .then((res) => { @@ -1250,7 +1257,7 @@ const publishedData = async () => { statusCode.value = e.response.data.status; }) .finally(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); }; @@ -1344,7 +1351,7 @@ const clickAdd = () => { * @param row ข้อมูล row ที่ดูประวัติการแก้ไข */ const clickHistory = async (row: RequestItemsObject) => { - loaderPage(true); + showLoader(); await http .get(config.API.getPositionMasterHistoryId(row.id)) .then((res) => { @@ -1387,7 +1394,7 @@ const clickHistory = async (row: RequestItemsObject) => { }) .finally(async () => { modalHistory.value = true; - loaderPage(false); + hideLoader(); }); }; @@ -1430,7 +1437,7 @@ const clickIsActive = async (val: string, status: boolean) => { }) .onOk(async () => { // edit.value = false; - loaderPage(true); + showLoader(); await http .delete(config.API.getPositionMasterId(val) + `?Id=${val}`) .then((res) => { diff --git a/src/modules/02_organizational/components/Tree/MappingPositions.vue b/src/modules/02_organizational/components/Tree/MappingPositions.vue index b81347688..ebe5b2855 100644 --- a/src/modules/02_organizational/components/Tree/MappingPositions.vue +++ b/src/modules/02_organizational/components/Tree/MappingPositions.vue @@ -240,10 +240,14 @@ import { useDataStore } from "@/stores/data"; import http from "@/plugins/http"; import config from "@/app.config"; import type { DataOption } from "../../interface/index/Main"; +import { useCounterMixin } from "@/stores/mixin"; const ddNoResultMsg = defineAsyncComponent( () => import("@/components/DropDownNoResultMsg.vue") ); //แสดงข้อความเมื่อ Dropdown Filter ไม่เจอข้อมูล + +const mixin = useCounterMixin(); +const { showLoader, hideLoader } = mixin; const dataStore = useDataStore(); const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog @@ -286,12 +290,12 @@ const positionFilter = ref>([]); //for DropDown const position = ref>([]); //for DropDown onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchPositionMaster(); }); const fetchPositionMaster = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.getPostionMasterDraft(false)) .get(config.API.getPostionMaster(false)) @@ -329,7 +333,7 @@ const fetchPositionMaster = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/02_organizational/components/Tree/OrganizationDialog.vue b/src/modules/02_organizational/components/Tree/OrganizationDialog.vue index 8c6d9d905..5ad5fc78f 100644 --- a/src/modules/02_organizational/components/Tree/OrganizationDialog.vue +++ b/src/modules/02_organizational/components/Tree/OrganizationDialog.vue @@ -339,6 +339,8 @@ import type { } from "../../interface/index/Main"; import { log } from "console"; import { useDataStore } from "@/stores/data"; + +import { useCounterMixin } from "@/stores/mixin"; // import { organizationSet } from "../interface/index/Main"; const props = defineProps({ @@ -348,6 +350,8 @@ const props = defineProps({ const emit = defineEmits(["update:organizprops", "update:formprops"]); +const mixin = useCounterMixin(); +const {showLoader, hideLoader } = mixin; const dataStore = useDataStore(); const { loaderPage } = dataStore; const $q = useQuasar(); // show dialog @@ -386,7 +390,7 @@ const organizationAgencyCode = ref([]); const organizationAgencyCodeFilter = ref([]); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchOrganizationOri(); await fetchOrganizationAgencyCode(); await fetchOrganizationGovernmentCode(); @@ -405,7 +409,7 @@ onMounted(async () => { * หน่วยงาน */ const fetchOrganizationOri = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organization) .then((res) => { @@ -421,14 +425,14 @@ const fetchOrganizationOri = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสหน่วยงาน */ const fetchOrganizationAgencyCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationCode) .then((res) => { @@ -450,14 +454,14 @@ const fetchOrganizationAgencyCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสส่วนราชการ */ const fetchOrganizationGovernmentCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationShortName) .then((res) => { @@ -479,14 +483,14 @@ const fetchOrganizationGovernmentCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; // /** // * ชื่อย่อหน่วยงาน // */ // const fetchOrganizationShortName = async () => { -// loaderPage(true); +// showLoader(); // await http // .get(config.API.organizationShortName) // .then((res) => { @@ -508,14 +512,14 @@ const fetchOrganizationGovernmentCode = async () => { // console.log(e); // }) // .finally(() => { -// loaderPage(false); +// hideLoader(); // }); // }; /** * หน่วยงานต้นสังกัด */ const fetchOrganizationAgency = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationAgency("หน่วยงาน")) .then((res) => { @@ -534,14 +538,14 @@ const fetchOrganizationAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ส่วนราชการต้นสังกัด */ const fetchOrganizationGovernmentAgency = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.listOrganizationAgency("ส่วนราชการ")) .then((res) => { @@ -560,14 +564,14 @@ const fetchOrganizationGovernmentAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ประเภทหน่วยงาน */ const fetchOrganizationType = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationType) .then((res) => { @@ -583,14 +587,14 @@ const fetchOrganizationType = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ระดับหน่วยงาน */ const fetchOrganizationLevel = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationLevel) .then((res) => { @@ -606,14 +610,14 @@ const fetchOrganizationLevel = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายใน */ const fetchOrganizationTelInternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelInternal) .then((res) => { @@ -629,14 +633,14 @@ const fetchOrganizationTelInternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายนอก */ const fetchOrganizationTelExternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelExternal) .then((res) => { @@ -652,14 +656,14 @@ const fetchOrganizationTelExternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์โทรสาร */ const fetchOrganizationFax = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationFax) .then((res) => { @@ -675,7 +679,7 @@ const fetchOrganizationFax = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -776,7 +780,7 @@ const addOrganizationItem = async () => { const fetchAgencyCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationGovernmentCode(val)) .then((res) => { @@ -796,14 +800,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationAgencyCode(val)) .then((res) => { @@ -823,7 +827,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; diff --git a/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue b/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue index 0031ae37a..63285916c 100644 --- a/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue +++ b/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue @@ -318,6 +318,7 @@ import { log } from "console"; import { useDataStore } from "@/stores/data"; import type { EnumStringMember } from "@babel/types"; // import { organizationSet } from "../interface/index/Main"; +import { useCounterMixin } from "@/stores/mixin"; const props = defineProps({ organizprops: Object as PropType, @@ -328,6 +329,8 @@ const props = defineProps({ }, }); +const mixin = useCounterMixin(); +const { showLoader, hideLoader } = mixin; const dataStore = useDataStore(); const { loaderPage } = dataStore; const emit = defineEmits(["update:organizprops", "update:formprops"]); @@ -397,7 +400,7 @@ const organization = ref({ emit("update:organizprops", organization.value); onMounted(async () => { - loaderPage(false); + hideLoader(); // await fillOrgEdit(); //มาแค่ตรง selector(q-select) await fetchOrganizationOri(); // await fetchOrganizationShortName(); @@ -431,7 +434,7 @@ const getClass = (val: boolean) => { * @param node node that you want to edit data */ const fillOrgEdit = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getOrgDraft(props.org.organizationId)) .then((res) => { @@ -503,7 +506,7 @@ const fillOrgEdit = async () => { console.log(e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); console.log("success"); }; @@ -512,7 +515,7 @@ const fillOrgEdit = async () => { * หน่วยงาน */ const fetchOrganizationOri = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organization) .then((res) => { @@ -528,14 +531,14 @@ const fetchOrganizationOri = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสหน่วยงาน */ const fetchOrganizationAgencyCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationCode) .then((res) => { @@ -557,14 +560,14 @@ const fetchOrganizationAgencyCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * รหัสส่วนราชการ */ const fetchOrganizationGovernmentCode = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationShortName) .then((res) => { @@ -589,14 +592,14 @@ const fetchOrganizationGovernmentCode = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; // /** // * ชื่อย่อหน่วยงาน // */ // const fetchOrganizationShortName = async () => { -// loaderPage(true); +// showLoader(); // await http // .get(config.API.organizationShortName) // .then((res) => { @@ -618,14 +621,14 @@ const fetchOrganizationGovernmentCode = async () => { // console.log(e); // }) // .finally(() => { -// loaderPage(false); +// hideLoader(); // }); // }; /** * หน่วยงานต้นสังกัด */ const fetchOrganizationAgency = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.organizationAgency) .get(config.API.listOrganizationAgency("หน่วยงาน")) @@ -645,14 +648,14 @@ const fetchOrganizationAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ส่วนราชการต้นสังกัด */ const fetchOrganizationGovernmentAgency = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.organizationGovernmentAgency) .get(config.API.listOrganizationAgency("ส่วนราชการ")) @@ -673,14 +676,14 @@ const fetchOrganizationGovernmentAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * ประเภทหน่วยงาน */ const fetchOrganizationType = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationType) .then((res) => { @@ -696,7 +699,7 @@ const fetchOrganizationType = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -704,7 +707,7 @@ const fetchOrganizationType = async () => { * สถานะหน่วยงาน */ const fetchOrganizationStatus = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationStatus) .then((res) => { @@ -720,7 +723,7 @@ const fetchOrganizationStatus = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -728,7 +731,7 @@ const fetchOrganizationStatus = async () => { * ระดับหน่วยงาน */ const fetchOrganizationLevel = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationLevel) .then((res) => { @@ -744,14 +747,14 @@ const fetchOrganizationLevel = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายใน */ const fetchOrganizationTelInternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelInternal) .then((res) => { @@ -767,14 +770,14 @@ const fetchOrganizationTelInternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์ติดต่อภายนอก */ const fetchOrganizationTelExternal = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationTelExternal) .then((res) => { @@ -790,14 +793,14 @@ const fetchOrganizationTelExternal = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; /** * เบอร์โทรสาร */ const fetchOrganizationFax = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.organizationFax) .then((res) => { @@ -813,13 +816,13 @@ const fetchOrganizationFax = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchAgencyCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationGovernmentCode(val)) .then((res) => { @@ -839,14 +842,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { let option: GovermentOption[] = []; - loaderPage(true); + showLoader(); await http .get(config.API.organizationAgencyCode(val)) .then((res) => { @@ -866,7 +869,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); return option; }; diff --git a/src/modules/02_organizational/views/MainReport.vue b/src/modules/02_organizational/views/MainReport.vue index 4733ef666..720e48dd8 100644 --- a/src/modules/02_organizational/views/MainReport.vue +++ b/src/modules/02_organizational/views/MainReport.vue @@ -146,7 +146,7 @@ const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO } = mixin; +const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin; const govermentOP = ref([]); const govermentOPfilter = ref([]); @@ -166,7 +166,7 @@ const clickAccount3 = async () => { }; const fetchOrganizationAgency = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.organizationAgency) .get(config.API.getOCType) @@ -186,12 +186,12 @@ const fetchOrganizationAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchOrganizationAgency(); }); diff --git a/src/modules/02_organizational/views/MainTree.vue b/src/modules/02_organizational/views/MainTree.vue index ad4cc8504..645f9be3f 100644 --- a/src/modules/02_organizational/views/MainTree.vue +++ b/src/modules/02_organizational/views/MainTree.vue @@ -706,7 +706,7 @@ const store = useDataStore(); const mixin = useCounterMixin(); const { loaderPage } = store; //แสดง load windows ขณะเรียก api -const { success, messageError, dialogMessage } = mixin; +const { success, messageError, dialogMessage, showLoader, hideLoader } = mixin; //Notification Component Variable const $q = useQuasar(); // show dialog @@ -868,12 +868,12 @@ const loadFileServer = async (node: any) => { manageApiErrorMsg(e); }) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; const isTreeHasDraft = async () => { - // loaderPage(true); + // showLoader(); let orgHasDraft = false; let orgPoHasDraft = false; await http @@ -889,7 +889,7 @@ const isTreeHasDraft = async () => { messageError($q, e); }) .finally(() => { - // loaderPage(false); + // hideLoader(); }); await http @@ -905,7 +905,7 @@ const isTreeHasDraft = async () => { messageError($q, e); }) .finally(() => { - // loaderPage(false); + // hideLoader(); }); if (orgHasDraft || orgPoHasDraft) { @@ -920,7 +920,7 @@ const isTreeHasDraft = async () => { */ const fetchTreeRoot = async (isDraft: boolean) => { // console.log(isDraft); - loaderPage(true); + showLoader(); console.log("Call API14 GetTreeRoot"); isShowEditTree.value = isDraft; // to show same tree that we fetch let request = ""; @@ -947,7 +947,7 @@ const fetchTreeRoot = async (isDraft: boolean) => { // messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); // if (isDraft) { // ถ้าไม่ต้องการให้แตก node root on first load ก็ไม่ต้องใส่ // ต้องอยู่ตรงนี้ ถ้าอยู่ตรง .then จะ error คาดว่ามันทำงานก่อนที่ tree จะ render เสร็จ แต่ก็อาจจะไม่ใช่ @@ -964,7 +964,7 @@ const fetchTreeRoot = async (isDraft: boolean) => { const fetchChildrenByParentId = async (node: any) => { // console.log(isDraft); console.log("Call API4"); - loaderPage(true); + showLoader(); let request = ""; if (isShowEditTree.value) { request = config.API.getDraftTreeNode(node.organizationId, node.keyId); @@ -984,7 +984,7 @@ const fetchChildrenByParentId = async (node: any) => { manageApiErrorMsg(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -1000,7 +1000,7 @@ const onLazyLoad = (node: any) => { */ console.log("Call LazyLoad"); await fetchChildrenByParentId(node.node); - /** loaderPage(true); + /** showLoader(); let request = ""; if (isShowEditTree.value) { request = config.API.getDraftTreeNode( @@ -1037,7 +1037,7 @@ const onLazyLoad = (node: any) => { // messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); });*/ node.done(node.node.children); //return ค่าให้ q-tree generate children @@ -1092,7 +1092,7 @@ const apiDeleteOrg = () => { // console.log("isShowEditTree", isShowEditTree.value); setTimeout(async () => { //delay for lazyLoad to be able to tricker again - loaderPage(true); + showLoader(); isShowEditTree.value = true; await http .delete(config.API.delTreeOrgDraft(delStructureId.value)) @@ -1111,7 +1111,7 @@ const apiDeleteOrg = () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await isTreeHasDraft(); }); }, 20); @@ -1140,7 +1140,7 @@ const apiDeletePosition = () => { isShowEditTree.value = false; setTimeout(async () => { //delay for lazyLoad to be able to tricker again - loaderPage(true); + showLoader(); isShowEditTree.value = true; await http .delete(config.API.delTreePositionDraft(delStructureId.value)) @@ -1157,7 +1157,7 @@ const apiDeletePosition = () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await isTreeHasDraft(); }); }, 20); @@ -1170,7 +1170,7 @@ const apiDeletePosition = () => { * ฟังก์ชัน clear data แบบร่าง */ const deleteDraft = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.delTreeOrgPoDraft) .then((res) => { @@ -1182,7 +1182,7 @@ const deleteDraft = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); router.go(0); await isTreeHasDraft(); }); @@ -1192,7 +1192,7 @@ const deleteDraft = async () => { * ฟังก์ชันเผยแพร่แบบร่าง */ const publishDraft = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.publishOrgPoDraft) .then((res) => { @@ -1218,7 +1218,7 @@ const publishDraft = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await isTreeHasDraft(); }); }; @@ -1317,7 +1317,7 @@ const addStructure = async (node: any) => { }); // console.log(node.organizationId); console.log("Call API1"); - loaderPage(true); + showLoader(); isShowEditTree.value = true; //ต้องกลับมาแสดง editTree อีกครั้ง & trigger lazyLoad โดย setExpanded await http .post(config.API.addTreeDraft, { @@ -1338,7 +1338,7 @@ const addStructure = async (node: any) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); popupAddOrganization.value = false; await isTreeHasDraft(); @@ -1370,7 +1370,7 @@ const editOrgStructure = async (node: any) => { if (organizCheck == true) { // console.log(node.organizationId); console.log("Call API13"); - loaderPage(true); + showLoader(); isShowEditTree.value = true; //end prepare for tricker LazyLoad await http .put(config.API.editTreeOrgDraft(node.organizationId), { @@ -1409,7 +1409,7 @@ const editOrgStructure = async (node: any) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); popupEditSelectedOrganization.value = false; await isTreeHasDraft(); }); @@ -1435,7 +1435,7 @@ const editPositionStructure = async (node: any) => { if (positionCheck == true) { console.log("Call API3"); - loaderPage(true); + showLoader(); isShowEditTree.value = true; //end prepare for tricker LazyLoad await http .put(config.API.editTreePositionDraft(node.organizationPositionId), { @@ -1457,7 +1457,7 @@ const editPositionStructure = async (node: any) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); popupEditSelectedPosition.value = false; await isTreeHasDraft(); }); @@ -1473,7 +1473,7 @@ const clickHistory = async () => { modalHistory.value = true; // rowsHistory.value = rawHistory.value.filter((f: any) => f.id == row.id); - loaderPage(true); + showLoader(); await http .get(config.API.getTreeHistory) .then((res) => { @@ -1499,7 +1499,7 @@ const clickHistory = async () => { // messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/02_organizational/views/ManageReport2.vue b/src/modules/02_organizational/views/ManageReport2.vue index ec1f389e0..2b318d53e 100644 --- a/src/modules/02_organizational/views/ManageReport2.vue +++ b/src/modules/02_organizational/views/ManageReport2.vue @@ -10,7 +10,13 @@ class="shadow-2 rounded-borders page-relative" style="height: 80vh" > - + (""); //search data table const visibleColumns = ref([]); @@ -462,7 +469,7 @@ onMounted(async () => { }); const nodeTree = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.profileOrganizRoot) .then((res: any) => { @@ -481,7 +488,7 @@ const nodeTree = async () => { }) .catch((e: any) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -495,7 +502,7 @@ const clickTree = () => { }; const onHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2HistoryId(selected.value)) .then((res) => { @@ -518,13 +525,13 @@ const onHistory = async () => { ); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; const doSearch = async () => { //ทำไว้แล้ว เหลือ ใส่ type - loaderPage(true); + showLoader(); await http .get(config.API.report2TreeId(selected.value)) .then((res) => { @@ -554,7 +561,7 @@ const doSearch = async () => { }) .catch((e) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -570,7 +577,7 @@ const onConfirm = async () => { ok: "ยืนยัน", persistent: true, }).onOk(async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2DoneId(selected.value)) .then((res) => { @@ -578,7 +585,7 @@ const onConfirm = async () => { }) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); await doSearch(); }); }); diff --git a/src/modules/02_organizational/views/ManageReport2Add.vue b/src/modules/02_organizational/views/ManageReport2Add.vue index 43b9bae2b..5502473cc 100644 --- a/src/modules/02_organizational/views/ManageReport2Add.vue +++ b/src/modules/02_organizational/views/ManageReport2Add.vue @@ -591,7 +591,7 @@ const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO } = mixin; +const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin; const id = ref(""); const myForm = ref(null); //form data input @@ -669,10 +669,10 @@ const sideWorkOPfilter = ref([]); const levelOPfilter = ref([]); onMounted(async () => { - loaderPage(false); + hideLoader(); if (route.params.id != undefined) { id.value = route.params.id.toString(); - loaderPage(true); + showLoader(); await fetchGoverment(); // await fetchAgency(); @@ -685,12 +685,12 @@ onMounted(async () => { await fetchLevel(); await fetchData(); - loaderPage(false); + hideLoader(); } }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2Id(id.value)) .then(async (res) => { @@ -723,7 +723,7 @@ const fetchData = async () => { }) .catch((e) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -739,7 +739,7 @@ const checkSave = async () => { const saveData = async () => { // console.log(myData.value); - loaderPage(true); + showLoader(); const body: RequestReport2 = { organizationShortNameId: myData.value.goverment2, organizationOrganizationId: myData.value.agency2, @@ -760,7 +760,7 @@ const saveData = async () => { }) .catch((e) => {}) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -770,7 +770,7 @@ const clickBack = () => { //รหัสส่วนราชการ const fetchGoverment = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.organizationShortName) .then((res) => { @@ -796,12 +796,12 @@ const fetchGoverment = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; const updateGoverment = async (id: string) => { - // loaderPage(true); + // showLoader(); await http .get(config.API.getPositionMasterPositionNumberId(id)) .then((res) => { @@ -890,13 +890,13 @@ const updateGoverment = async (id: string) => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; // //ตำแหน่งเลขที่ const fetchPositionNum = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.getPositionMasterPositionNumber) .then((res) => { @@ -910,13 +910,13 @@ const fetchPositionNum = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ประเภทตำแหน่ง const fetchCategory = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionType) .then((res) => { @@ -930,13 +930,13 @@ const fetchCategory = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ตำแหน่งทางการบริหาร const fetchPositionManage = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionExecutive) .then((res) => { @@ -950,13 +950,13 @@ const fetchPositionManage = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ด้านทางบริหาร const fetchSideManage = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionExecutiveSide) .then((res) => { @@ -970,13 +970,13 @@ const fetchSideManage = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ตำแหน่งในสายงาน const fetchPositionWork = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionPath) .then((res) => { @@ -990,13 +990,13 @@ const fetchPositionWork = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ด้าน/สาขา const fetchSideWork = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionSide) .then((res) => { @@ -1010,13 +1010,13 @@ const fetchSideWork = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; //ระดับตำแหน่ง const fetchLevel = async () => { - // loaderPage(true); + // showLoader(); await http .get(config.API.positionLevel) .then((res) => { @@ -1030,7 +1030,7 @@ const fetchLevel = async () => { }) .catch((e) => {}) .finally(() => { - // loaderPage(false); + // hideLoader(); }); }; diff --git a/src/modules/02_organizational/views/ManageReport2History.vue b/src/modules/02_organizational/views/ManageReport2History.vue index 255801559..c0460b936 100644 --- a/src/modules/02_organizational/views/ManageReport2History.vue +++ b/src/modules/02_organizational/views/ManageReport2History.vue @@ -351,7 +351,7 @@ const router = useRouter(); const route = useRoute(); const { loaderPage } = dataStore; -const { date2Thai, success, dateToISO } = mixin; +const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin; const id = ref(""); const previous = ref(false); const next = ref(false); @@ -360,7 +360,7 @@ const historyHead = ref([]); const historyData = ref([]); onMounted(async () => { - loaderPage(false); + hideLoader(); if (route.params.id != undefined) { id.value = route.params.id.toString(); @@ -386,7 +386,7 @@ const clickPreviousNext = async (page: string) => { }; const fetchHistory = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.report2HistoryId(id.value)) .then((res) => { @@ -402,7 +402,7 @@ const fetchHistory = async () => { }) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); if (historyHead.value.length > 1) { next.value = true; previous.value = false; @@ -414,7 +414,7 @@ const fetchHistory = async () => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get( config.API.report2HistoryDetailId( @@ -455,7 +455,7 @@ const fetchData = async () => { }) .catch((e) => {}) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/02_organizational/views/Report.vue b/src/modules/02_organizational/views/Report.vue index 75426f4da..75716aed3 100644 --- a/src/modules/02_organizational/views/Report.vue +++ b/src/modules/02_organizational/views/Report.vue @@ -109,7 +109,7 @@ const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const router = useRouter(); const route = useRoute(); -const { date2Thai, success, dateToISO } = mixin; +const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin; const govermentOP = ref([]); const govermentOPfilter = ref([]); @@ -117,7 +117,7 @@ const goverment = ref(""); const tab = ref("audit1"); const fetchOrganizationAgency = async () => { - loaderPage(true); + showLoader(); await http // .get(config.API.organizationAgency) .get(config.API.listOrganizationAgency("หน่วยงาน")) @@ -137,12 +137,12 @@ const fetchOrganizationAgency = async () => { console.log(e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchOrganizationAgency(); }); diff --git a/src/modules/03_recruiting/components/Address.vue b/src/modules/03_recruiting/components/Address.vue index 4ee38e840..8e0422c57 100644 --- a/src/modules/03_recruiting/components/Address.vue +++ b/src/modules/03_recruiting/components/Address.vue @@ -274,7 +274,7 @@ const subdistrictCOptions = ref([]); const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const emit = defineEmits(["update:form"]); watch(myform, async (count: any, prevCount: any) => { @@ -319,7 +319,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -381,7 +381,7 @@ const fetchDistrict = async (id: string, position: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -409,7 +409,7 @@ const fetchSubDistrict = async (id: string, position: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Career.vue b/src/modules/03_recruiting/components/Career.vue index 902f68346..58faf3651 100644 --- a/src/modules/03_recruiting/components/Career.vue +++ b/src/modules/03_recruiting/components/Career.vue @@ -213,7 +213,15 @@ const props = defineProps({ const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { dateThaiRange, modalDelete, modalConfirm, dateToISO, success } = mixin; +const { + dateThaiRange, + modalDelete, + modalConfirm, + dateToISO, + success, + showLoader, + hideLoader, +} = mixin; const store = useExamDataStore(); const { examData, changeExamColumns } = store; const id = ref(""); @@ -318,7 +326,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateCareer(candidateId.value)) .then((res) => { @@ -336,7 +344,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -415,7 +423,7 @@ const checkDelete = (row: RequestItemsObject) => { */ const clickDeleteRow = async () => { if (rawItem.value != null) { - loaderPage(true); + showLoader(); await http .delete(config.API.candidateAdminCareer(rawItem.value.id)) .then(() => { @@ -451,7 +459,7 @@ const clickSave = async () => { * บันทึกเพิ่มข้อมูล */ const saveData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.candidateAdminCareer(candidateId.value), { name: location.value, @@ -476,7 +484,7 @@ const saveData = async () => { * บันทึกแก้ไขข้อมูล */ const editData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.candidateAdminCareer(id.value), { name: location.value, diff --git a/src/modules/03_recruiting/components/Document.vue b/src/modules/03_recruiting/components/Document.vue index 03ab790a9..9fc236e10 100644 --- a/src/modules/03_recruiting/components/Document.vue +++ b/src/modules/03_recruiting/components/Document.vue @@ -168,7 +168,7 @@ const name = ref(""); const files = ref([]); const file = ref([]); const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; onMounted(async () => { await getData(); @@ -180,7 +180,7 @@ const fileAdd = async (val: any) => { }; const getData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateUpload(candidateId.value)) .then((res) => { @@ -191,7 +191,7 @@ const getData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -199,7 +199,7 @@ const deleteData = async (id: string) => { const params = { documentId: id, }; - loaderPage(true); + showLoader(); await http .delete(config.API.candidateUpload(candidateId.value), { params, @@ -211,7 +211,7 @@ const deleteData = async (id: string) => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); await getData(); }); }; @@ -223,7 +223,7 @@ const uploadData = async () => { }); const formData = new FormData(); formData.append("", newFile); - loaderPage(true); + showLoader(); await http .put(config.API.candidateUpload(candidateId.value), formData) .then((res) => { @@ -233,7 +233,7 @@ const uploadData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); name.value = ""; uploader.value.reset(); await getData(); diff --git a/src/modules/03_recruiting/components/Education.vue b/src/modules/03_recruiting/components/Education.vue index 6b39a276b..eb0d3a7fb 100644 --- a/src/modules/03_recruiting/components/Education.vue +++ b/src/modules/03_recruiting/components/Education.vue @@ -240,7 +240,7 @@ const rows = ref([]); const route = useRoute(); const dataStore = useDataStore(); const { loaderPage } = dataStore; -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const candidateId = ref(route.params.candidateId.toString()); const filter = ref(""); //search data table @@ -324,7 +324,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateEducation(candidateId.value)) .then((res) => { @@ -343,12 +343,12 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetcheducationLevel = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.educationLevel) .then((res) => { @@ -363,7 +363,7 @@ const fetcheducationLevel = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -444,7 +444,7 @@ const checkDelete = (row: RequestItemsObject) => { */ const clickDeleteRow = async () => { if (rawItem.value != null) { - loaderPage(true); + showLoader(); await http .delete(config.API.candidateAdminEducation(rawItem.value.id)) .then(() => { @@ -480,7 +480,7 @@ const clickSave = async () => { * บันทึกเพิ่มข้อมูล */ const saveData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.candidateAdminEducation(candidateId.value), { educationLevelId: educationLevelId.value, @@ -505,7 +505,7 @@ const saveData = async () => { * บันทึกแก้ไขข้อมูล */ const editData = async () => { - loaderPage(true); + showLoader(); await http .put(config.API.candidateAdminEducation(id.value), { educationLevelId: educationLevelId.value, diff --git a/src/modules/03_recruiting/components/ExamFinished.vue b/src/modules/03_recruiting/components/ExamFinished.vue index 57a8d2582..9957d4694 100644 --- a/src/modules/03_recruiting/components/ExamFinished.vue +++ b/src/modules/03_recruiting/components/ExamFinished.vue @@ -113,7 +113,7 @@ const props = defineProps({ const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { messageError, date2Thai } = mixin; +const { messageError, date2Thai, showLoader, hideLoader } = mixin; const dataStore = useDataStore(); const { loaderPage } = dataStore; const fullName = ref(""); @@ -136,7 +136,7 @@ onMounted(async () => { }); const fetchCard = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateCard(props.candidateId)) .then((res) => { @@ -178,7 +178,7 @@ const fetchCard = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Family.vue b/src/modules/03_recruiting/components/Family.vue index 6dbe2e344..9954a8924 100644 --- a/src/modules/03_recruiting/components/Family.vue +++ b/src/modules/03_recruiting/components/Family.vue @@ -302,7 +302,7 @@ const $q = useQuasar(); const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const edit = ref(true); const myform = ref({}); const route = useRoute(); @@ -323,7 +323,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateFamily(candidateId.value)) .then((res) => { @@ -350,7 +350,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Information.vue b/src/modules/03_recruiting/components/Information.vue index ade873016..d88b0b876 100644 --- a/src/modules/03_recruiting/components/Information.vue +++ b/src/modules/03_recruiting/components/Information.vue @@ -430,7 +430,8 @@ const props = defineProps({ const $q = useQuasar(); const mixin = useCounterMixin(); -const { date2Thai, calAge, modalError, success } = mixin; +const { date2Thai, calAge, modalError, success, showLoader, hideLoader } = + mixin; const districtOptions = ref([]); const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); @@ -463,7 +464,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateInformation(candidateId.value)) .then((res) => { @@ -494,12 +495,12 @@ const fetchData = async () => { keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.family_name; }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchImgData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateProfile(candidateId.value)) .then((res) => { @@ -510,7 +511,7 @@ const fetchImgData = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -542,7 +543,7 @@ const selectProvince = (val: string) => { }; const fetchDistrict = async (id: string) => { - loaderPage(true); + showLoader(); await http .get(config.API.listDistrict(id)) .then((res) => { @@ -557,7 +558,7 @@ const fetchDistrict = async (id: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Occupation.vue b/src/modules/03_recruiting/components/Occupation.vue index b9c22a933..9a69cca2e 100644 --- a/src/modules/03_recruiting/components/Occupation.vue +++ b/src/modules/03_recruiting/components/Occupation.vue @@ -283,7 +283,7 @@ const candidateId = ref(route.params.candidateId.toString()); const dataStore = useDataStore(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const emit = defineEmits(["update:form"]); @@ -300,7 +300,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.candidateOccupation(candidateId.value)) .then((res) => { @@ -327,7 +327,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/Profile.vue b/src/modules/03_recruiting/components/Profile.vue index 0d70ca2d0..482cd4648 100644 --- a/src/modules/03_recruiting/components/Profile.vue +++ b/src/modules/03_recruiting/components/Profile.vue @@ -21,7 +21,11 @@
- +
@@ -94,7 +98,7 @@ const formAddress = ref({}); const formFamily = ref({}); const formOccupation = ref({}); const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const emit = defineEmits([ "update:formInformation", @@ -120,14 +124,14 @@ watch(formOccupation, async (count: Object, prevCount: Object) => { }); onMounted(() => { - loaderPage(false); + hideLoader(); fetchPrefix(); fetchRelationship(); fetchProvince(); }); const fetchPrefix = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.prefix) .then((res) => { @@ -142,12 +146,12 @@ const fetchPrefix = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchRelationship = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.relationship) .then((res) => { @@ -162,12 +166,12 @@ const fetchRelationship = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchProvince = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.province) .then((res) => { @@ -182,7 +186,7 @@ const fetchProvince = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/components/TableCandidate.vue b/src/modules/03_recruiting/components/TableCandidate.vue index 2f56c1907..ef97b299f 100644 --- a/src/modules/03_recruiting/components/TableCandidate.vue +++ b/src/modules/03_recruiting/components/TableCandidate.vue @@ -155,7 +155,7 @@ const table = ref(null); const files = ref([]); const filterRef = ref(null); const examId = ref(route.params.examId.toString()); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const props = defineProps({ inputfilter: String, inputvisible: Array, @@ -278,7 +278,7 @@ const uploadFile = async () => { }; const uploadDataSeat = async () => { - loaderPage(true); + showLoader(); const formData = new FormData(); formData.append("", files.value[0]); await http @@ -290,14 +290,14 @@ const uploadDataSeat = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); files.value = []; props.fetchData(); }); }; const uploadDataPoint = async () => { - loaderPage(true); + showLoader(); const formData = new FormData(); formData.append("", files.value[0]); await http @@ -310,14 +310,14 @@ const uploadDataPoint = async () => { messageError($q, e); }) .finally(async () => { - loaderPage(false); + hideLoader(); files.value = []; props.fetchData(); }); }; const downloadFile = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodExamDownload(examId.value), { responseType: "blob", @@ -330,12 +330,12 @@ const downloadFile = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadFileDetail = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.periodExamDownloadDetail(examId.value), { responseType: "blob", @@ -348,7 +348,7 @@ const downloadFileDetail = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/01_compete/Detail.vue b/src/modules/03_recruiting/views/01_compete/Detail.vue index 5be19e731..5656262f3 100644 --- a/src/modules/03_recruiting/views/01_compete/Detail.vue +++ b/src/modules/03_recruiting/views/01_compete/Detail.vue @@ -134,7 +134,7 @@ const router = useRouter(); const route = useRoute(); const { loaderPage } = dataStore; const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const year = ref(""); const round = ref(""); const name = ref(""); @@ -337,7 +337,7 @@ const pagesNumber = computed(() => { }); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); @@ -346,7 +346,7 @@ const clickDetail = (examID: string) => { }; const downloadExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.exportExam(importId.value), { responseType: "blob", @@ -362,12 +362,12 @@ const downloadExam = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadPassExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.exportPassExam(importId.value), { responseType: "blob", @@ -383,12 +383,12 @@ const downloadPassExam = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadPassResultExam = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.exportPassResultExam(importId.value), { responseType: "blob", @@ -404,12 +404,12 @@ const downloadPassResultExam = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .post(config.API.getExamResultById(importId.value), { examAttribute: "", @@ -437,7 +437,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/01_compete/DetailEx.vue b/src/modules/03_recruiting/views/01_compete/DetailEx.vue index e40b50e5f..2e0bfe601 100644 --- a/src/modules/03_recruiting/views/01_compete/DetailEx.vue +++ b/src/modules/03_recruiting/views/01_compete/DetailEx.vue @@ -26,12 +26,16 @@ {{ profile_id }} -
คำนำหน้านาม
+
+ คำนำหน้านาม +
{{ prefix }}
-
ชื่อ-นามสกุล
+
+ ชื่อ-นามสกุล +
{{ fullname }}
@@ -55,17 +59,23 @@ {{ position_name }} -
สถานศึกษา
+
+ สถานศึกษา +
{{ university }}
-
วุฒิการศึกษา
+
+ วุฒิการศึกษา +
{{ degree }}
-
สาขาวิชาเอก
+
+ สาขาวิชาเอก +
{{ major }}
@@ -118,7 +128,11 @@ >ดาวน์โหลดผลคะแนน - + ดาวน์โหลดเอกสารรับรอง @@ -138,12 +152,18 @@
-
ประเภท
-
คะแนนเต็ม
+
+ ประเภท +
+
+ คะแนนเต็ม +
คะแนนที่ได้
-
+
ภาค ก
@@ -181,10 +201,16 @@
คะแนน
-
ผลการสอบ
-
+
+ ผลการสอบ +
+
{{ examResultinscore }}
@@ -194,7 +220,9 @@ {{ number }}
-
วันหมดอายุบัญชีสอบแข่งขัน
+
+ วันหมดอายุบัญชีสอบแข่งขัน +
{{ score_expired }}
@@ -241,7 +269,7 @@ const examCount = ref(""); const number = ref(""); const score_expired = ref(""); const mixin = useCounterMixin(); -const { messageError } = mixin; +const { messageError, showLoader, hideLoader } = mixin; const examID = ref("62150001"); const prefix = ref("นาย"); const fullname = ref("เกียรติศักดิ์ บัณฑิต"); @@ -253,7 +281,7 @@ onMounted(async () => { }); const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getExamDetail(importId.value, examId.value)) .then((res) => { @@ -290,12 +318,12 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadScore = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.downloadScoreReport(importId.value, examId.value), { responseType: "blob", @@ -311,12 +339,12 @@ const downloadScore = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const downloadCertificate = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.downloadExamReport(importId.value, examId.value, 2), { responseType: "blob", @@ -332,7 +360,7 @@ const downloadCertificate = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/01_compete/Period.vue b/src/modules/03_recruiting/views/01_compete/Period.vue index 8b5a2528e..933d99932 100644 --- a/src/modules/03_recruiting/views/01_compete/Period.vue +++ b/src/modules/03_recruiting/views/01_compete/Period.vue @@ -316,7 +316,10 @@ - +
@@ -379,7 +382,7 @@ const name = ref(""); const year = ref(new Date().getFullYear() + 543); const order = ref(1); const mixin = useCounterMixin(); -const { success, dateToISO, dateText } = mixin; +const { success, dateToISO, dateText, showLoader, hideLoader } = mixin; const files = ref(null); const files_score = ref(null); const files_candidate = ref(null); @@ -551,7 +554,7 @@ const visibleColumnsHistory = ref([ ]); onMounted(async () => { - loaderPage(false); + hideLoader(); await fetchData(); }); @@ -564,7 +567,7 @@ const textDate = (value: Date) => { }; const fetchData = async () => { - loaderPage(true); + showLoader(); await http .get(config.API.getCandidates) .then((res) => { @@ -586,7 +589,7 @@ const fetchData = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -620,7 +623,7 @@ const clickEditPeriod = (id: string) => { const clickHistory = async (id: string) => { modalHistory.value = true; - loaderPage(true); + showLoader(); await http .get(config.API.getImportHistory(id)) .then((res) => { @@ -649,7 +652,7 @@ const clickHistory = async (id: string) => { statusCode.value = e.response.data.status; }) .finally(async () => { - loaderPage(false); + hideLoader(); }); }; @@ -664,7 +667,7 @@ const clickDelete = (id: string) => { persistent: true, }) .onOk(async () => { - loaderPage(true); + showLoader(); await http .delete(config.API.deleteCandidates(id)) .then((res) => { @@ -675,7 +678,7 @@ const clickDelete = (id: string) => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }) .onCancel(() => {}) @@ -704,7 +707,7 @@ const clickCloseCandidate = async () => { const checkSaveCandidate = async () => { const fd = new FormData(); fd.append("attachment", files_candidate.value[0]); - loaderPage(true); + showLoader(); await http .post(config.API.uploadCandidates(selected_row_id.value), fd) .then((res) => { @@ -717,14 +720,14 @@ const checkSaveCandidate = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; const checkSaveScore = async () => { const fd = new FormData(); fd.append("attachment", files_score.value[0]); - loaderPage(true); + showLoader(); await http .post(config.API.saveScores(selected_row_id.value), fd) .then((res) => { @@ -737,7 +740,7 @@ const checkSaveScore = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; @@ -747,7 +750,7 @@ const checkSave = async () => { fd.append("year", year.value.toString()); fd.append("order", order.value.toString()); fd.append("name", name.value); - loaderPage(true); + showLoader(); await http .post(config.API.saveCandidates, fd) .then((res) => { @@ -759,7 +762,7 @@ const checkSave = async () => { messageError($q, e); }) .finally(() => { - loaderPage(false); + hideLoader(); }); }; diff --git a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue index 65fa88c12..ec4009d6b 100644 --- a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue @@ -25,7 +25,10 @@ label="ชื่อรอบการสอบแข่งขัน/ชื่อประกาศ" dense lazy-rules - :rules="[(val) => !!val || `${'กรุณากรอกชื่อรอบการสอบแข่งขัน/ชื่อประกาศ'}`]" + :rules="[ + (val) => + !!val || `${'กรุณากรอกชื่อรอบการสอบแข่งขัน/ชื่อประกาศ'}`, + ]" >
@@ -83,7 +86,9 @@ dense lazy-rules input-class="text-right" - :rules="[(val) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`]" + :rules="[ + (val) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`, + ]" >
@@ -295,7 +300,9 @@ @removed="fileRemoveImg" >