Merge branch 'dev-defuj' of https://github.com/defuj/eis into dev-eko
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
<template>
|
||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" :report-button="true" class="mb-4">
|
||||
<Filters @run-report="() => exportToPDF(reportMeta, data, true)" @reset-form="data = []"
|
||||
@run-search="() => filterData(filters)" :report-button="true" class="mb-4">
|
||||
<Type3 @update:filters="(value) => (filters = value)" />
|
||||
</Filters>
|
||||
<div>
|
||||
<DxDataGrid ref="dataGridRef" :allow-column-reordering="true" class="max-h-[calc(100vh-140px)] mb-10"
|
||||
:data-source="data" :show-column-lines="true" :show-row-lines="false" :show-borders="true"
|
||||
:row-alternation-enabled="true" :hover-state-enabled="true" @selection-changed="onDataSelectionChanged"
|
||||
@exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget">
|
||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" expand-mode="rowClick" />
|
||||
<DxDataGrid @cell-click="onCellClicked" ref="dataGridRef" :allow-column-reordering="true"
|
||||
class="max-h-[calc(100vh-140px)] mb-10" :data-source="data" :show-column-lines="true" :show-row-lines="false"
|
||||
:show-borders="true" :row-alternation-enabled="true" :hover-state-enabled="true"
|
||||
@selection-changed="onDataSelectionChanged" @exporting="onExporting" :allow-column-resizing="true"
|
||||
column-resizing-mode="widget">
|
||||
<DxPaging :enabled="false" />
|
||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" />
|
||||
<DxSelection mode="single" />
|
||||
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
||||
<DxLoadPanel shading-color="rgba(0,0,0,0.4)" :position="position" :show-indicator="showIndicator"
|
||||
:show-pane="showPane" :shading="shading" v-model:visible="loadingData" :enabled="true" />
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
|
||||
<!-- <DxColumnFixing :enabled="true" /> -->
|
||||
|
||||
<DxColumn alignment="center" :width="200" data-field="nama_ulp" caption="Nama Unit"
|
||||
css-class="custom-table-column" />
|
||||
@@ -83,10 +84,6 @@
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" column="min_durasi_dispatch"
|
||||
summary-type="min" css-class="!text-right"
|
||||
:customize-text="(e: any) => (parseInt(e.value) ? formatWaktu(e.value) : '-')" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" column="total_diatas_sla_dispatch"
|
||||
summary-type="sum" css-class="!text-right" :customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" column="total_dibawah_sla_dispatch"
|
||||
summary-type="sum" css-class="!text-right" :customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" column="avg_durasi_response"
|
||||
summary-type="avg" css-class="!text-right" :customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" column="max_durasi_response"
|
||||
@@ -122,12 +119,12 @@
|
||||
<template #formatNumber="{ data }">
|
||||
<p class="text-right cursor-pointer">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
@@ -146,7 +143,7 @@
|
||||
<DxDataGrid :allow-column-reordering="true" class="max-h-[calc(100vh-140px)]" :data-source="dataSub"
|
||||
:show-column-lines="true" :show-row-lines="false" :show-borders="true" :row-alternation-enabled="true"
|
||||
:hover-state-enabled="true" @selection-changed="onDataSubSelectionChanged" :column-width="100"
|
||||
@exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget">
|
||||
@exporting="onExportingDetail" :allow-column-resizing="true" column-resizing-mode="widget">
|
||||
<DxSelection mode="single" />
|
||||
<DxPaging :page-size="20" :enabled="true" />
|
||||
<DxPager :visible="true" :allowed-page-sizes="[20, 50, 100]" display-mode="full"
|
||||
@@ -157,21 +154,21 @@
|
||||
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
|
||||
|
||||
<DxColumn css-class="custom-table-column" :width="50" alignment="center"
|
||||
:calculateCellValue="(item: any) => dataSub.findIndex((i) => i == item) + 1" data-type="number" caption="No"
|
||||
cell-template="formatNumber" />
|
||||
:calculate-display-value="(item: any) => dataSub.findIndex((i) => i == item) + 1" data-type="number"
|
||||
caption="No" cell-template="formatNumber" />
|
||||
<DxColumn :width="150" alignment="center" data-field="no_laporan" caption="No Laporan"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="waktu_lapor" caption="Tgl Lapor"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Dalam Proses Bidang" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Selesai Bidang Unit" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="waktu_response" caption="Dalam Proses Bidang"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="waktu_recovery" caption="Selesai Bidang Unit"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="durasi_response_time" caption="Durasi Response Time"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatTime" />
|
||||
<DxColumn :width="150" alignment="center" data-field="durasi_recovery_time" caption="Durasi Recovery Time"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatTime" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Status" :allow-resizing="false"
|
||||
<DxColumn :width="150" alignment="center" data-field="status_akhir" caption="Status" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatTime" />
|
||||
<DxColumn :width="150" alignment="center" data-field="idpel_nometer" caption="IDPEL/NO METER"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatTime" />
|
||||
@@ -183,12 +180,12 @@
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="200" alignment="center" data-field="keterangan_pelapor" caption="Keterangan Pelapor"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Rayon" :allow-resizing="false"
|
||||
<DxColumn :width="150" alignment="center" data-field="nama_ulp" caption="Rayon" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Uraian" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Respon Pelanggan" :allow-resizing="false"
|
||||
<DxColumn :width="150" alignment="center" data-field="uraian" caption="Uraian" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="respon_pelanggan" caption="Respon Pelanggan"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
|
||||
<template #formatText="{ data }">
|
||||
<p class="text-left cursor-pointer">
|
||||
@@ -203,7 +200,7 @@
|
||||
</template>
|
||||
|
||||
<template #formatTime="{ data }">
|
||||
<p>
|
||||
<p class="text-right cursor-pointer">
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
@@ -225,28 +222,28 @@
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Dalam Proses Bidang:</h3>
|
||||
<InputText :readonly="true" :value="dataSubSelected?.dalam_proses_bidang" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.waktu_response" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Selesai Bidang Unit:</h3>
|
||||
<InputText :readonly="true" :value="dataSubSelected?.selesai_bidang_unit" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.waktu_recovery" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Durasi Response Time:</h3>
|
||||
<InputText :readonly="true" :value="parseInt(dataSubSelected?.durasi_response_time)
|
||||
? formatWaktu(dataSubSelected?.durasi_response_time)
|
||||
: '-'
|
||||
" class-name="flex-1" />
|
||||
? formatWaktu(dataSubSelected?.durasi_response_time)
|
||||
: '-'
|
||||
" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Durasi Recovery Time:</h3>
|
||||
<InputText :readonly="true" :value="parseInt(dataSubSelected?.durasi_recovery_time)
|
||||
? formatWaktu(dataSubSelected?.durasi_recovery_time)
|
||||
: '-'
|
||||
" class-name="flex-1" />
|
||||
? formatWaktu(dataSubSelected?.durasi_recovery_time)
|
||||
: '-'
|
||||
" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
@@ -281,7 +278,7 @@
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Rayon:</h3>
|
||||
<InputText :readonly="true" :value="dataSubSelected?.rayon" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.nama_ulp" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
@@ -291,8 +288,7 @@
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Response Pelanggan:</h3>
|
||||
<InputText :readonly="true" type="textarea" :value="dataSubSelected?.response_pelanggan"
|
||||
class-name="flex-1" />
|
||||
<InputText :readonly="true" type="textarea" :value="dataSubSelected?.respon_pelanggan" class-name="flex-1" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -320,17 +316,12 @@ import {
|
||||
DxGroupItem,
|
||||
DxGrouping
|
||||
} from 'devextreme-vue/data-grid'
|
||||
import { jsPDF } from 'jspdf'
|
||||
import { exportDataGrid as exportToPdf } from 'devextreme/pdf_exporter'
|
||||
import { exportDataGrid as exportToExcel } from 'devextreme/excel_exporter'
|
||||
import { saveAs } from 'file-saver'
|
||||
import { Workbook } from 'exceljs'
|
||||
import { useQuery } from '@vue/apollo-composable'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { queries } from '@/utils/api/api.graphql'
|
||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
import { exportToPDF, exportDetailToPDF } from '@/report/Keluhan/Rekap/RKeluhan_ALL'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@@ -346,12 +337,87 @@ const dialogDetail = ref(false)
|
||||
const closedialogDetail = () => (dialogDetail.value = false)
|
||||
const loadingData = ref(false)
|
||||
const loadingSubData = ref(false)
|
||||
const agreeToShowDialog = ref(false)
|
||||
const progressSelected = ref(0)
|
||||
const groupIndex = ref(0)
|
||||
const groupDialog = ref(false)
|
||||
const groupData = ref<any>(null)
|
||||
const reportMeta = ref({
|
||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const filterData = (params: any) => {
|
||||
const onCellClicked = (e: any) => {
|
||||
console.log('cell clicked', e)
|
||||
// console.log('group cell clicked', e.column.caption)
|
||||
// console.log('value', e.values[e.row.groupIndex])
|
||||
if (e.rowType == 'group') {
|
||||
groupDialog.value = true
|
||||
groupIndex.value = e.row.groupIndex
|
||||
setAgreementDialog(e.column.caption)
|
||||
if (e.row.groupIndex == 0) {
|
||||
//
|
||||
} else if (e.row.groupIndex == 1) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0].collapsedItems[0].items[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0].items[0].items[0]
|
||||
groupData.value = data
|
||||
}
|
||||
} else if (e.row.groupIndex == 2) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0].collapsedItems[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0].items[0]
|
||||
groupData.value = data
|
||||
}
|
||||
} else if (e.row.groupIndex == 3) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0]
|
||||
groupData.value = data
|
||||
}
|
||||
}
|
||||
showDetail()
|
||||
} else {
|
||||
groupDialog.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const setAgreementDialog = (column: string) => {
|
||||
if (column == 'Total' || column == 'Selesai' || column == 'In Progress') {
|
||||
agreeToShowDialog.value = true
|
||||
if (column == 'Total') {
|
||||
progressSelected.value = 0
|
||||
} else if (column == 'Selesai') {
|
||||
progressSelected.value = 1
|
||||
} else {
|
||||
progressSelected.value = 2
|
||||
}
|
||||
} else {
|
||||
agreeToShowDialog.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const resetData = () => {
|
||||
data.value = []
|
||||
dataSub.value = []
|
||||
dataSelected.value = null
|
||||
dataSubSelected.value = null
|
||||
}
|
||||
|
||||
const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { ulp, uid, up3 } = params
|
||||
const dateValue = params.periode.split(' s/d ')
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(queries.keluhan.rekap.rekapKeluhanAll, {
|
||||
const query = {
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
@@ -361,55 +427,109 @@ const filterData = (params: any) => {
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
idUid: uid ? uid.id : 0,
|
||||
idUp3: up3 ? up3.id : 0
|
||||
})
|
||||
}
|
||||
|
||||
onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
data.value = queryResult.data.rekapitulasiKeluhanAll
|
||||
}
|
||||
})
|
||||
loadingData.value = true
|
||||
await requestGraphQl(queries.keluhan.rekap.rekapKeluhanAll, query)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
data.value = result.data.data.rekapitulasiKeluhanAll
|
||||
} else {
|
||||
data.value = []
|
||||
}
|
||||
|
||||
onError((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
watch(loading, (value) => {
|
||||
loadingData.value = value
|
||||
})
|
||||
reportMeta.value = filters.value
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
loadingData.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const getDetail = async () => {
|
||||
loadingSubData.value = true
|
||||
const dateValue = filters.value.periode.split(' s/d ')
|
||||
const selected = dataSelected.value
|
||||
|
||||
const query = {
|
||||
var query = {
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
dateTo: dateValue[1]
|
||||
? dateValue[1].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
idUlp: selected?.id_ulp ? selected?.id_ulp : 0,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: selected?.id_up3 ? selected?.id_up3 : 0
|
||||
idUlp: 0,
|
||||
idUid: 0,
|
||||
idUp3: 0,
|
||||
namaRegional: '',
|
||||
isSelesai: progressSelected.value,
|
||||
media: '',
|
||||
tanggal: '',
|
||||
namaIssuetype: '',
|
||||
namaSubissuetype: ''
|
||||
}
|
||||
|
||||
const result = useQuery(queries.keluhan.rekap.rekapKeluhanAllDetail, query)
|
||||
|
||||
result.onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
dataSub.value = queryResult.data.detailKeluhanAll
|
||||
if (groupDialog.value) {
|
||||
if (groupIndex.value == 0) {
|
||||
query = {
|
||||
...query,
|
||||
isSelesai: progressSelected.value
|
||||
}
|
||||
} else if (groupIndex.value == 1) {
|
||||
query = {
|
||||
...query,
|
||||
namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
}
|
||||
} else if (groupIndex.value == 2) {
|
||||
query = {
|
||||
...query,
|
||||
idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0,
|
||||
namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
}
|
||||
} else if (groupIndex.value == 3) {
|
||||
query = {
|
||||
...query,
|
||||
idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0,
|
||||
idUp3: groupData.value?.id_up3 ? groupData.value?.id_up3 : 0,
|
||||
namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
query = {
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
dateTo: dateValue[1]
|
||||
? dateValue[1].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
idUlp: selected?.id_ulp ? selected?.id_ulp : 0,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: selected?.id_up3 ? selected?.id_up3 : 0,
|
||||
namaRegional: selected?.nama_regional ? selected?.nama_regional : '',
|
||||
media: selected?.media ? selected?.media : '',
|
||||
isSelesai: progressSelected.value,
|
||||
tanggal: '',
|
||||
namaIssuetype: '',
|
||||
namaSubissuetype: ''
|
||||
}
|
||||
}
|
||||
|
||||
result.onError((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
watch(result.loading, (value) => {
|
||||
loadingSubData.value = value
|
||||
})
|
||||
loadingSubData.value = true
|
||||
await requestGraphQl(queries.keluhan.rekap.rekapKeluhanAllDetail, query)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
dataSub.value = result.data.data.detailKeluhanAll
|
||||
} else {
|
||||
dataSub.value = []
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
loadingSubData.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||
@@ -422,38 +542,27 @@ const clearSelection = () => {
|
||||
}
|
||||
const showDetail = () => {
|
||||
clearSelection()
|
||||
dataSub.value = []
|
||||
dataSubSelected.value = null
|
||||
dialogDetail.value = true
|
||||
getDetail()
|
||||
if (agreeToShowDialog.value) {
|
||||
dataSub.value = []
|
||||
dataSubSelected.value = null
|
||||
dialogDetail.value = true
|
||||
getDetail()
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
const doc = new jsPDF()
|
||||
|
||||
exportToPdf({
|
||||
jsPDFDocument: doc,
|
||||
component: e.component,
|
||||
indent: 5
|
||||
}).then(() => {
|
||||
doc.save(`.pdf`)
|
||||
})
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
} else if (e.format === 'xlsx') {
|
||||
} 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
|
||||
const onExportingDetail = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportDetailToPDF(reportMeta.value, dataSub.value)
|
||||
} else if (e.format === 'xlsx') {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user