fix: filters

This commit is contained in:
kur0nek-o 2024-05-08 08:23:48 +07:00
parent 0d29f2dd3b
commit 8160e53e93
9 changed files with 29 additions and 50 deletions

View File

@ -89,16 +89,13 @@ onMounted(() => {
keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchUid()
}
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -165,16 +165,13 @@ onMounted(() => {
keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchUid()
}
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -122,16 +122,13 @@ onMounted(() => {
keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchUid()
}
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -90,16 +90,13 @@ onMounted(() => {
keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchUid()
}
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -173,16 +173,13 @@ onMounted(() => {
keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchUid()
}
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -155,16 +155,14 @@ onMounted(() => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'regional' || key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchRegional()
fetchUid()
}
fetchRegional()
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -88,16 +88,13 @@ onMounted(() => {
keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchUid()
}
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -99,16 +99,13 @@ onMounted(() => {
keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key]
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
setFunctions[index](filterPresets.value[key])
}
})
} else {
fetchUid()
}
fetchUid()
emit('update:filters', data.value)
})
</script>

View File

@ -51,7 +51,7 @@ export const useAuthStore = defineStore('auth', () => {
if (response.status) {
const data = response.user
writeData('token', 'secret-token')
// writeData('token', 'secret-token')
writeData('user_name', data.username)
writeData('user_access', 'Petugas')
writeData('user_uid', data.namaUid)
@ -64,7 +64,9 @@ export const useAuthStore = defineStore('auth', () => {
type: 'success'
})
window.location.reload()
console.log(filterPresets.value)
console.log(data)
// window.location.reload()
} else {
dispatchNotification({
title: 'Login Gagal',