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

@ -118,40 +118,40 @@ let dataForm = reactive({
positionTypeId: "",
});
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();
});
};
// 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 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();
});
};
// 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();
// });
// };
function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) {
@ -234,8 +234,8 @@ const saveAppoint = async () => {
})
.finally(async () => {
await closeAndClear();
await fetchPublishFile();
await loadTreeData();
// await fetchPublishFile();
// await loadTreeData();
// await fetchplacementPosition();
hideLoader();
});
@ -634,8 +634,8 @@ watch(
);
onMounted(async () => {
await fetchPublishFile();
await loadTreeData();
// await fetchPublishFile();
// await loadTreeData();
// await fetchplacementPosition();
});
</script>