diff --git a/src/modules/02_users/views/01_user.vue b/src/modules/02_users/views/01_user.vue index 80c6c9e5..d5727f4a 100644 --- a/src/modules/02_users/views/01_user.vue +++ b/src/modules/02_users/views/01_user.vue @@ -464,9 +464,9 @@ function checkhideBtnAction(keycloakID: string) { * ดึงข้อมูลรายชื่อผู้ใช้งาน */ onMounted(async () => { - await fetchOrganizationActive(); const token = await tokenParsed(); tokenParsedData.value = token.role || []; + await fetchOrganizationActive(); }); diff --git a/src/modules/02_users/views/03_permissionsView.vue b/src/modules/02_users/views/03_permissionsView.vue index 4d05e2ff..ca1b5412 100644 --- a/src/modules/02_users/views/03_permissionsView.vue +++ b/src/modules/02_users/views/03_permissionsView.vue @@ -295,45 +295,6 @@ async function fetchDataTree(id: string) { const isSuperAdmin = tokenParsedData.value.includes("SUPER_ADMIN"); if (!isSuperAdmin) { nodes.value = []; - } else { - nodes.value = [ - { - labelName: "หน่วยงานทั้งหมด", - orgCode: "", - orgLevel: 0, - orgName: "", - orgRevisionId: "", - orgRootName: "", - orgTreeCode: "", - orgTreeFax: "", - orgTreeId: "", - orgTreeName: "หน่วยงานทั้งหมด", - orgTreeOrder: 0, - orgTreePhoneEx: "", - orgTreePhoneIn: "", - orgTreeRank: "", - orgTreeRankSub: "", - orgTreeShortName: "", - responsibility: "", - totalPosition: 0, - totalPositionCurrentUse: 0, - totalPositionCurrentVacant: 0, - totalPositionNextUse: 0, - totalPositionNextVacant: 0, - totalRootPosition: 0, - totalRootPositionCurrentUse: 0, - totalRootPositionCurrentVacant: 0, - totalRootPositionNextUse: 0, - totalRootPositionNextVacant: 0, - children: [] as NodeTree[], - isOfficer: false, - orgRootDnaId: "", - orgChild1DnaId: "", - orgChild2DnaId: "", - orgChild3DnaId: "", - orgChild4DnaId: "", - }, - ]; } showLoader(); await http @@ -361,7 +322,7 @@ async function fetchDataTree(id: string) { async function fetchDataTable( id: string | null, revisionId: string, - level: number + level: number, ) { showLoader(); reqMaster.id = id === "" ? null : id; @@ -437,7 +398,7 @@ function onDeleteRole(id: string) { await fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type + reqMaster.type, ); success($q, "ลบข้อมูลสำเร็จ"); }) @@ -449,7 +410,7 @@ function onDeleteRole(id: string) { }); }, "ยืนยันการลบสิทธิ์", - "ต้องการยืนยันการลบสิทธิ์นี้หรือไม่ ?" + "ต้องการยืนยันการลบสิทธิ์นี้หรือไม่ ?", ); } @@ -482,7 +443,7 @@ watch( reqMaster.revisionId = ""; filter.value = ""; await fetchDataTree(id); - } + }, ); /** callblck function ทำการ fetch ข้อมูล Table เมื่อมีการเปลี่ยนหน้า*/ @@ -513,9 +474,9 @@ function checkhideBtnAction(current_holderId: string) { } onMounted(async () => { - fetchOrganizationActive(); const token = await tokenParsed(); tokenParsedData.value = token.role || []; + await fetchOrganizationActive(); }); @@ -688,7 +649,7 @@ onMounted(async () => { fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type + reqMaster.type, ) " > @@ -775,7 +736,7 @@ onMounted(async () => { onOpenModalPersonal( store.typeOrganizational === 'draft' ? props.row.profileIdNextHolder - : props.row.profileIdCurrentHolder + : props.row.profileIdCurrentHolder, ) " > @@ -935,7 +896,7 @@ onMounted(async () => { fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type + reqMaster.type, ) " > diff --git a/src/modules/02_users/views/04_roleOrganization.vue b/src/modules/02_users/views/04_roleOrganization.vue index cdc5c406..5c3cbba1 100644 --- a/src/modules/02_users/views/04_roleOrganization.vue +++ b/src/modules/02_users/views/04_roleOrganization.vue @@ -235,14 +235,14 @@ watch( () => qureyBody.pageSize, () => { fetchListPerson(true); - } + }, ); /** hook ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(async () => { - await fetchOrg(); // ดึงข้อมูลโครงสร้าง const token = await tokenParsed(); tokenParsedData.value = token?.role || []; + await fetchOrg(); // ดึงข้อมูลโครงสร้าง }); diff --git a/src/modules/02_users/views/05_responsIbilities.vue b/src/modules/02_users/views/05_responsIbilities.vue index 70e0bd21..a8ba096b 100644 --- a/src/modules/02_users/views/05_responsIbilities.vue +++ b/src/modules/02_users/views/05_responsIbilities.vue @@ -437,9 +437,9 @@ watch( ); onMounted(async () => { - fetchOrganizationActive(); const token = await tokenParsed(); tokenParsedData.value = token?.role || []; + await fetchOrganizationActive(); }); diff --git a/src/modules/02_users/views/06_rolePositionSalary.vue b/src/modules/02_users/views/06_rolePositionSalary.vue index ee0d4346..2bf4dc93 100644 --- a/src/modules/02_users/views/06_rolePositionSalary.vue +++ b/src/modules/02_users/views/06_rolePositionSalary.vue @@ -288,9 +288,9 @@ watch( /** hook ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(async () => { - await fatchOrg(); // ดึงข้อมูลโครงสร้าง const token = await tokenParsed(); tokenParsedData.value = token?.role || []; + await fatchOrg(); // ดึงข้อมูลโครงสร้าง });