refactor: handle url to tab
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
This commit is contained in:
parent
dd2861010e
commit
db9a1d7056
3 changed files with 12 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ defineProps<{
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
isax?: boolean;
|
isax?: boolean;
|
||||||
|
tab?: string;
|
||||||
color:
|
color:
|
||||||
| 'green'
|
| 'green'
|
||||||
| 'red'
|
| 'red'
|
||||||
|
|
@ -28,8 +29,8 @@ defineProps<{
|
||||||
}[];
|
}[];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
function navigateTo(destination: string) {
|
function navigateTo(destination: string, tab?: string) {
|
||||||
router.push(`${destination}`);
|
router.push({ path: `${destination}`, query: tab ? { tab } : {} });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -44,7 +45,7 @@ function navigateTo(destination: string) {
|
||||||
v-for="(v, i) in list.filter((item) => !item.hidden)"
|
v-for="(v, i) in list.filter((item) => !item.hidden)"
|
||||||
:key="i"
|
:key="i"
|
||||||
:bordered="$q.dark.isActive"
|
:bordered="$q.dark.isActive"
|
||||||
@click="!v.disabled && navigateTo(v.value)"
|
@click="!v.disabled && navigateTo(v.value, v.tab)"
|
||||||
>
|
>
|
||||||
<AppCircle
|
<AppCircle
|
||||||
:id="`menu-icon-${v.value}`"
|
:id="`menu-icon-${v.value}`"
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { computed, onMounted, reactive, watch, ref } from 'vue';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
// NOTE: Components
|
// NOTE: Components
|
||||||
import StatCardComponent from 'src/components/StatCardComponent.vue';
|
import StatCardComponent from 'src/components/StatCardComponent.vue';
|
||||||
|
|
@ -29,6 +30,7 @@ import { PaginationResult } from 'src/types';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const route = useRoute();
|
||||||
const navigatorStore = useNavigator();
|
const navigatorStore = useNavigator();
|
||||||
const flowStore = useFlowStore();
|
const flowStore = useFlowStore();
|
||||||
const taskOrderStore = useTaskOrderStore();
|
const taskOrderStore = useTaskOrderStore();
|
||||||
|
|
@ -143,6 +145,10 @@ onMounted(async () => {
|
||||||
navigatorStore.current.path = [{ text: 'taskOrder.caption', i18n: true }];
|
navigatorStore.current.path = [{ text: 'taskOrder.caption', i18n: true }];
|
||||||
fetchTaskOrderList();
|
fetchTaskOrderList();
|
||||||
taskOrderStore.getTaskOrderStats();
|
taskOrderStore.getTaskOrderStats();
|
||||||
|
|
||||||
|
if (route.query['tab'] && typeof route.query['tab'] === 'string') {
|
||||||
|
pageState.currentTab = route.query['tab'];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
|
||||||
|
|
@ -84,11 +84,12 @@ onMounted(() => {
|
||||||
isax: true,
|
isax: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'receipt',
|
value: 'task-order',
|
||||||
icon: 'material-symbols:box',
|
icon: 'material-symbols:box',
|
||||||
color: 'camo',
|
color: 'camo',
|
||||||
title: 'menu.invoice',
|
title: 'menu.invoice',
|
||||||
caption: 'menu.invoiceCaption',
|
caption: 'menu.invoiceCaption',
|
||||||
|
tab: 'Complete',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue