From 89efce283003cd848ea127a7d9ba08ebf79ccf0a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 5 Aug 2024 17:04:44 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA?= =?UTF-8?q?=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=AD=E0=B8=B1=E0=B8=95?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=81=E0=B8=B3=E0=B8=A5=E0=B8=B1=E0=B8=87?= =?UTF-8?q?=20=3D>=20structure=20org?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/StructureMain.vue | 49 ------ .../components/StructureOrgMain.vue | 148 ++++++++++++++++++ src/modules/02_organization/views/main.vue | 13 ++ .../08_registryEmployee/views/Main.vue | 4 +- 4 files changed, 162 insertions(+), 52 deletions(-) create mode 100644 src/modules/02_organization/components/StructureOrgMain.vue diff --git a/src/modules/02_organization/components/StructureMain.vue b/src/modules/02_organization/components/StructureMain.vue index d221ef2d5..375cc20ac 100644 --- a/src/modules/02_organization/components/StructureMain.vue +++ b/src/modules/02_organization/components/StructureMain.vue @@ -46,8 +46,6 @@ async function fetchStructChart( type: string, status: boolean = false ) { - console.log(status); - showLoader(); await http .get(config.API.orgStructChart(id, type)) @@ -70,58 +68,11 @@ async function fetchStructChart( }); } -/** - * อ่าน Root ของข้อมูลทั้งหมดจาก ​​API ต้องทำเป็นอันดับแรก เพื่อจะได้รู้รากของข้อมูล - */ -// const fetchTreeRoot = async () => { -// showLoader(); -// let urlRequest = config.API.chartGetTreeRoot; -// await http -// .get(urlRequest) -// .then((response) => { -// if (response.data.result.length > 0) { -// rootOrgID.value = response.data.result[0].organizationId; -// } -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// hideLoader(); -// }); -// }; - -/** - * อ่านข้อมูล organization id ปัจจุบันจาก API ข้อมูลที่ได้เอามาสร้าง Structure Chart - */ -// const fetchStructChart = async () => { -// showLoader(); -// let urlRequest = config.API.chartGetStructure(rootOrgID.value); -// await http -// .get(urlRequest) -// .then((response) => { -// if (response.data.result.length > 0) { -// dataSource.value = response.data.result[0]; -// if (dataSourceLock.value === undefined) -// dataSourceLock.value = dataSource.value; -// breadcrumbsGen(); -// } -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// hideLoader(); -// }); -// }; - /** * เมื่อมีการคลิกที่ Chart ให้อ่าน ID ของหน่วยงานที่ถูกคลิก แล้วดึงข้อมูล Chart ของหน่วยงานนั้น ๆ จาก API * @param data */ const refreshChart = async (data: any, type: number) => { - console.log(data, type); - if (data.value === undefined) { fetchStructChart(data, type.toString()); rootOrgID.value = data; diff --git a/src/modules/02_organization/components/StructureOrgMain.vue b/src/modules/02_organization/components/StructureOrgMain.vue new file mode 100644 index 000000000..9b6a7245f --- /dev/null +++ b/src/modules/02_organization/components/StructureOrgMain.vue @@ -0,0 +1,148 @@ + + + + + diff --git a/src/modules/02_organization/views/main.vue b/src/modules/02_organization/views/main.vue index 1824a137d..40056bae8 100644 --- a/src/modules/02_organization/views/main.vue +++ b/src/modules/02_organization/views/main.vue @@ -16,6 +16,7 @@ import type { OrgRevision } from "@/modules/02_organization/interface/response/o */ import TreeView from "@/modules/02_organization/components/TreeView.vue"; import StructureView from "@/modules/02_organization/components/StructureMain.vue"; +import StructureOrgMain from "@/modules/02_organization/components/StructureOrgMain.vue"; import DialogFormNewStructure from "@/modules/02_organization/components/DialogNewStructure.vue"; import DialogDateTime from "@/modules/02_organization/components/DialogFormDateTime.vue"; @@ -323,6 +324,14 @@ onMounted(async () => { :color="store.statusView === 'tree' ? 'grey-7' : 'grey-4'" @click="store.statusView = 'tree'" /> + + @@ -339,6 +348,10 @@ onMounted(async () => { + + + + diff --git a/src/modules/08_registryEmployee/views/Main.vue b/src/modules/08_registryEmployee/views/Main.vue index 8bc6d2d2c..88e09e9d1 100644 --- a/src/modules/08_registryEmployee/views/Main.vue +++ b/src/modules/08_registryEmployee/views/Main.vue @@ -1,7 +1,7 @@