From ffde0fe79c7589cffa76744474d6849dd5edf0f7 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 20 Aug 2024 10:39:17 +0700 Subject: [PATCH] updated get tree by system --- src/components/Dialogs/DialogOrgSelect.vue | 2 +- .../Dialogs/DialogOrgSelectEmployee.vue | 6 +- .../Dialogs/DialogOrgSelectOneStep.vue | 6 +- .../indicatorByPlan/IndicatorByPlan.vue | 2 +- .../Indicators/indicatorByRole/DetailView.vue | 2 +- .../01_masterdata/views/indicatorByPlan.vue | 2 +- .../02_organization/components/TreeView.vue | 2 +- .../views/ExampleSearchTree.vue | 2 +- src/modules/04_registryPerson/views/list.vue | 2 +- .../PersonalList/DialogSelectOrg.vue | 5 +- .../components/Receive/receiveModal.vue | 4 +- .../components/resign/DetailByidDeceased.vue | 2 +- .../components/2_Manage/listManage.vue | 4 +- .../components/3_result/Dialogbody.vue | 4 +- .../components/4_Allocate/OrgList.vue | 3 +- .../components/5_Borrow/DialogForm.vue | 4 +- .../components/DialogSelectPos.vue | 2 +- .../components/1_Complaint/Form.vue | 10 +- .../components/2_InvestigateFacts/Form.vue | 18 +++- .../3_InvestigateDisciplinary/Form.vue | 93 +++++++++++-------- .../components/4_Result/Form.vue | 2 +- src/modules/14_KPI/views/report.vue | 4 +- .../15_development/components/BasicInfo.vue | 2 +- .../components/DialogSelectAgency.vue | 4 +- src/modules/15_development/views/MainPage.vue | 5 +- .../components/DialogSuccession.vue | 4 +- .../components/TreeView.vue | 4 +- 27 files changed, 128 insertions(+), 72 deletions(-) diff --git a/src/components/Dialogs/DialogOrgSelect.vue b/src/components/Dialogs/DialogOrgSelect.vue index a62570a17..668e78ccc 100644 --- a/src/components/Dialogs/DialogOrgSelect.vue +++ b/src/components/Dialogs/DialogOrgSelect.vue @@ -367,7 +367,7 @@ async function getActive() { async function getTreeData(id: string) { showLoader(); await http - .get(config.API.orgByid(id)) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; nodes.value = data; diff --git a/src/components/Dialogs/DialogOrgSelectEmployee.vue b/src/components/Dialogs/DialogOrgSelectEmployee.vue index 10abe1812..6829cf5fa 100644 --- a/src/components/Dialogs/DialogOrgSelectEmployee.vue +++ b/src/components/Dialogs/DialogOrgSelectEmployee.vue @@ -4,6 +4,8 @@ import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import { ref, watch, reactive } from "vue"; import type { QTableProps } from "quasar"; +import { useRoute } from "vue-router"; + import http from "@/plugins/http"; import config from "@/app.config"; @@ -36,6 +38,8 @@ const { dialogMessageNotify, } = mixin; +const route = useRoute(); + const modal = defineModel("modal", { required: true }); const title = defineModel("title", { required: true }); const type = defineModel("type", { required: true }); @@ -343,7 +347,7 @@ async function getActive() { async function getTreeData(id: string) { showLoader(); await http - .get(config.API.orgByid(id)) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; nodes.value = data; diff --git a/src/components/Dialogs/DialogOrgSelectOneStep.vue b/src/components/Dialogs/DialogOrgSelectOneStep.vue index 5ee8ba998..12e44f743 100644 --- a/src/components/Dialogs/DialogOrgSelectOneStep.vue +++ b/src/components/Dialogs/DialogOrgSelectOneStep.vue @@ -4,6 +4,8 @@ import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import { ref, watch, reactive } from "vue"; import type { QInput, QTableProps } from "quasar"; +import { useRoute } from "vue-router"; + import http from "@/plugins/http"; import config from "@/app.config"; @@ -38,6 +40,8 @@ const { dialogMessageNotify, } = mixin; +const route = useRoute(); + const modal = defineModel("modal", { required: true }); const title = defineModel("title", { required: true }); const selectedModal = defineModel("selectedModal"); @@ -250,7 +254,7 @@ async function getActive() { async function getTreeData(id: string) { showLoader(); await http - .get(config.API.orgByid(id)) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; nodes.value = data; diff --git a/src/modules/01_masterdata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue b/src/modules/01_masterdata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue index 8ee20c2cd..ee6c1a6da 100644 --- a/src/modules/01_masterdata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue +++ b/src/modules/01_masterdata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue @@ -109,7 +109,7 @@ function fetchTreeStrategy() { function fetchTreeAgency(id: string) { showLoader(); http - .get(config.API.orgByid(id.toString())) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then(async (res) => { const data = res.data.result; nodeAgency.value = data; diff --git a/src/modules/01_masterdata/components/Indicators/indicatorByRole/DetailView.vue b/src/modules/01_masterdata/components/Indicators/indicatorByRole/DetailView.vue index fcada0b47..be528f976 100644 --- a/src/modules/01_masterdata/components/Indicators/indicatorByRole/DetailView.vue +++ b/src/modules/01_masterdata/components/Indicators/indicatorByRole/DetailView.vue @@ -235,7 +235,7 @@ function fetchActive() { async function fetchTree(id: string) { showLoader(); http - .get(config.API.orgByid(id.toString())) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; node.value = data; diff --git a/src/modules/01_masterdata/views/indicatorByPlan.vue b/src/modules/01_masterdata/views/indicatorByPlan.vue index c58689350..e7bc4eabc 100644 --- a/src/modules/01_masterdata/views/indicatorByPlan.vue +++ b/src/modules/01_masterdata/views/indicatorByPlan.vue @@ -123,7 +123,7 @@ function fetchActive() { async function fetchTree(id: string) { showLoader(); http - .get(config.API.orgByid(id.toString())) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; node.value = data; diff --git a/src/modules/02_organization/components/TreeView.vue b/src/modules/02_organization/components/TreeView.vue index 8403f3631..6d50dc253 100644 --- a/src/modules/02_organization/components/TreeView.vue +++ b/src/modules/02_organization/components/TreeView.vue @@ -61,7 +61,7 @@ async function fetchDataTree(id: string) { isLoadTree.value = false; showLoader(); await http - .get(config.API.orgByid(id.toString())) + .get(config.API.orgByid(id)) .then((res) => { const data = res.data.result; nodeTree.value = data; diff --git a/src/modules/02_organization/views/ExampleSearchTree.vue b/src/modules/02_organization/views/ExampleSearchTree.vue index e5a3f04a9..c47e063b9 100644 --- a/src/modules/02_organization/views/ExampleSearchTree.vue +++ b/src/modules/02_organization/views/ExampleSearchTree.vue @@ -28,7 +28,7 @@ const idVal = ref(""); async function fetchDataTree(id: string) { showLoader(); await http - .get(config.API.orgByid(id.toString())) + .get(config.API.orgByid(id)) .then((res) => { const data = res.data.result; nodes.value = data; diff --git a/src/modules/04_registryPerson/views/list.vue b/src/modules/04_registryPerson/views/list.vue index c88ecb7b9..43ed2014c 100644 --- a/src/modules/04_registryPerson/views/list.vue +++ b/src/modules/04_registryPerson/views/list.vue @@ -322,7 +322,7 @@ function clearSelect(t: string) { async function fetchTree(id: string) { showLoader(); http - .get(config.API.orgByIdSystem(id.toString(), route.meta.Key)) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; node.value = data; diff --git a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue index 7ee2ee0df..5439e276c 100644 --- a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue +++ b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue @@ -20,6 +20,9 @@ import CardPosition from "@/modules/05_placement/components/PersonalList/CardPos /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; import { useSelectOrgStore } from "@/modules/05_placement/stores/storeSelect"; +import { useRoute } from "vue-router"; + +const route = useRoute(); /** use*/ const $q = useQuasar(); @@ -93,7 +96,7 @@ async function fetchOrganizationActive() { async function fetchDataTree(id: string) { showLoader(); await http - .get(config.API.orgByid(id.toString())) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; if (data) { diff --git a/src/modules/05_placement/components/Receive/receiveModal.vue b/src/modules/05_placement/components/Receive/receiveModal.vue index dd9926c23..d0e9db52c 100644 --- a/src/modules/05_placement/components/Receive/receiveModal.vue +++ b/src/modules/05_placement/components/Receive/receiveModal.vue @@ -21,6 +21,7 @@ import type { DataPositionNo, TreeMain, } from "@/modules/05_placement/interface/response/Receive"; +import { useRoute } from "vue-router"; const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const { @@ -33,6 +34,7 @@ const { } = mixin; //ฟังก์ชันกลางที่เรียกใช้ const nodeLevel = ref(0); +const route = useRoute(); const isAll = ref(false); const isBlank = ref(false); @@ -471,7 +473,7 @@ function getSumPosition(data: SumPosition) { async function fetchDataTree(id: string) { showLoader(); await http - .get(config.API.orgByid(id.toString())) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; nodes.value = data; diff --git a/src/modules/06_retirement/components/resign/DetailByidDeceased.vue b/src/modules/06_retirement/components/resign/DetailByidDeceased.vue index 6ece5e9c9..ebac6c8a4 100644 --- a/src/modules/06_retirement/components/resign/DetailByidDeceased.vue +++ b/src/modules/06_retirement/components/resign/DetailByidDeceased.vue @@ -276,7 +276,7 @@ async function getActive() { async function getTreeData(id: string) { showLoader(); await http - .get(config.API.orgByid(id)) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; nodes.value = data; diff --git a/src/modules/07_insignia/components/2_Manage/listManage.vue b/src/modules/07_insignia/components/2_Manage/listManage.vue index 5b98de4e1..1718fe7a1 100644 --- a/src/modules/07_insignia/components/2_Manage/listManage.vue +++ b/src/modules/07_insignia/components/2_Manage/listManage.vue @@ -17,6 +17,7 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; //หม import { useCounterMixin } from "@/stores/mixin"; import { useInsigniaDataStore } from "@/modules/07_insignia/store"; import { useroleUserDataStore } from "@/stores/roleUser"; +import { useRoute } from "vue-router"; /**use */ const $q = useQuasar(); //ใช้ noti quasar @@ -24,6 +25,7 @@ const roleDataStore = useroleUserDataStore(); const DataStore = useInsigniaDataStore(); const mixin = useCounterMixin(); const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin; +const route = useRoute(); /** * ตัวแปร @@ -137,7 +139,7 @@ function fetchActiveId() { function fetchListOrg(id: string) { showLoader(); http - .get(config.API.orgByid(id)) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then(async (res) => { const data = await res.data.result.map((item: any) => ({ id: item.orgTreeId, diff --git a/src/modules/07_insignia/components/3_result/Dialogbody.vue b/src/modules/07_insignia/components/3_result/Dialogbody.vue index 1c8dae5ab..684e9a066 100644 --- a/src/modules/07_insignia/components/3_result/Dialogbody.vue +++ b/src/modules/07_insignia/components/3_result/Dialogbody.vue @@ -14,6 +14,7 @@ import DialogHeader from "../DialogHeader.vue"; /** import Stores */ import { useCounterMixin } from "@/stores/mixin"; +import { useRoute } from "vue-router"; /** useStore*/ const mixin = useCounterMixin(); @@ -27,6 +28,7 @@ const { dateToISO, } = mixin; +const route = useRoute(); const $q = useQuasar(); const myForm = ref(); @@ -126,7 +128,7 @@ function fetchOrgList() { const data = res.data.result; http - .get(config.API.orgByid(data.activeId)) + .get(config.API.orgByIdSystem(data.activeId, route.meta.Key as string)) .then(async (res) => { const data = await res.data.result.map((item: any) => ({ id: item.orgTreeId, diff --git a/src/modules/07_insignia/components/4_Allocate/OrgList.vue b/src/modules/07_insignia/components/4_Allocate/OrgList.vue index f35bae995..a442ce07b 100644 --- a/src/modules/07_insignia/components/4_Allocate/OrgList.vue +++ b/src/modules/07_insignia/components/4_Allocate/OrgList.vue @@ -144,7 +144,7 @@ async function fetchOrgList() { const data = res.data.result; http - .get(config.API.orgByid(data.activeId)) + .get(config.API.orgByIdSystem(data.activeId, route.meta.Key as string)) .then(async (res) => { const data = await res.data.result.map((item: any) => ({ id: item.orgTreeId, @@ -468,7 +468,6 @@ onMounted(async () => { {{ props.row.remain }} - diff --git a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue index 2a84c1873..e24b252e2 100644 --- a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue +++ b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue @@ -13,9 +13,11 @@ import DialogHeader from "@/components/DialogHeader.vue"; /** impotrStores */ import { useCounterMixin } from "@/stores/mixin"; import { useBrrowDataStore } from "@/modules/07_insignia/storeBrrow"; +import { useRoute } from "vue-router"; const $q = useQuasar(); const myForm = ref(); +const route = useRoute(); const DataStore = useBrrowDataStore(); const mixin = useCounterMixin(); @@ -133,7 +135,7 @@ async function fetchOrgList() { const data = res.data.result; http - .get(config.API.orgByid(data.activeId)) + .get(config.API.orgByIdSystem(data.activeId, route.meta.Key as string)) .then(async (res) => { const data = await res.data.result.map((item: any) => ({ id: item.orgTreeId, diff --git a/src/modules/08_registryEmployee/components/DialogSelectPos.vue b/src/modules/08_registryEmployee/components/DialogSelectPos.vue index 8edf6e592..e925afa3b 100644 --- a/src/modules/08_registryEmployee/components/DialogSelectPos.vue +++ b/src/modules/08_registryEmployee/components/DialogSelectPos.vue @@ -229,7 +229,7 @@ async function fetchOrganizationActive() { async function fetchDataTree(id: string) { showLoader(); await http - .get(config.API.orgByIdSystem(id.toString(), route.meta.Key)) + .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then((res) => { const data = res.data.result; if (data) { diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 29f6ed01a..dd21dc4a1 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -46,7 +46,7 @@ const { messageError, hideLoader, showLoader, - downloadRenameFileByLink + downloadRenameFileByLink, } = mixin; const { filterSelector } = complainstStore; // function จาก store complainstStore @@ -141,7 +141,6 @@ function onSubmit() { }); } - /** * ลบไฟล์ * @param id id file @@ -283,7 +282,7 @@ async function getActive() { async function getOc(activeId: string) { showLoader(); await http - .get(config.API.orgByid(activeId)) + .get(config.API.orgByIdSystem(activeId, route.meta.Key as string)) .then(async (res) => { const data = await res.data.result.map((item: any) => ({ organizationId: item.orgTreeId, @@ -1041,7 +1040,10 @@ function filterOptionFnAgency(val: string, update: Function) { color="blue" icon="mdi-download" @click=" - downloadRenameFileByLink(data.pathName, data.fileName) + downloadRenameFileByLink( + data.pathName, + data.fileName + ) " >ดาวน์โหลดไฟล์ diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 1690dd99b..efc6b9941 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -49,7 +49,7 @@ const { success, messageError, dialogRemove, - downloadRenameFileByLink + downloadRenameFileByLink, } = mixin; const investigateDis = useInvestigateDisStore(); const countNum = ref(1); @@ -465,7 +465,7 @@ async function getActive() { async function getOc(activeId: string) { showLoader(); await http - .get(config.API.orgByid(activeId)) + .get(config.API.orgByIdSystem(activeId, route.meta.Key as string)) .then(async (res) => { const data = await res.data.result.map((item: any) => ({ organizationId: item.orgTreeId, @@ -1554,7 +1554,12 @@ onMounted(async () => { round color="blue" icon="mdi-download-outline" - @click="downloadRenameFileByLink(file.pathName, file.fileName)" + @click=" + downloadRenameFileByLink( + file.pathName, + file.fileName + ) + " > ดาวน์โหลดไฟล์ @@ -1658,7 +1663,12 @@ onMounted(async () => { round color="blue" icon="mdi-download" - @click="downloadRenameFileByLink(file.pathName, file.fileName)" + @click=" + downloadRenameFileByLink( + file.pathName, + file.fileName + ) + " > ดาวน์โหลดไฟล์ diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue index 0b1893226..45cb0004d 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue @@ -440,7 +440,7 @@ async function getActive() { async function getOc(activeId: string) { showLoader(); await http - .get(config.API.orgByid(activeId)) + .get(config.API.orgByIdSystem(activeId, route.meta.Key as string)) .then(async (res) => { organizationOption.value = await res.data.result.map((item: any) => ({ id: item.orgTreeId, @@ -901,7 +901,6 @@ onMounted(async () => { col.label }} -