pdf kehadiran

This commit is contained in:
nurafrinaalimi16
2024-04-30 10:59:58 +08:00
parent b278c5ef4f
commit 11df759ffc
3 changed files with 222 additions and 11 deletions
@@ -13,6 +13,8 @@
Maya
</router-link>
<!-- <a class="btn btn-warning" :href="getPDFKehadiranurl()">Muat Turun PDF</a> -->
<!-- <button class="btn btn-primary" @click="downloadPDF()">
<i class="fa fa-download"></i> Muat Turun PDF
</button> -->
@@ -108,17 +110,7 @@ export default {
}
},
// downloadPDF() {
// const table = document.getElementById('voterTable');
// html2canvas(table).then(canvas => {
// const imgData = canvas.toDataURL('image/png');
// const pdf = new jsPDF();
// pdf.addImage(imgData, 'PNG', 0, 0);
// pdf.save('kehadiran-pengundi.pdf');
// });
// },
},
watch: {
@@ -160,6 +152,11 @@ export default {
const totalAttendance = fizikalCount + mayaCount;
const totalMembers = this.data.voters.data.length;
return totalMembers === 0 ? 0 : ((totalAttendance / totalMembers) * 100).toFixed(2);
},
getPDFKehadiranurl() {
// Construct and return the URL based on the item ID
return `/kehadiranpdf/1`;
}
}