fix: export in rekapitulasi gangguan per jenis gangguan and title in all detail export

This commit is contained in:
kur0nek-o
2024-03-30 14:08:50 +07:00
parent 863a7a1b1d
commit f98ed9f261
7 changed files with 15 additions and 8 deletions

View File

@ -59,7 +59,7 @@ const formatData = (rawData: any) => {
total_recovery_time_kurang_sla: 0
}
for (const sub_kelompok in data) {
for (const sub_kelompok of data) {
const total: any = {
total_laporan: 0,
total_laporan_sudah_selesai: 0,
@ -78,7 +78,13 @@ const formatData = (rawData: any) => {
total_recovery_time_kurang_sla: 0
}
formattedData.push([{ content: sub_kelompok, colSpan: 20, styles: { fontStyle: 'bold' } }])
formattedData.push([
{
content: `${sub_kelompok} (${data[sub_kelompok][0].nama_sub_kelompok})`,
colSpan: 20,
styles: { fontStyle: 'bold' }
}
])
for (let i = 0; i < data[sub_kelompok].length; i++) {
formattedData.push([
@ -266,6 +272,7 @@ const formatMetaData = (reportMeta: any) => {
const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) => {
const data = formatData(rawData)
console.log(data)
const meta = formatMetaData(reportMeta)
const doc = new jsPDF({
orientation: 'landscape'