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