diff --git a/src/api/index.ts b/src/api/index.ts index bf56f79fb..292285657 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -40,6 +40,7 @@ const config = ref({ API_URI_PROFILE_SERVICE: `${window.location.protocol}//${window.location.host}/api/v1`, API_CANDIDATE_URI: `${window.location.protocol}//${window.location.host}/api/v1`, API_REPORT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, + API_PLACEMENT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, API_URI_ORG_TREE: "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json", MEET_URI: "meet.frappet.com", diff --git a/src/modules/05_placement/components/PersonalList/OrgTree.vue b/src/modules/05_placement/components/PersonalList/OrgTree.vue index 994f207f7..62a7439cb 100644 --- a/src/modules/05_placement/components/PersonalList/OrgTree.vue +++ b/src/modules/05_placement/components/PersonalList/OrgTree.vue @@ -17,6 +17,7 @@ const noData = ref("ไม่พบข้อมูลผังโคร const checkValidate = ref(false); const myFormPosition = ref(); const selected = ref(""); +const selectedFile = ref(""); // Set form field let dataForm = reactive({ @@ -33,18 +34,37 @@ let dataForm = reactive({ positionSalaryAmount: null, }); -onMounted(() => { - loadTreeData(); - fetchplacementPosition(); +onMounted(async () => { + await fetchPublishFile(); + await loadTreeData(); + await fetchplacementPosition(); }); +const fetchPublishFile = async () => { + await http + .get(config.API.getPublishFileHistory) + .then((res) => { + let data = res.data.result; + selectedFile.value = data[0].fileName; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + }); +}; // โหลดข้อมูลโครงสร้างจาก json const treeData = ref>([]); const loadTreeData = async () => { await http - .get(config.API.orgTree) + .get(`${config.s3ClusterUrl}${selectedFile.value}`) .then((res: any) => { treeData.value = res.data; + + // Filter objects with "name" null + const filteredData = res.data.filter(filterByPersonIdNull); + treeData.value = filteredData; }) .catch((e: any) => { messageError($q, e); @@ -53,6 +73,18 @@ const loadTreeData = async () => { hideLoader(); }); }; + +function filterByPersonIdNull(obj: any) { + if (obj.name === null) { + return true; + } + if (obj.children && obj.children.length > 0) { + obj.children = obj.children.filter(filterByPersonIdNull); + return obj.children.length > 0; + } + return false; +} + // โหลด position const placementPosition = ref([]); const fetchplacementPosition = async () => { diff --git a/src/modules/06_retirement/views/Main.vue b/src/modules/06_retirement/views/Main.vue index 7ae53f4ff..5b6cd79c2 100644 --- a/src/modules/06_retirement/views/Main.vue +++ b/src/modules/06_retirement/views/Main.vue @@ -1,10 +1,419 @@ - - - + + + diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 270be3495..76c07c0ea 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -727,7 +727,7 @@ if (keycloak.tokenParsed != null) { font-size="20px" /> - {{ menuItem.label }} + {{ menuItem.label }} @@ -751,7 +751,7 @@ if (keycloak.tokenParsed != null) { :to="{ name: `${subMenu2.path}` }" > - {{ subMenu2.label }} + {{ subMenu2.label }} @@ -781,7 +781,7 @@ if (keycloak.tokenParsed != null) { :to="{ name: `${subMenu.path}` }" > - {{ subMenu.label }} + {{ subMenu.label }} @@ -930,6 +930,7 @@ if (keycloak.tokenParsed != null) { .menuSub .q-item { border-radius: 0 100px 100px 0; margin-right: 2%; + font-weight: 500 ; } .expan2 .q-item { padding-left: 10%; @@ -937,6 +938,9 @@ if (keycloak.tokenParsed != null) { /* .menuSubAct { background: #1e2529d9; } */ +.font-400{ + font-weight: 400 !important; +} .expan2 .menuSubHover { padding-left: 30%; border-radius: 20px;