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() {
- + Message board diff --git a/app/pages/bonus-system/[userId].vue b/app/pages/bonus-system/[userId].vue index 368423a..4ccc53f 100644 --- a/app/pages/bonus-system/[userId].vue +++ b/app/pages/bonus-system/[userId].vue @@ -7,6 +7,8 @@ import { definePageMeta({ middleware: ['manager-only'], + path: '/admin/bonuses/balances/:userId', + alias: ['/bonus-system/:userId'], }); type TransactionItem = ManagerBonusAccountQuery['managerBonusAccount']['transactions'][number]; @@ -37,7 +39,7 @@ function formatDateTime(value: string) {