วินัยรองรับลูกจ้างประจำ กทม.
This commit is contained in:
parent
77a3e7b57f
commit
9bb81be90d
20 changed files with 370 additions and 106 deletions
|
|
@ -82,8 +82,9 @@ function fetchOptionGroup() {
|
|||
/**
|
||||
* function fetch รายชื่อข้อมูลทะเบียนประวัติ
|
||||
*/
|
||||
function fetchDataPerson() {
|
||||
async function fetchDataPerson() {
|
||||
showLoader();
|
||||
dataPersonMain.value = [];
|
||||
let queryParams: QueryParams = {
|
||||
page: store.formFilter.page,
|
||||
pageSize: store.formFilter.pageSize,
|
||||
|
|
@ -129,58 +130,67 @@ function fetchDataPerson() {
|
|||
queryParams.isAll = store.formFilter.isAll;
|
||||
}
|
||||
|
||||
http
|
||||
await http
|
||||
.get(
|
||||
config.API.registryNew(empType.value !== "officer" ? "-employee" : ""),
|
||||
{ params: queryParams }
|
||||
)
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const dataList = await res.data.result.data;
|
||||
maxPage.value = Math.ceil(
|
||||
res.data.result.total / store.formFilter.pageSize
|
||||
);
|
||||
dataPersonMain.value = res.data.result.data;
|
||||
dataPersonMain.value = dataList;
|
||||
total.value = res.data.result.total;
|
||||
isShowBtnFilter.value = true;
|
||||
insertAvatar(res.data.result.data);
|
||||
if (dataList) {
|
||||
insertAvatar(dataList).then(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch รูปโปรไฟล์
|
||||
* @param items ข้อมูลคน
|
||||
*/
|
||||
function insertAvatar(items: DataPerson[]) {
|
||||
items.map((x: DataPerson, index: number) => {
|
||||
if (x.avatarName != null) {
|
||||
http
|
||||
.get(
|
||||
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", x.id, x.avatarName)
|
||||
)
|
||||
.then((img) => {
|
||||
async function insertAvatar(items: DataPerson[]) {
|
||||
await Promise.all(
|
||||
items.map(async (x: DataPerson, index: number) => {
|
||||
try {
|
||||
if (x.avatarName != null) {
|
||||
const img = await http.get(
|
||||
config.API.fileByFile(
|
||||
"ทะเบียนประวัติ",
|
||||
"โปรไฟล์",
|
||||
x.id,
|
||||
x.avatarName
|
||||
)
|
||||
);
|
||||
dataPersonMain.value[index] = {
|
||||
...x,
|
||||
avatar: img.data.downloadUrl,
|
||||
};
|
||||
})
|
||||
.catch(() => {
|
||||
} else {
|
||||
dataPersonMain.value[index] = {
|
||||
...x,
|
||||
avatar: avatar,
|
||||
};
|
||||
});
|
||||
} else {
|
||||
dataPersonMain.value[index] = {
|
||||
...x,
|
||||
avatar: avatar,
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
dataPersonMain.value[index] = {
|
||||
...x,
|
||||
avatar: avatar,
|
||||
};
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue