feat(ui): add back navigation button to detail pages

- Implement reusable back button component
- Add back button to division and installation detail pages
- Improve navigation logic with additional state cleanup
This commit is contained in:
Khafid Prayoga
2025-10-28 15:49:39 +07:00
parent 54db81a5b9
commit d7e9ae03cb
6 changed files with 80 additions and 14 deletions

No files matched your search

+17 -6
View File
@@ -78,6 +78,7 @@ const headerPrep: HeaderPrep = {
label: 'Tambah',
icon: 'i-lucide-plus',
onClick: () => {
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = true
@@ -104,12 +105,22 @@ const getCurrentDivisionDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
navigateTo({
name: 'org-src-division-id',
params: {
id: Number(recId.value),
},
})
if (Number(recId.value) > 0) {
const id = Number(recId.value)
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
navigateTo({
name: 'org-src-division-id',
params: {
id,
},
})
}
break
case ActionEvents.showEdit: