Update import paths and add formatWaktu function
This commit is contained in:
parent
ecf72b238a
commit
73bafc8107
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import Button from '@/components/Button.vue'
|
||||
import Button from '@/components/Buttons/Button.vue'
|
||||
import { PhArrowsCounterClockwise, PhFileText, PhMagnifyingGlass } from '@phosphor-icons/vue'
|
||||
|
||||
defineProps({
|
||||
|
@ -139,6 +139,17 @@ const fetchRegional = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const formatWaktu = (durasiDetik: number): string => {
|
||||
const hari = Math.floor(durasiDetik / (3600 * 24))
|
||||
const sisaDetik = durasiDetik % (3600 * 24)
|
||||
const jam = Math.floor(sisaDetik / 3600)
|
||||
const sisaDetik2 = sisaDetik % 3600
|
||||
const menit = Math.floor(sisaDetik2 / 60)
|
||||
const detik = sisaDetik2 % 60
|
||||
|
||||
return `${hari} - ${jam} : ${menit} : ${detik}`
|
||||
}
|
||||
|
||||
const selectedUid = (value: any) => {
|
||||
fetchDataUp3(value.id)
|
||||
}
|
||||
@ -176,5 +187,6 @@ export {
|
||||
itemsMedia,
|
||||
itemsUlp,
|
||||
months,
|
||||
years
|
||||
years,
|
||||
formatWaktu
|
||||
}
|
||||
|
@ -121,6 +121,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -128,6 +129,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -150,6 +152,12 @@
|
||||
data-field="media"
|
||||
caption="Keterangan Media"
|
||||
/>
|
||||
|
||||
<template #data-waktu="{ data }">
|
||||
<p>
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
</template>
|
||||
@ -157,6 +165,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type16 from '@/components/Form/FiltersType/Type16.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
|
@ -108,7 +108,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
cell-template="data"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -116,7 +116,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
cell-template="data"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -198,11 +198,18 @@
|
||||
caption="Posko"
|
||||
cell-template="data"
|
||||
/>
|
||||
|
||||
<template #data="{ data }">
|
||||
<p class="cursor-pointer" @click="showData()">
|
||||
{{ data.text }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #data-waktu="{ data }">
|
||||
<p class="cursor-pointer" @click="showData()">
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
|
||||
@ -244,12 +251,28 @@
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Durasi Response Time:</h3>
|
||||
<InputText :readonly="true" :value="dataDetail?.durasi_response_time" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="
|
||||
parseInt(dataDetail?.durasi_response_time)
|
||||
? formatWaktu(dataDetail?.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-[170px] text-gray-800">Durasi Recovery Time:</h3>
|
||||
<InputText :readonly="true" :value="dataDetail?.durasi_recovery_time" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
class-name="flex-1"
|
||||
:value="
|
||||
parseInt(dataDetail?.durasi_recovery_time)
|
||||
? formatWaktu(dataDetail?.durasi_recovery_time)
|
||||
: '-'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
@ -323,6 +346,7 @@ import {
|
||||
DxSearchPanel,
|
||||
DxSelection
|
||||
} from 'devextreme-vue/data-grid'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { ref } from 'vue'
|
||||
import { jsPDF } from 'jspdf'
|
||||
import autoTable from 'jspdf-autotable'
|
||||
|
@ -86,6 +86,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -93,6 +94,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -150,6 +152,12 @@
|
||||
data-field="nama_posko"
|
||||
caption="Posko"
|
||||
/>
|
||||
|
||||
<template #data-waktu="{ data }">
|
||||
<p>
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
</template>
|
||||
@ -157,6 +165,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
|
@ -96,7 +96,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
cell-template="data"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -104,7 +104,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
cell-template="data"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -176,6 +176,12 @@
|
||||
{{ data.text }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #data-waktu="{ data }">
|
||||
<p class="cursor-pointer" @click="showData()">
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
|
||||
@ -212,12 +218,28 @@
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Response Time:</h3>
|
||||
<InputText :readonly="true" :value="dataDetail?.durasi_response_time" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="
|
||||
parseInt(dataDetail?.durasi_response_time)
|
||||
? formatWaktu(dataDetail?.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-[170px] text-gray-800">Recovery Time:</h3>
|
||||
<InputText :readonly="true" :value="dataDetail?.durasi_recovery_time" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
class-name="flex-1"
|
||||
:value="
|
||||
parseInt(dataDetail?.durasi_recovery_time)
|
||||
? formatWaktu(dataDetail?.durasi_recovery_time)
|
||||
: '-'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
@ -271,6 +293,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type6 from '@/components/Form/FiltersType/Type6.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
|
@ -86,6 +86,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -93,6 +94,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -157,6 +159,12 @@
|
||||
data-field="nama_posko"
|
||||
caption="Posko"
|
||||
/>
|
||||
|
||||
<template #data-waktu="{ data }">
|
||||
<p>
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
</template>
|
||||
@ -164,6 +172,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type7 from '@/components/Form/FiltersType/Type7.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
|
@ -91,7 +91,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
cell-template="data"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -99,7 +99,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
cell-template="data"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -171,6 +171,12 @@
|
||||
{{ data.text }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #data-waktu="{ data }">
|
||||
<p class="cursor-pointer" @click="showData()">
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
|
||||
@ -198,12 +204,28 @@
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Response Time:</h3>
|
||||
<InputText :readonly="true" :value="dataDetail?.durasi_response_time" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="
|
||||
parseInt(dataDetail?.durasi_response_time)
|
||||
? formatWaktu(dataDetail?.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-[170px] text-gray-800">Recovery Time:</h3>
|
||||
<InputText :readonly="true" :value="dataDetail?.durasi_recovery_time" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
class-name="flex-1"
|
||||
:value="
|
||||
parseInt(dataDetail?.durasi_recovery_time)
|
||||
? formatWaktu(dataDetail?.durasi_recovery_time)
|
||||
: '-'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
@ -277,6 +299,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type7 from '@/components/Form/FiltersType/Type7.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
|
@ -86,6 +86,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -93,6 +94,7 @@
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
cell-template="data-waktu"
|
||||
/>
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
@ -150,12 +152,19 @@
|
||||
data-field="nama_posko"
|
||||
caption="Posko"
|
||||
/>
|
||||
|
||||
<template #data-waktu="{ data }">
|
||||
<p>
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
|
Loading…
x
Reference in New Issue
Block a user