โครงสร้างอัตรากำลัง => structure org

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-05 17:04:44 +07:00
parent 9c5e024965
commit 89efce2830
4 changed files with 162 additions and 52 deletions

View file

@ -46,8 +46,6 @@ async function fetchStructChart(
type: string,
status: boolean = false
) {
console.log(status);
showLoader();
await http
.get(config.API.orgStructChart(id, type))
@ -70,58 +68,11 @@ async function fetchStructChart(
});
}
/**
* าน Root ของขอมลทงหมดจาก API องทำเปนอนดบแรก เพอจะไดรากของขอม
*/
// const fetchTreeRoot = async () => {
// showLoader();
// let urlRequest = config.API.chartGetTreeRoot;
// await http
// .get(urlRequest)
// .then((response) => {
// if (response.data.result.length > 0) {
// rootOrgID.value = response.data.result[0].organizationId;
// }
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// };
/**
* านขอม organization id จจนจาก API อมลทไดเอามาสราง Structure Chart
*/
// const fetchStructChart = async () => {
// showLoader();
// let urlRequest = config.API.chartGetStructure(rootOrgID.value);
// await http
// .get(urlRequest)
// .then((response) => {
// if (response.data.result.length > 0) {
// dataSource.value = response.data.result[0];
// if (dataSourceLock.value === undefined)
// dataSourceLock.value = dataSource.value;
// breadcrumbsGen();
// }
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// };
/**
* เมอมการคลกท Chart ใหาน ID ของหนวยงานทกคล แลวดงขอม Chart ของหนวยงานน จาก API
* @param data
*/
const refreshChart = async (data: any, type: number) => {
console.log(data, type);
if (data.value === undefined) {
fetchStructChart(data, type.toString());
rootOrgID.value = data;