forked from verdnatura/salix-front
refs #5989 bton redirect
This commit is contained in:
parent
ac7462ec67
commit
9a634f08a5
|
@ -17,26 +17,16 @@ const user = state.getUser();
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
onMounted(() => stateStore. setMounted());
|
onMounted(() => stateStore.setMounted());
|
||||||
|
|
||||||
async function redirect() {
|
async function redirect() {
|
||||||
const currentURL = window.location.href;
|
let section = route.path.substring(1);
|
||||||
const routeRegex = /\/(\w+)(?:\/(\d+))?/;
|
if (!route.path.includes('/')) return (window.location.href = await getUrl(section));
|
||||||
const match = currentURL.match(routeRegex);
|
section = section.substring(0, section.indexOf('/'));
|
||||||
const [, element, number] = match;
|
|
||||||
console.log(route.path);
|
|
||||||
const section = route.path.substring(route.path.indexOf('/'));
|
|
||||||
console.log(section);
|
|
||||||
if (route?.params?.id) {
|
if (route?.params?.id) {
|
||||||
// const redirectURL =
|
window.location.href = await getUrl(`${section}/${route.params.id}/summary`);
|
||||||
// getUrl() + (number ? `${element}/${number}/summary` : `${element}/index`);
|
|
||||||
// window.location.href = redirectURL;
|
|
||||||
console.log(await getUrl(section));
|
|
||||||
window.location.href = await getUrl(section + route.params);
|
|
||||||
} else {
|
} else {
|
||||||
console.log(await getUrl(section));
|
window.location.href = await getUrl(section + 'dashboard');
|
||||||
|
|
||||||
// window.location.href = await getUrl('claim');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -79,21 +69,11 @@ async function redirect() {
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
||||||
<div id="actions-prepend"></div>
|
<div id="actions-prepend"></div>
|
||||||
<QBtn
|
<QBtn @click="redirect($route.params.id)" icon="open_in_new"> </QBtn>
|
||||||
@click="redirect(this.$route.params.id)"
|
|
||||||
icon="open_in_new"
|
|
||||||
label="Ir a SALIX"
|
|
||||||
></QBtn>
|
|
||||||
<QBtn id="pinnedModules" icon="apps" flat dense rounded>
|
<QBtn id="pinnedModules" icon="apps" flat dense rounded>
|
||||||
<QTooltip bottom>
|
<QTooltip bottom>
|
||||||
{{ t('globals.pinnedModules') }}
|
{{ t('globals.pinnedModules') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
<PinnedModules>
|
|
||||||
<QBtn
|
|
||||||
@click="redirect(this.$route.params.id)"
|
|
||||||
icon="open_in_new"
|
|
||||||
></QBtn>
|
|
||||||
</PinnedModules>
|
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn rounded dense flat no-wrap id="user">
|
<QBtn rounded dense flat no-wrap id="user">
|
||||||
<QAvatar size="lg">
|
<QAvatar size="lg">
|
||||||
|
|
|
@ -36,7 +36,9 @@ const pinnedModules = computed(() => navigation.getPinnedModules());
|
||||||
<div class="text-grey-5" v-if="pinnedModules.length === 0">
|
<div class="text-grey-5" v-if="pinnedModules.length === 0">
|
||||||
{{ t('pinnedInfo') }}
|
{{ t('pinnedInfo') }}
|
||||||
</div>
|
</div>
|
||||||
<template v-if="pinnedModules.length">
|
<QBtn @click="redirect($route.params.id)" icon="open_in_new">
|
||||||
|
</QBtn>
|
||||||
|
<template v-if="pinnedModules.length >= 0">
|
||||||
<div
|
<div
|
||||||
v-for="item of pinnedModules"
|
v-for="item of pinnedModules"
|
||||||
:key="item.title"
|
:key="item.title"
|
||||||
|
|
Loading…
Reference in New Issue