fixing bug placement, registry remove employee temp & remove api get tree form json file

This commit is contained in:
Warunee Tamkoo 2024-06-05 11:21:58 +07:00
parent 955c2d402f
commit fde7bd6f11
7 changed files with 186 additions and 191 deletions

View file

@ -61,41 +61,41 @@ let dataForm = reactive({
});
/** ฟังชั่น get file*/
async function fetchPublishFile() {
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();
});
}
// async function fetchPublishFile() {
// 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 loadTreeData = async () => {
expanded.value = [];
await http
.get(`${config.s3ClusterUrl}${selectedFile.value}`)
.then((res: any) => {
treeData.value = res.data;
dataRespone.value = res.data;
// const loadTreeData = async () => {
// expanded.value = [];
// await http
// .get(`${config.s3ClusterUrl}${selectedFile.value}`)
// .then((res: any) => {
// treeData.value = res.data;
// dataRespone.value = res.data;
// Filter objects with "name" null
const filteredData = res.data.filter(filterByPersonIdNull);
treeData.value = filteredData;
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
// // Filter objects with "name" null
// const filteredData = res.data.filter(filterByPersonIdNull);
// treeData.value = filteredData;
// })
// .catch((e: any) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// };
/**
* งกนกรองขอมลท personId เป null
@ -202,8 +202,8 @@ async function saveAppoint() {
})
.finally(async () => {
await closeAndClear();
await fetchPublishFile();
await loadTreeData();
// await fetchPublishFile();
// await loadTreeData();
await fetchplacementPosition();
hideLoader();
});
@ -419,8 +419,8 @@ watch(props, () => {
});
onMounted(async () => {
await fetchPublishFile();
await loadTreeData();
// await fetchPublishFile();
// await loadTreeData();
await fetchplacementPosition();
});
</script>