Move manager routes under /admin

This commit is contained in:
Ruslan Bakiev
2026-04-06 16:12:54 +07:00
parent 0380c54d60
commit b640885ef0
14 changed files with 83 additions and 73 deletions

View File

@@ -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',
},
},
];