From cfdb0c0dfbad69ebfcee620f2ddad68e74b51352 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 15 Feb 2024 15:47:51 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=20fetxhStructure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/StructureMain.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/02_organizationalNew/components/StructureMain.vue b/src/modules/02_organizationalNew/components/StructureMain.vue index 21ce5e931..2d4dd7abc 100644 --- a/src/modules/02_organizationalNew/components/StructureMain.vue +++ b/src/modules/02_organizationalNew/components/StructureMain.vue @@ -42,7 +42,13 @@ onMounted(async () => { id && (await fetchStructChart(id, "0")); }); -async function fetchStructChart(id: string, type: string) { +async function fetchStructChart( + id: string, + type: string, + status: boolean = false +) { + console.log(status); + showLoader(); await http .get(config.API.orgStructChart(id, type)) @@ -52,7 +58,7 @@ async function fetchStructChart(id: string, type: string) { const struct = []; struct.push({ ...data, officer: [], heads: [] }); dataSource.value = struct[0]; - if (dataSourceLock.value === undefined) + if (dataSourceLock.value === undefined || status) dataSourceLock.value = dataSource.value; breadcrumbsGen(); } @@ -181,7 +187,6 @@ const findPath = (id: any) => { id: dataSourceLock.value.deptID, type: dataSourceLock.value.type, }); - console.log(_path); if (dataSourceLock.value.deptID === id) return _path; if (dataSourceLock.value.children.length > 0) { @@ -213,14 +218,14 @@ watch( ? store.draftId : ""; - id && (await fetchStructChart(id, "0")); + id && (await fetchStructChart(id, "0", true)); } ); watch( () => store.historyId, async () => { - store.historyId && (await fetchStructChart(store.historyId, "0")); + store.historyId && (await fetchStructChart(store.historyId, "0", true)); } );