From fb2b9b4c30813619899378f1cc5b7ac10181249a Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Tue, 21 May 2024 13:10:02 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20format?= =?UTF-8?q?=20code=20+=20comment=20+=20=E0=B9=80=E0=B8=8A=E0=B9=87?= =?UTF-8?q?=E0=B8=84=20paging=20=E0=B9=80=E0=B8=A1=E0=B8=99=E0=B8=B9?= =?UTF-8?q?=E0=B8=9E=E0=B8=B1=E0=B8=92=E0=B8=99=E0=B8=B2=E0=B8=9A=E0=B8=B8?= =?UTF-8?q?=E0=B8=84=E0=B8=A5=E0=B8=B2=E0=B8=81=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15_development/components/BasicInfo.vue | 5 ++++- .../components/history/DialogGov.vue | 6 +----- .../components/history/DialogProject.vue | 5 ----- .../components/historyEmployee/DialogGov.vue | 10 +++++---- .../historyEmployee/DialogProject.vue | 5 ----- .../15_development/views/EmployeeHistory.vue | 15 +++++++------ src/modules/15_development/views/History.vue | 8 +++++-- src/modules/15_development/views/MainPage.vue | 21 ++++++++++--------- 8 files changed, 35 insertions(+), 40 deletions(-) diff --git a/src/modules/15_development/components/BasicInfo.vue b/src/modules/15_development/components/BasicInfo.vue index da1a73482..a6dfe53d8 100644 --- a/src/modules/15_development/components/BasicInfo.vue +++ b/src/modules/15_development/components/BasicInfo.vue @@ -126,7 +126,9 @@ function fetchTree(id: string) { }); } -/** function เลือกหน่วยงาน*/ +/** function เลือกหน่วยงาน + * @param data ข้อมูลทั้งหมดของ row +*/ function updateSelected(data: DataTree) { orgName.value = data.orgTreeName; formData.node = data.orgLevel; @@ -134,6 +136,7 @@ function updateSelected(data: DataTree) { formData.orgRevisionId = data.orgRevisionId; } +/** ดึงข้อมูลเมื่อโหลดหน้าเสร็จสิ้น */ onMounted(async () => { fetchActive(); }); diff --git a/src/modules/15_development/components/history/DialogGov.vue b/src/modules/15_development/components/history/DialogGov.vue index 8b036f629..b531b8541 100644 --- a/src/modules/15_development/components/history/DialogGov.vue +++ b/src/modules/15_development/components/history/DialogGov.vue @@ -42,13 +42,11 @@ const pagination = ref({ const $q = useQuasar(); const mixin = useCounterMixin(); const { - dialogConfirm, messageError, dialogMessageNotify, showLoader, hideLoader, } = mixin; -const store = useDevelopmentDataStore(); const modal = defineModel("modal", { required: true }); @@ -56,9 +54,6 @@ const selected = ref([]); const search = ref("citizenId"); const inputSearch = ref(""); -const inputType = computed(() => { - return search.value === "citizenId" ? "number" : "text"; -}); const govOp = ref([ { id: "citizenId", @@ -78,6 +73,7 @@ const visibleColumns = ref([ "level", "positionSide", ]); + const columns = ref([ { name: "citizenId", diff --git a/src/modules/15_development/components/history/DialogProject.vue b/src/modules/15_development/components/history/DialogProject.vue index 38fef30cc..a5625e8e9 100644 --- a/src/modules/15_development/components/history/DialogProject.vue +++ b/src/modules/15_development/components/history/DialogProject.vue @@ -23,7 +23,6 @@ const year = ref(""); const $q = useQuasar(); const mixin = useCounterMixin(); const { - dialogConfirm, messageError, dialogMessageNotify, showLoader, @@ -66,10 +65,6 @@ const projectOp = ref([ id: "year", name: "ปีงบประมาณ", }, - // { - // id: "ID3", - // name: "ชื่อหน่วยงานที่รับผิดชอบ", - // }, ]); const visibleColumns = ref(["project", "year", "organizingTraining"]); diff --git a/src/modules/15_development/components/historyEmployee/DialogGov.vue b/src/modules/15_development/components/historyEmployee/DialogGov.vue index ca4a6474c..1faac4e0f 100644 --- a/src/modules/15_development/components/historyEmployee/DialogGov.vue +++ b/src/modules/15_development/components/historyEmployee/DialogGov.vue @@ -2,14 +2,12 @@ import { ref, watch, computed,reactive } from "vue"; import Header from "@/components/DialogHeader.vue"; import type { DataOption,FormFilter,NewPagination } from "@/modules/15_development/interface/index/Main"; -import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar, type QTableProps } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; - const rows = ref([]) const props = defineProps({ upDate: { type: Function }, @@ -199,13 +197,17 @@ function searchFilter() { }); } -/** update ค่า เเถวข้อมูล */ +/** update ค่า เเถวข้อมูล + * @param val ตัวเลขที่มีการเปลี่ยนค่า +*/ function updatePage(val:number){ formFilter.page = val; searchFilter(); } -/** update ค่า เเถวข้อมูล */ +/** update ค่า เเถวข้อมูล + * @param newPagination ตัวเลขที่มีการเปลี่ยนค่า +*/ function updatePageSize(newPagination: NewPagination) { formFilter.page = 1; formFilter.pageSize = newPagination.rowsPerPage; diff --git a/src/modules/15_development/components/historyEmployee/DialogProject.vue b/src/modules/15_development/components/historyEmployee/DialogProject.vue index 87708a9a6..d27357e8b 100644 --- a/src/modules/15_development/components/historyEmployee/DialogProject.vue +++ b/src/modules/15_development/components/historyEmployee/DialogProject.vue @@ -62,14 +62,9 @@ const projectOp = ref([ id: "year", name: "ปีงบประมาณ", }, - // { - // id: "ID3", - // name: "ชื่อหน่วยงานที่รับผิดชอบ", - // }, ]); const visibleColumns = ref(["project", "year", "organizingTraining"]); - const columns = ref([ { name: "project", diff --git a/src/modules/15_development/views/EmployeeHistory.vue b/src/modules/15_development/views/EmployeeHistory.vue index 4ecd0affb..db63323c1 100644 --- a/src/modules/15_development/views/EmployeeHistory.vue +++ b/src/modules/15_development/views/EmployeeHistory.vue @@ -20,12 +20,8 @@ const router = useRouter(); const store = useDevelopmentDataStore(); const $q = useQuasar(); const { showLoader, hideLoader, messageError } = useCounterMixin(); - - - const maxPage = ref(1); const totalList = ref(0); //จำนวนข้อมูลรายการ - const formFilter = reactive({ root: null, page: 1, @@ -154,7 +150,9 @@ function fetchListOrg() { }); } -/** download file */ +/** download file + * @param type ประเภทของไฟล์ xlsx pdf +*/ function onDownload(type: string) { showLoader(); http @@ -174,7 +172,9 @@ function onDownload(type: string) { }); } -/** edit page */ +/** edit page + * @param id id ของ row +*/ function onEdit(id: string) { store.statusEdit = true; router.push(`/development/employee-history/${id}`); @@ -229,8 +229,7 @@ watch( } ); - - +/** ดึงข้อมูลเมื่อโหลดหน้าเสร็จสิ้น */ onMounted(() => { fetchListOrg(); }); diff --git a/src/modules/15_development/views/History.vue b/src/modules/15_development/views/History.vue index c451179c6..5d12ab1a2 100644 --- a/src/modules/15_development/views/History.vue +++ b/src/modules/15_development/views/History.vue @@ -38,7 +38,6 @@ const router = useRouter(); const store = useDevelopmentDataStore(); const $q = useQuasar(); const { showLoader, hideLoader, messageError } = useCounterMixin(); - const agencyOp = ref<[]>([]); const rows = ref([]); @@ -195,6 +194,9 @@ function getData() { }); } +/** download file + * @param type ประเภทของไฟล์ xlsx pdf +*/ function onDownload(type: string) { showLoader(); http @@ -219,7 +221,9 @@ function onDownload(type: string) { }); } -/** edit page */ +/** edit page + * @param id id ของ row +*/ function onEdit(id: string) { store.statusEdit = true; router.push(`/development/history/${id}`); diff --git a/src/modules/15_development/views/MainPage.vue b/src/modules/15_development/views/MainPage.vue index 669275d68..a29b7688d 100644 --- a/src/modules/15_development/views/MainPage.vue +++ b/src/modules/15_development/views/MainPage.vue @@ -37,9 +37,17 @@ const filter = ref(""); const filterMain = ref(""); const splitterModel = ref(60); const modal = ref(false); +const totalList = ref(0); //จำนวนข้อมูลรายการ +const totalPage = ref(1); + +const statusOpt = ref([ + { id: "ONGOING", name: "กำลังดำเนินการ" }, + { id: "FINISH", name: "เสร็จสิ้นโครงการ" }, +]); /** หัวตาราง */ const rows = ref([]); // ข้อมูลรายการ +const visibleColumns = ref(["year", "projectName", "root"]); const columns = ref([ { name: "year", @@ -71,13 +79,8 @@ const columns = ref([ style: "font-size: 14px ; width:45% ", }, ]); -const visibleColumns = ref(["year", "projectName", "root"]); - -const statusOpt = ref([ - { id: "ONGOING", name: "กำลังดำเนินการ" }, - { id: "FINISH", name: "เสร็จสิ้นโครงการ" }, -]); +/** formProject */ const formProject = reactive({ year: null, projectName: "", @@ -86,7 +89,7 @@ const formProject = reactive({ orgRevisionId: null, }); -/** formQuery*/ +/** formQuery */ const formQuery = reactive({ year: new Date().getFullYear(), page: 1, @@ -98,9 +101,6 @@ const formQuery = reactive({ nodeId: null, }); -const totalList = ref(0); //จำนวนข้อมูลรายการ -const totalPage = ref(1); - /** funciton fetch รายการโครงการ*/ function fetchListProject() { showLoader(); @@ -262,6 +262,7 @@ watch( } ); +/** ดึงข้อมูลเมื่อโหลดหน้าเสร็จสิ้น */ onMounted(() => { fetchActive(); fetchListProject();