diff --git a/app/app.vue b/app/app.vue index 902c1f7..8af4386 100644 --- a/app/app.vue +++ b/app/app.vue @@ -17,90 +17,78 @@ const managerPageTabs = computed(() => { } if ( - route.path === '/client-orders' - || route.path.startsWith('/client-orders/') - || route.path === '/clients' - || route.path.startsWith('/clients/') + route.path === '/admin/orders' + || route.path.startsWith('/admin/orders/') ) { return [ { key: 'orders', label: 'Заказы', - active: route.path === '/client-orders' || route.path.startsWith('/client-orders/'), + active: route.path === '/admin/orders' + || ( + /^\/admin\/orders\/[^/]+$/.test(route.path) + && !route.path.startsWith('/admin/orders/clients') + && !route.path.startsWith('/admin/orders/requests') + ), to: { - path: '/client-orders', - query: route.path === '/client-orders' ? route.query : {}, + path: '/admin/orders', }, }, { key: 'clients', label: 'Клиенты', - active: route.path === '/clients' || route.path.startsWith('/clients/'), + active: route.path === '/admin/orders/clients' + || route.path.startsWith('/admin/orders/clients/') + || route.path.startsWith('/admin/orders/requests/'), to: { - path: '/clients', - query: route.path === '/clients' ? route.query : {}, + path: '/admin/orders/clients', }, }, ]; } - if (route.path === '/bonus-system' || route.path.startsWith('/bonus-system/')) { + if (route.path.startsWith('/admin/bonuses')) { return [ { key: 'balances', label: 'Балансы', - active: route.path !== '/bonus-system/withdrawals' - && !route.path.startsWith('/bonus-system/withdrawals/') - && route.query.tab !== 'withdrawals' - && route.query.tab !== 'rewards' - && route.query.tab !== 'products' - && route.query.tab !== 'manager', + active: route.path === '/admin/bonuses' + || route.path === '/admin/bonuses/balances' + || route.path.startsWith('/admin/bonuses/balances/') + || route.path.startsWith('/admin/bonuses/referrals/') + || route.path.startsWith('/admin/bonuses/transactions/'), to: { - path: '/bonus-system', - query: { - ...route.query, - tab: 'balances', - }, + path: '/admin/bonuses/balances', }, }, { key: 'withdrawals', label: 'Заявки на выплату', - active: route.path === '/bonus-system/withdrawals' - || route.path.startsWith('/bonus-system/withdrawals/') - || route.query.tab === 'withdrawals', + active: route.path === '/admin/bonuses/requests' + || route.path.startsWith('/admin/bonuses/requests/'), to: { - path: '/bonus-system', - query: { - ...route.query, - tab: 'withdrawals', - }, + path: '/admin/bonuses/requests', }, }, { key: 'rewards', label: 'Вознаграждения', - active: route.query.tab === 'rewards' || route.query.tab === 'products' || route.query.tab === 'manager', + active: route.path === '/admin/bonuses/rewards', to: { - path: '/bonus-system', - query: { - ...route.query, - tab: 'rewards', - }, + path: '/admin/bonuses/rewards', }, }, ]; } - if (route.path === '/messages') { + if (route.path.startsWith('/admin/settings')) { return [ { key: 'messages', label: 'Сообщения', active: true, to: { - path: '/messages', - query: {}, + path: '/admin/settings/messages', }, }, ]; diff --git a/app/components/ui/AppManagerDock.vue b/app/components/ui/AppManagerDock.vue index a60a732..a7a84e4 100644 --- a/app/components/ui/AppManagerDock.vue +++ b/app/components/ui/AppManagerDock.vue @@ -8,23 +8,20 @@ type DockItem = { const route = useRoute(); const dockItems: DockItem[] = [ - { to: '/client-orders', label: 'Заказы', icon: 'orders' }, - { to: '/bonus-system', label: 'Бонусы', icon: 'bonus' }, - { to: '/messages', label: 'Настройки', icon: 'settings' }, + { to: '/admin/orders', label: 'Заказы', icon: 'orders' }, + { to: '/admin/bonuses/balances', label: 'Бонусы', icon: 'bonus' }, + { to: '/admin/settings/messages', label: 'Настройки', icon: 'settings' }, ]; function isActive(path: string) { - if (path === '/client-orders') { - return route.path === '/client-orders' - || route.path.startsWith('/client-orders/') - || route.path === '/clients' - || route.path.startsWith('/clients/'); + if (path === '/admin/orders') { + return route.path === '/admin/orders' || route.path.startsWith('/admin/orders/'); } - if (path === '/bonus-system') { - return route.path === '/bonus-system' || route.path.startsWith('/bonus-system/'); + if (path === '/admin/bonuses/balances') { + return route.path.startsWith('/admin/bonuses'); } - if (path === '/messages') { - return route.path === '/messages'; + if (path === '/admin/settings/messages') { + return route.path.startsWith('/admin/settings'); } return route.path === path; } diff --git a/app/pages/bonus-program.vue b/app/pages/bonus-program.vue index 6af9464..ecb0efd 100644 --- a/app/pages/bonus-program.vue +++ b/app/pages/bonus-program.vue @@ -120,7 +120,7 @@ async function submitWithdrawal() {
Бонусы
diff --git a/app/pages/bonus-system/transactions/new.vue b/app/pages/bonus-system/transactions/new.vue index 3e03c35..2361c12 100644 --- a/app/pages/bonus-system/transactions/new.vue +++ b/app/pages/bonus-system/transactions/new.vue @@ -4,6 +4,8 @@ import { AddBonusTransactionDocument } from '~/composables/graphql/generated'; definePageMeta({ middleware: ['manager-only'], + path: '/admin/bonuses/transactions/new', + alias: ['/bonus-system/transactions/new'], }); const userId = ref(''); @@ -29,7 +31,7 @@ async function addBonus() {Бонусы
diff --git a/app/pages/bonus-system/withdrawals/[id].vue b/app/pages/bonus-system/withdrawals/[id].vue index 727eaba..5cf619e 100644 --- a/app/pages/bonus-system/withdrawals/[id].vue +++ b/app/pages/bonus-system/withdrawals/[id].vue @@ -8,6 +8,8 @@ import { definePageMeta({ middleware: ['manager-only'], + path: '/admin/bonuses/requests/:id', + alias: ['/bonus-system/withdrawals/:id'], }); const route = useRoute(); @@ -47,7 +49,7 @@ async function reviewWithdrawal() {Приглашение
diff --git a/app/pages/messages.vue b/app/pages/messages.vue index 360b452..af355c0 100644 --- a/app/pages/messages.vue +++ b/app/pages/messages.vue @@ -7,6 +7,8 @@ import { definePageMeta({ middleware: ['manager-only'], + path: '/admin/settings/messages', + alias: ['/messages'], }); type TemplateItem = NotificationTemplatesQuery['notificationTemplates'][number];