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:
@@ -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:
|
||||
|
||||
@@ -9,7 +9,7 @@ import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import type { Installation } from '~/models/installation'
|
||||
import { getDetail as getDetailInstallation } from '~/services/installation.service'
|
||||
|
||||
// #region division positions
|
||||
// #region installtaion positions
|
||||
import { config } from '~/components/app/installation/detail/list.cfg'
|
||||
|
||||
// Helpers
|
||||
@@ -174,7 +174,7 @@ watch([recId, recAction], () => {
|
||||
<AppInstallationDetail :installation="installation" />
|
||||
<div class="h-6"></div>
|
||||
|
||||
<LazyAppInstallationDetailList
|
||||
<AppInstallationDetailList
|
||||
:data="dataMap"
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"
|
||||
|
||||
@@ -102,12 +102,22 @@ const getCurrentInstallationDetail = async (id: number | string) => {
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
navigateTo({
|
||||
name: 'org-src-installation-id',
|
||||
params: {
|
||||
id: 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-installation-id',
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
|
||||
Reference in New Issue
Block a user