Reset data before filtering

This commit is contained in:
Dede Fuji Abdul
2024-03-31 00:33:46 +07:00
parent 3612a6cf66
commit f2dd2af2bb
45 changed files with 262 additions and 0 deletions

View File

@@ -356,7 +356,13 @@ const currentYear = ref(new Date().getFullYear())
const currentMonth = ref(new Date().getMonth())
const lastYear = ref(currentYear.value - 1)
const resetData = () => {
data.value = []
dataSub.value = []
}
const filterData = async (params: any) => {
resetData()
const { regional, ulp, uid, up3, bulan, tahun } = params
lastMonth.value = bulan.id == 1 ? 12 : bulan.id - 1
lastYearMoM.value = bulan.id == 1 ? tahun.id - 1 : tahun.id