|
|
|
@ -154,13 +154,15 @@ export const useViewsStore = defineStore('viewsStore', () => {
|
|
|
|
|
baseId, |
|
|
|
|
tableId, |
|
|
|
|
hardReload, |
|
|
|
|
doNotSwitchTab, |
|
|
|
|
}: { |
|
|
|
|
view: ViewType |
|
|
|
|
baseId: string |
|
|
|
|
tableId: string |
|
|
|
|
hardReload?: boolean |
|
|
|
|
doNotSwitchTab?: boolean |
|
|
|
|
}) => { |
|
|
|
|
const routeName = 'index-typeOrId-baseId-index-index-viewId-viewTitle' |
|
|
|
|
const routeName = 'index-typeOrId-baseId-index-index-viewId-viewTitle-slugs' |
|
|
|
|
|
|
|
|
|
let baseIdOrBaseId = baseId |
|
|
|
|
|
|
|
|
@ -168,6 +170,8 @@ export const useViewsStore = defineStore('viewsStore', () => {
|
|
|
|
|
baseIdOrBaseId = route.value.params.baseId as string |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const slugs = doNotSwitchTab ? router.currentRoute.value.params.slugs : undefined |
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
router.currentRoute.value.query && |
|
|
|
|
router.currentRoute.value.query.page && |
|
|
|
@ -175,11 +179,24 @@ export const useViewsStore = defineStore('viewsStore', () => {
|
|
|
|
|
) { |
|
|
|
|
await router.push({ |
|
|
|
|
name: routeName, |
|
|
|
|
params: { viewTitle: view.id || '', viewId: tableId, baseId: baseIdOrBaseId }, |
|
|
|
|
params: { |
|
|
|
|
viewTitle: view.id || '', |
|
|
|
|
viewId: tableId, |
|
|
|
|
baseId: baseIdOrBaseId, |
|
|
|
|
slugs, |
|
|
|
|
}, |
|
|
|
|
query: router.currentRoute.value.query, |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
await router.push({ name: routeName, params: { viewTitle: view.id || '', viewId: tableId, baseId: baseIdOrBaseId } }) |
|
|
|
|
await router.push({ |
|
|
|
|
name: routeName, |
|
|
|
|
params: { |
|
|
|
|
viewTitle: view.id || '', |
|
|
|
|
viewId: tableId, |
|
|
|
|
baseId: baseIdOrBaseId, |
|
|
|
|
slugs, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (hardReload) { |
|
|
|
@ -187,13 +204,23 @@ export const useViewsStore = defineStore('viewsStore', () => {
|
|
|
|
|
.replace({ |
|
|
|
|
name: routeName, |
|
|
|
|
query: { reload: 'true' }, |
|
|
|
|
params: { viewId: tableId, baseId: baseIdOrBaseId, viewTitle: view.id || '' }, |
|
|
|
|
params: { |
|
|
|
|
viewId: tableId, |
|
|
|
|
baseId: baseIdOrBaseId, |
|
|
|
|
viewTitle: view.id || '', |
|
|
|
|
slugs, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
router.replace({ |
|
|
|
|
name: routeName, |
|
|
|
|
query: {}, |
|
|
|
|
params: { viewId: tableId, viewTitle: view.id || '', baseId: baseIdOrBaseId }, |
|
|
|
|
params: { |
|
|
|
|
viewId: tableId, |
|
|
|
|
viewTitle: view.id || '', |
|
|
|
|
baseId: baseIdOrBaseId, |
|
|
|
|
slugs, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|