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:
No files matched your search
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user