ปรับโหลด
This commit is contained in:
parent
86c6cc5236
commit
9d72c1b5dc
2 changed files with 45 additions and 8 deletions
|
|
@ -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(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue