ปรับโหลด

This commit is contained in:
setthawutttty 2025-01-14 09:33:58 +07:00
parent 86c6cc5236
commit 9d72c1b5dc
2 changed files with 45 additions and 8 deletions

View file

@ -196,7 +196,19 @@ async function fetchData() {
* @param id รอบสอบเเขงข
*/
function clickPassExam(id: string) {
window.open(config.API.exportPassExamList(id));
showLoader();
http
.get(config.API.exportPassExamList(id))
.then((res) => {
const data = res.data.result;
data.reportName = `CandidateList`;
genReport(data, data.reportName, "pdf");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
}
/**
@ -204,19 +216,19 @@ function clickPassExam(id: string) {
* @param id รอบสอบเเขงข
*/
function clickCandidateList(id: string) {
showLoader();
http
.get(config.API.exportCandidateList(id))
.then((res) => {
const data = res.data.result;
data.reportName = `CandidateList`
genReport(data, data.reportName,'pdf');
data.reportName = `CandidateList`;
genReport(data, data.reportName, "pdf");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
});
})
.finally(() => {});
}
/**