diff --git a/.env.development b/.env.development
index d701d3e..a0c0f0e 100755
--- a/.env.development
+++ b/.env.development
@@ -1,4 +1,4 @@
-VITE_BASE_URL=http://localhost:5173
+VITE_BASE_URL=http://localhost/:5173
VITE_BASE_DIRECTORY=/
VITE_APP_VERSION=0.0.1
VITE_APP_NAME='Executive Information System'
diff --git a/src/components/Pages/Gangguan/Daftar/DGangguan_DKPL.vue b/src/components/Pages/Gangguan/Daftar/DGangguan_DKPL.vue
index f3ceae3..ee95852 100755
--- a/src/components/Pages/Gangguan/Daftar/DGangguan_DKPL.vue
+++ b/src/components/Pages/Gangguan/Daftar/DGangguan_DKPL.vue
@@ -1,5 +1,5 @@
- filterData(filters)" class="mb-4">
+ filterData()" class="mb-4">
(filters = value)" />
@@ -11,7 +11,6 @@
class="max-h-[calc(100vh-140px)] mb-10"
:data-source="data"
:remote-operations="true"
- v-if="loading == false"
key-expr="no_laporan"
:show-column-lines="true"
:show-row-lines="false"
@@ -24,6 +23,7 @@
:allow-column-resizing="true"
column-resizing-mode="widget"
>
+
-
-
diff --git a/src/report/Gangguan/Daftar/DGangguan_DKPL.ts b/src/report/Gangguan/Daftar/DGangguan_DKPL.ts
index 5437b7e..aafb596 100644
--- a/src/report/Gangguan/Daftar/DGangguan_DKPL.ts
+++ b/src/report/Gangguan/Daftar/DGangguan_DKPL.ts
@@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
return { dateFromFormat, dateToFormat, dayTo }
}
-const exportToPDF = (reportMeta: any, data: any) => {
+const exportToPDF = async (reportMeta: any, data: any) => {
const meta = formatMetaData(reportMeta)
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
const date = new Date().getDate()
const month = new Date().toLocaleString('id-ID', { month: 'long' })
const year = new Date().getFullYear()
+ const resultData = data.value.data
const doc = new jsPDF({
orientation: 'landscape'
})
@@ -133,7 +134,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
'Posko'
]
],
- body: data.value.map((item: any, i: any) => [
+ body: resultData.map((item: any, i: any) => [
{ content: ++i, styles: { halign: 'right' } },
item.no_laporan,
item.pembuat_laporan,
@@ -204,9 +205,16 @@ const exportToPDF = (reportMeta: any, data: any) => {
margin: { left: 230 }
})
- doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
- console.log('pdf berhasil disimpan')
- })
+ await doc
+ .save(`Laporan ${reportName}.pdf`, { returnPromise: true })
+ .then(() => {
+ console.log('PDF Exported')
+ })
+ .catch((error) => {
+ console.error('Error while exporting PDF', error)
+ })
+
+ return true
}
const exportToXLSX = (reportMeta: any, e: any) => {
@@ -266,10 +274,7 @@ const exportToXLSX = (reportMeta: any, e: any) => {
component: e.component,
worksheet,
autoFilterEnabled: true,
- topLeftCell: { row: 10, column: 1 },
- loadPanel: {
- enabled: false
- }
+ topLeftCell: { row: 10, column: 1 }
}).then(() => {
workbook.xlsx.writeBuffer().then((buffer: any) => {
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
@@ -279,15 +284,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
e.cancel = true
}
-const exportToDOCX = (reportMeta: any, data: any) => {
+const exportToDOCX = async (reportMeta: any, data: any) => {
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
const date = new Date().getDate()
const month = new Date().toLocaleString('id-ID', { month: 'long' })
const year = new Date().getFullYear()
const meta = formatMetaData(reportMeta)
+ const resultData = data.value.data
const generateRows = () => {
- return data.value.map((item: any, i: any) => {
+ return resultData.map((item: any, i: any) => {
return new TableRow({
children: [
{ text: `${++i}`, field: 'no' },
@@ -530,11 +536,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
]
})
- Packer.toBlob(doc).then((blob) => {
- console.log(blob)
- saveAs(blob, `Laporan ${reportName}.docx`)
- console.log('Document created successfully')
- })
+ await Packer.toBlob(doc)
+ .then((blob) => {
+ saveAs(blob, `Laporan ${reportName}.docx`)
+
+ console.log('DOCX Exported')
+ })
+ .catch((error) => {
+ console.error('Error while exporting DOCX', error)
+ })
+
+ return true
}
export { exportToPDF, exportToXLSX, exportToDOCX }
diff --git a/src/types/requestParams.ts b/src/types/requestParams.ts
index dabc4f1..e3e1b5f 100644
--- a/src/types/requestParams.ts
+++ b/src/types/requestParams.ts
@@ -3,7 +3,7 @@ interface IRequestOptions {
take: number
requireTotalCount: boolean
sort: null | Array