โครงสร้างอัตรากำลัง => structure org
This commit is contained in:
parent
9c5e024965
commit
89efce2830
4 changed files with 162 additions and 52 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue