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

This commit is contained in:
Eko Haryadi
2024-04-02 11:58:44 +07:00
81 changed files with 1043 additions and 1188 deletions

View File

@ -12,8 +12,7 @@
column-resizing-mode="widget">
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" />
<DxSelection mode="single" />
<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" />
<!-- <DxColumn
@ -231,10 +230,15 @@
@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"
:show-page-size-selector="true" :show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel shading-color="rgba(0,0,0,0.4)" :position="position" :show-indicator="showIndicator"
:show-pane="showPane" :shading="shading" v-model:visible="loadingSubData" :enabled="true" />
<DxPager
:visible="true"
:allowed-page-sizes="[20, 50, 100]"
display-mode="full"
:show-page-size-selector="true"
:show-info="true"
:show-navigation-buttons="true"
/>
<!-- -->
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
@ -446,6 +450,8 @@
</div>
</div>
</DetailDialog>
<BufferDialog v-if="loadingData || loadingSubData" />
</template>
<script setup lang="ts">
@ -467,10 +473,6 @@ import {
} from 'devextreme-vue/data-grid'
import { onMounted, ref } from 'vue'
import { exportDataGrid as exportToExcel } from 'devextreme/excel_exporter'
import { saveAs } from 'file-saver'
import { Workbook } from 'exceljs'
import { useQuery } from '@vue/apollo-composable'
import { requestGraphQl, queries } from '@/utils/api/api.graphql'
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
@ -484,9 +486,8 @@ import {
exportDetailToXLSX
} from '@/report/Gangguan/Rekap/RGangguan_ALL'
import { getDataRowGroup } from '@/utils/helper'
const calculateGroupValue = (e: any) => {
console.log(e)
}
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
const client = apolloClient()
provideApolloClient(client)
const position = { of: '#data' }
@ -765,6 +766,7 @@ const getDetail = async () => {
})
.finally(() => {
loadingSubData.value = false
dialogDetail.value = true
})
}
const dataGridRef = ref<DxDataGrid | null>(null)
@ -780,27 +782,10 @@ const showDetail = () => {
if (agreeToShowDialog.value) {
dataSub.value = []
dataSubSelected.value = null
dialogDetail.value = true
getDetail()
// getDetail()
}
}
const handleRowClick = (e: any) => {
if (e.rowType === 'group') {
// Retrieve the group value
const groupValue = e.data.key;
// Perform actions based on the group value
// console.log('Group Value:', groupValue);
}
}
const handleCellClick = (e: any) => {
console.log(e.values)
const rowType = e.rowType;
const columnName = e.column.dataField;
// Perform actions based on row type and column name
console.log('Row Type:', rowType);
console.log('Column Name:', columnName);
}
const onExporting = (e: any) => {
if (e.format === 'pdf') {
exportToPDF(reportMeta.value, data.value)