Add build-push script and update API queries
This commit is contained in:
parent
6bfa78010e
commit
53ff89e7fe
29
build-push.js
Normal file
29
build-push.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// build-and-push.js
|
||||||
|
const { exec } = require('child_process')
|
||||||
|
|
||||||
|
function buildAndPush(version) {
|
||||||
|
const dockerImageTag = `defuj/apkt-eis:${version}`
|
||||||
|
const command = `npm run build && docker build . -t ${dockerImageTag} && docker push ${dockerImageTag}`
|
||||||
|
|
||||||
|
exec(command, (error, stdout, stderr) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(`Error: ${error.message}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (stderr) {
|
||||||
|
console.error(`stderr: ${stderr}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log(`stdout: ${stdout}`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ambil argumen versi dari command line
|
||||||
|
const version = process.argv[2]
|
||||||
|
|
||||||
|
if (!version) {
|
||||||
|
console.error('Usage: node build-push.js <version>')
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
buildAndPush(version)
|
@ -11,7 +11,8 @@
|
|||||||
"build-only": "vite build",
|
"build-only": "vite build",
|
||||||
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||||
"format": "prettier --write src/"
|
"format": "prettier --write src/",
|
||||||
|
"build-push": "node build-push.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.8.10",
|
"@apollo/client": "^3.8.10",
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
|
@cell-click="onCellClicked"
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
@ -25,7 +26,7 @@
|
|||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" expand-mode="rowClick" />
|
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :enabled="false" />
|
<DxPaging :enabled="false" />
|
||||||
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
||||||
@ -280,19 +281,19 @@
|
|||||||
</DxSummary>
|
</DxSummary>
|
||||||
|
|
||||||
<template #formatText="{ data }">
|
<template #formatText="{ data }">
|
||||||
<p class="text-left cursor-pointer">
|
<p class="text-left cursor-pointer" @click="setMonth('')">
|
||||||
{{ data.text }}
|
{{ data.text }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #formatPercentage="{ data }">
|
<template #formatPercentage="{ data }">
|
||||||
<p class="text-right cursor-pointer">
|
<p class="text-right cursor-pointer" @click="setMonth('')">
|
||||||
{{ isNumber(data.text) ? formatPercentage(data.text) : data.text }}
|
{{ isNumber(data.text) ? formatPercentage(data.text) : data.text }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #formatNumber="{ data }">
|
<template #formatNumber="{ data }">
|
||||||
<p class="text-right cursor-pointer">
|
<p class="text-right cursor-pointer" @click="setMonth(data.column.caption)">
|
||||||
{{
|
{{
|
||||||
isNumber(data.text)
|
isNumber(data.text)
|
||||||
? data.column.caption == '%'
|
? data.column.caption == '%'
|
||||||
@ -304,7 +305,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #formatTime="{ data }">
|
<template #formatTime="{ data }">
|
||||||
<p class="!text-right cursor-pointer">
|
<p class="!text-right cursor-pointer" @click="setMonth('')">
|
||||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
@ -1132,6 +1133,7 @@ import {
|
|||||||
exportDetailToPDF,
|
exportDetailToPDF,
|
||||||
exportDetailToXLSX
|
exportDetailToXLSX
|
||||||
} from '@/report/Gangguan/Rekap/RGangguan_KTI'
|
} from '@/report/Gangguan/Rekap/RGangguan_KTI'
|
||||||
|
import { getMonthNumber } from '@/utils/texts'
|
||||||
|
|
||||||
const client = apolloClient()
|
const client = apolloClient()
|
||||||
provideApolloClient(client)
|
provideApolloClient(client)
|
||||||
@ -1146,17 +1148,70 @@ const dataSubSelected = ref()
|
|||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
const loadingData = ref(false)
|
const loadingData = ref(false)
|
||||||
const loadingSubData = ref(false)
|
const loadingSubData = ref(false)
|
||||||
|
const monthSelected = ref<any>(null)
|
||||||
const reportMeta = ref({
|
const reportMeta = ref({
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
posko: { id: 0, name: 'Semua Posko' },
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
const groupIndex = ref(0)
|
||||||
|
const groupDialog = ref(false)
|
||||||
|
const groupData = ref<any>(null)
|
||||||
|
|
||||||
|
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
|
||||||
|
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 setMonth = (month: any) => {
|
||||||
|
if (month != '') {
|
||||||
|
monthSelected.value = getMonthNumber(month)
|
||||||
|
} else {
|
||||||
|
monthSelected.value = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
loadingSubData.value = true
|
loadingSubData.value = true
|
||||||
const dateValue = filters.value.periode.split(' s/d ')
|
const dateValue = filters.value.periode.split(' s/d ')
|
||||||
const ref = dataSelected.value
|
const ref = dataSelected.value
|
||||||
|
const compDate = dateValue[0].split('-').reverse().join('-').split('-')
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
@ -1167,7 +1222,9 @@ const getDetail = async () => {
|
|||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
posko: ref?.id_posko ? ref?.id_posko : 0,
|
posko: ref?.id_posko ? ref?.id_posko : 0,
|
||||||
idUid: ref?.id_uid ? ref?.id_uid : 0,
|
idUid: ref?.id_uid ? ref?.id_uid : 0,
|
||||||
idUp3: ref?.id_up3 ? ref?.id_up3 : 0
|
idUp3: ref?.id_up3 ? ref?.id_up3 : 0,
|
||||||
|
bulan: monthSelected.value,
|
||||||
|
tahun: parseInt(compDate[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
loadingSubData.value = true
|
loadingSubData.value = true
|
||||||
@ -1197,8 +1254,10 @@ const showDetail = () => {
|
|||||||
clearSelection()
|
clearSelection()
|
||||||
dataSub.value = []
|
dataSub.value = []
|
||||||
dataSubSelected.value = null
|
dataSubSelected.value = null
|
||||||
dialogDetail.value = true
|
if (monthSelected.value != null) {
|
||||||
getDetail()
|
dialogDetail.value = true
|
||||||
|
getDetail()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
@ -1256,12 +1315,23 @@ const filterData = async (params: any) => {
|
|||||||
idPosko: posko ? posko.id : 0,
|
idPosko: posko ? posko.id : 0,
|
||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0,
|
idUp3: up3 ? up3.id : 0,
|
||||||
is_transaksi_individual: jenisTransaksi.includes('Koreksi Transaksi Individual') ? 1 : 0,
|
is_transaksi_individual:
|
||||||
is_cleansing_transaksi_tm: jenisTransaksi.includes('Cleansing Traksaksi TM') ? 1 : 0,
|
jenisTransaksi.length == 4
|
||||||
is_koreksi_transaksi_tm: jenisTransaksi.includes('Koreksi Transaksi TM') ? 1 : 0,
|
? 0
|
||||||
is_koreksi_gangguan_dan_anev: jenisTransaksi.includes('Koreksi Kode Gangguan dan Anev') ? 1 : 0
|
: jenisTransaksi.includes('Koreksi Transaksi Individual')
|
||||||
|
? 1
|
||||||
|
: 2,
|
||||||
|
is_cleansing_transaksi_tm:
|
||||||
|
jenisTransaksi.length == 4 ? 0 : jenisTransaksi.includes('Cleansing Traksaksi TM') ? 1 : 2,
|
||||||
|
is_koreksi_transaksi_tm:
|
||||||
|
jenisTransaksi.length == 4 ? 0 : jenisTransaksi.includes('Koreksi Transaksi TM') ? 1 : 2,
|
||||||
|
is_koreksi_gangguan_dan_anev:
|
||||||
|
jenisTransaksi.length == 4
|
||||||
|
? 0
|
||||||
|
: jenisTransaksi.includes('Koreksi Kode Gangguan dan Anev')
|
||||||
|
? 1
|
||||||
|
: 2
|
||||||
}
|
}
|
||||||
console.table(query)
|
|
||||||
|
|
||||||
loadingData.value = true
|
loadingData.value = true
|
||||||
await requestGraphQl(queries.gangguan.rekap.gangguanKoreksiTransaksiIndividual, query)
|
await requestGraphQl(queries.gangguan.rekap.gangguanKoreksiTransaksiIndividual, query)
|
||||||
|
@ -1044,6 +1044,10 @@ export const queries = {
|
|||||||
$idPosko: Int!
|
$idPosko: Int!
|
||||||
$idUid: Int!
|
$idUid: Int!
|
||||||
$idUp3: Int!
|
$idUp3: Int!
|
||||||
|
$is_transaksi_individual: Int!
|
||||||
|
$is_cleansing_transaksi_tm: Int!
|
||||||
|
$is_koreksi_transaksi_tm: Int!
|
||||||
|
$is_koreksi_gangguan_dan_anev: Int!
|
||||||
) {
|
) {
|
||||||
rekapitulasiGangguanKoreksiTransaksiIndividual(
|
rekapitulasiGangguanKoreksiTransaksiIndividual(
|
||||||
dateFrom: $dateFrom
|
dateFrom: $dateFrom
|
||||||
@ -1051,6 +1055,10 @@ export const queries = {
|
|||||||
idPosko: $idPosko
|
idPosko: $idPosko
|
||||||
idUid: $idUid
|
idUid: $idUid
|
||||||
idUp3: $idUp3
|
idUp3: $idUp3
|
||||||
|
is_transaksi_individual: $is_transaksi_individual
|
||||||
|
is_cleansing_transaksi_tm: $is_cleansing_transaksi_tm
|
||||||
|
is_koreksi_transaksi_tm: $is_koreksi_transaksi_tm
|
||||||
|
is_koreksi_gangguan_dan_anev: $is_koreksi_gangguan_dan_anev
|
||||||
) {
|
) {
|
||||||
nama_regional
|
nama_regional
|
||||||
id
|
id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user