admin user and ui panel

This commit is contained in:
s.esmaeili
2026-09-21 08:32:31 +03:30
parent 79226c9f13
commit ef1d4638cc
341 changed files with 2270 additions and 657 deletions
+25 -1
View File
@@ -26,7 +26,7 @@ export const adminRoute: RouteRecordRaw[] = [
{
path: '/',
name: 'dashboard',
redirect: '/my-data'
redirect: '/dashboard/ecommerce'
},
{
// Legacy had two dashboards ("آمار تک فروشی" at /dashboard/analytics and
@@ -470,6 +470,30 @@ export const adminRoute: RouteRecordRaw[] = [
no_scroll: true
}
},
{
// Add uses the same form as edit, with no :id — see ReagentCustomer.vue.
path: '/reagent/add',
name: 'reagent-add',
component: () => import('../views/apps/customer/EditReagent.vue'),
meta: {
rule: 'editor',
role: 'persons.create',
parent: 'product',
no_scroll: true
}
},
{
// A sales agent's own detail screen — see AgentDetail.vue's header comment.
path: '/reagent/view/:id',
name: 'reagent-view',
component: () => import('../views/customer/reagentList/AgentDetail.vue'),
meta: {
rule: 'editor',
role: 'persons.list.sellers.view',
parent: 'product',
no_scroll: true
}
},
{
path: '/bulkCustomer/edit/:id',
name: 'bulkCustomer-edit',
+3
View File
@@ -117,6 +117,9 @@ router.beforeEach(async (to) => {
if (token) {
const roles = await getPermission();
if (roles && to.meta && to.meta.role && !roles.includes(to.meta.role as string)) {
if (to.name === 'dashboard-ecommerce' || to.name === 'dashboard-analytics') {
return { name: 'my-data' };
}
return { name: 'page-not-authorized' };
}
return true;