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) => { keys.forEach((key: any, index: any) => {
if (filterPresets.value[key]) { if (filterPresets.value[key]) {
presetValues[index].value = filterPresets.value[key] presetValues[index].value = filterPresets.value[key]
setFunctions[index](filterPresets.value[key])
if (key !== 'uid') {
setFunctions[index](filterPresets.value[key])
}
} }
}) })
} else {
fetchUid()
} }
fetchUid()
emit('update:filters', data.value) emit('update:filters', data.value)
}) })
</script> </script>

View File

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

View File

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

View File

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

View File

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

View File

@ -155,16 +155,14 @@ onMounted(() => {
if (filterPresets.value[key]) { if (filterPresets.value[key]) {
presetValues[index].value = 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) emit('update:filters', data.value)
}) })
</script> </script>

View File

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

View File

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

View File

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