Merge branch 'dev-bagus' of https://github.com/defuj/eis into dev-defuj

This commit is contained in:
Dede Fuji Abdul
2024-03-29 11:05:02 +07:00
5 changed files with 364 additions and 28 deletions

View File

@ -1084,7 +1084,7 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
import InputText from '@/components/InputText.vue'
import { apolloClient } from '@/utils/api/api.graphql'
import { provideApolloClient } from '@vue/apollo-composable'
import { exportToPDF } from '@/report/Gangguan/Rekap/RGangguan_ALL'
import { exportToPDF, exportToXLSX } from '@/report/Gangguan/Rekap/RGangguan_ALL'
const client = apolloClient()
provideApolloClient(client)
@ -1322,21 +1322,9 @@ const showDetail = () => {
const onExporting = (e: any) => {
if (e.format === 'pdf') {
exportToPDF(reportMeta.value, data.value)
} else if (e.format === 'xlsx') {
exportToXLSX(reportMeta.value, e)
} else {
const workbook = new Workbook()
const worksheet = workbook.addWorksheet('Employees')
exportToExcel({
component: e.component,
worksheet,
autoFilterEnabled: true
}).then(() => {
workbook.xlsx.writeBuffer().then((buffer: any) => {
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), 'DataGrid.xlsx')
})
})
e.cancel = true
}
}