Add total_durasi_response and total_durasi_recovery fields to api.graphql.ts
This commit is contained in:
@@ -131,6 +131,20 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_durasi_response"
|
||||
data-type="number"
|
||||
caption="Jumlah Response"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.avg_durasi_response * rowData.total_durasi_response
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="120"
|
||||
alignment="center"
|
||||
@@ -191,6 +205,20 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_durasi_recovery"
|
||||
data-type="number"
|
||||
caption="Jumlah Recovery"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.avg_durasi_recovery * rowData.total_durasi_recovery
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="120"
|
||||
alignment="center"
|
||||
@@ -241,59 +269,74 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="no"
|
||||
column="nama_posko"
|
||||
display-format="Total"
|
||||
css-class="!text-left"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="total"
|
||||
summary-type="sum"
|
||||
name="total"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="total_selesai"
|
||||
summary-type="sum"
|
||||
name="total_selesai"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="persen_selesai"
|
||||
summary-type="avg"
|
||||
name="persen_selesai"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="total_inproses"
|
||||
summary-type="sum"
|
||||
name="total_inproses"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="persen_inproses"
|
||||
summary-type="avg"
|
||||
name="persen_inproses"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="total_durasi_response"
|
||||
summary-type="sum"
|
||||
name="total_durasi_response"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="count_durasi_response"
|
||||
name="count_durasi_response"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="avg_durasi_response"
|
||||
summary-type="avg"
|
||||
name="avg_durasi_response"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
@@ -328,14 +371,24 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="total_durasi_recovery"
|
||||
summary-type="sum"
|
||||
name="total_durasi_recovery"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="count_durasi_recovery"
|
||||
name="count_durasi_recovery"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
column="avg_durasi_recovery"
|
||||
summary-type="avg"
|
||||
name="avg_durasi_recovery"
|
||||
summary-type="custom"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
css-class="!text-right"
|
||||
/>
|
||||
@@ -371,49 +424,63 @@
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="Total"
|
||||
show-in-column="no"
|
||||
css-class="text-white !text-right"
|
||||
show-in-column="nama_posko"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total"
|
||||
name="total"
|
||||
column="total"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="total_selesai"
|
||||
summary-type="sum"
|
||||
name="total_selesai"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_selesai"
|
||||
summary-type="avg"
|
||||
name="persen_selesai"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="total_inproses"
|
||||
summary-type="sum"
|
||||
name="total_inproses"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_inproses"
|
||||
summary-type="avg"
|
||||
name="persen_inproses"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="total_durasi_response"
|
||||
summary-type="sum"
|
||||
name="total_durasi_response"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_durasi_response"
|
||||
name="count_durasi_response"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="avg_durasi_response"
|
||||
summary-type="avg"
|
||||
name="avg_durasi_response"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
@@ -443,13 +510,22 @@
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="total_durasi_recovery"
|
||||
summary-type="sum"
|
||||
name="total_durasi_recovery"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_durasi_recovery"
|
||||
name="count_durasi_recovery"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="avg_durasi_recovery"
|
||||
summary-type="avg"
|
||||
name="avg_durasi_recovery"
|
||||
summary-type="custom"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
@@ -872,7 +948,7 @@
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import Type8 from '@/components/Form/FiltersType/Type8.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@@ -880,7 +956,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPager,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
@@ -926,6 +1001,116 @@ const reportMeta = ref({
|
||||
const agreeToShowDialog = ref(false)
|
||||
const progressSelected = ref(0)
|
||||
|
||||
let total = 0
|
||||
let total_selesai = 0
|
||||
let total_inproses = 0
|
||||
let count_durasi_response = 0
|
||||
let total_durasi_response = 0
|
||||
let total_durasi_recovery = 0
|
||||
let count_durasi_recovery = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'total') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_selesai') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_selesai += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_selesai
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_inproses') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_inproses += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_inproses
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_inproses') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_response') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_response += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_response') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_response += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_response') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_recovery') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_recovery += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_recovery') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_recovery += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_recovery
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_recovery') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const setAgreementDialog = (status: boolean, progress: number) => {
|
||||
agreeToShowDialog.value = status
|
||||
progressSelected.value = progress
|
||||
|
Reference in New Issue
Block a user