Files
hedena_gold/apps/admin-panel/src/router/admin.ts
T
s.esmaeili ea86636027 Initial commit: Hedena Gold monorepo.
First commit of the Hedena Gold product (separate from gold-bank): branding, package names, and deploy defaults aligned to the new brand; legacy Henza trees stay local-only via .gitignore.
2026-10-15 17:19:10 +03:30

1145 lines
26 KiB
TypeScript

// Ported from legacy henza_admin/src/router/admin.js
//
// Converted MECHANICALLY (see scratchpad/convert_routes.js) so every path, name,
// meta.role, breadcrumb and pageTitle survives byte-exact. Only the component
// imports are rewritten to point at the ported views. As of Batch 15 every
// referenced view exists, so no placeholder is emitted.
//
// ONE DELIBERATE DEVIATION from byte-exactness. Legacy declared these seven
// paths WITHOUT a leading slash (henza_admin/src/router/admin.js:260-320):
// major/promotion/{list,add,edit/:id,tak/add,tak/edit/:id,autopromotion}
// major/offersIgnore
// Under vue-router 3 a relative child of a parent whose path is '' still
// resolved to an absolute '/major/...', which is the URL legacy's own nav menu
// linked to and the URL users actually visited. vue-router 4 does NOT do that:
// the child stays relative, never matches '/major/...', and the catch-all
// redirects to /pages/error-404 — so all seven screens were unreachable.
// The leading slash is added here to preserve legacy's RUNTIME behaviour (the
// working URL), at the cost of the literal source text matching legacy.
//
// NOTE: legacy also shipped 8 router files with zero importers (apps.js,
// category.js, customer.js, dashboard.js, full.js, manage.js, order.js,
// product.js, temp.js). They are dead code and are not ported.
import type { RouteRecordRaw } from 'vue-router';
export const adminRoute: RouteRecordRaw[] = [
{
path: '/',
name: 'dashboard',
redirect: '/dashboard/ecommerce'
},
{
// Legacy had two dashboards ("آمار تک فروشی" at /dashboard/analytics and
// "آمار عمده فروشی" at /dashboard/ecommerce) behind two rids. Merged into
// one screen behind one rid (dashboard.view) — see Dashboard.vue. Both
// old paths still resolve so any bookmarked/linked URL keeps working.
path: '/dashboard/analytics',
name: 'dashboard-analytics',
component: () => import('../views/Dashboard.vue'),
meta: {
rule: 'editor',
role: 'dashboard.view'
}
},
{
path: '/my-data',
name: 'my-data',
component: () => import('../views/user/myData.vue'),
meta: {
rule: 'editor'
// role: 'dashboard.tak'
}
},
{
path: '/dashboard/ecommerce',
name: 'dashboard-ecommerce',
component: () => import('../views/Dashboard.vue'),
meta: {
rule: 'admin',
role: 'dashboard.view'
}
},
{
path: '/config/manage/const',
component: () => import('../views/manage/Const.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'مدیریت ثابت ها',
active: true
}
],
pageTitle: 'مدیریت ثابت ها',
rule: 'editor',
role: 'config.statics',
parent: 'manage',
no_scroll: true
}
},
{
path: '/config/manage/wallet',
component: () => import('../views/manage/wallet.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'مدیریت کیف پول',
active: true
}
],
pageTitle: 'مدیریت کیف پول',
rule: 'editor',
role: 'config.wallet',
superAdminOnly: true,
parent: 'manage',
no_scroll: true
}
},
{
path: '/config/manage/accounting',
component: () => import('../views/manage/accounting.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'اتصال حسابداری',
active: true
}
],
pageTitle: 'اتصال حسابداری',
rule: 'editor',
role: 'config.accounting',
parent: 'manage',
no_scroll: true
}
},
// MON-08 — the making-charge formula (owner ruling 2026-10-08).
{
path: '/config/manage/wage',
component: () => import('../views/manage/wage.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'اجرت',
active: true
}
],
pageTitle: 'اجرت',
rule: 'editor',
role: 'config.wage',
parent: 'manage',
no_scroll: true
}
},
{
path: '/config/manage/report',
component: () => import('../views/manage/report.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'گزارش',
active: true
}
],
pageTitle: 'گزارش',
rule: 'editor',
role: 'config.report',
parent: 'manage',
no_scroll: true
}
},
// Product
{
path: '/apps/product/',
redirect: '/apps/product/list',
name: 'product'
},
{
path: '/product/change/percent',
component: () => import('../views/apps/product/ChangePercent.vue'),
meta: {
rule: 'editor',
role: 'product.percent',
parent: 'product',
no_scroll: true
}
},
{
path: '/apps/product/add',
component: () => import('../views/apps/product/AddProduct.vue'),
meta: {
rule: 'editor',
role: 'product.create',
parent: 'product',
no_scroll: true
}
},
{
path: '/apps/product/edit/:id/:variant_id?',
name: 'product-edit',
component: () => import('../views/apps/product/EditProduct.vue'),
meta: {
rule: 'editor',
role: 'product.list.edit',
parent: 'product',
no_scroll: true
}
},
{
path: '/apps/product/list',
name: 'product-list',
component: () => import('../views/apps/product/ProductList.vue'),
meta: {
rule: 'editor',
role: 'product.list',
parent: 'product',
no_scroll: true
}
},
// Category
{
path: '/category',
redirect: '/category/list',
name: 'category'
},
{
path: '/category/add/:id?',
name: 'category-add',
component: () => import('../views/apps/category/Add.vue'),
meta: {
rule: 'editor',
role: 'collection.create',
parent: 'category',
no_scroll: true
}
},
{
path: '/category/edit/:id',
component: () => import('../views/apps/category/Edit.vue'),
name: 'category-edit',
meta: {
rule: 'editor',
role: 'collection.list.edit',
parent: 'category',
no_scroll: true
}
},
{
path: '/category/list',
name: 'category-list',
component: () => import('../views/apps/category/List.vue'),
meta: {
rule: 'editor',
role: 'collection.list',
parent: 'category',
no_scroll: true
}
},
//finical
{
path: '/add/findoc',
component: () => import('../views/finical/addFinDoc.vue'),
meta: {
rule: 'editor',
role: 'document.create'
//no_scroll: true
}
},
{
path: '/edit/findoc/:id',
component: () => import('../views/finical/addFinDoc.vue'),
meta: {
rule: 'editor',
role: 'document.list.edit'
//no_scroll: true
}
},
// Order
{
path: '/order',
redirect: '/order/list',
name: 'order'
},
{
path: '/order/list',
component: () => import('../views/order/List.vue'),
meta: {
rule: 'editor',
role: 'order.list',
superAdminOnly: true,
parent: 'order',
no_scroll: true
}
},
{
path: '/order/omde-list',
component: () => import('../views/order/OmdeList.vue'),
meta: {
rule: 'editor',
role: 'order.omde',
parent: 'order',
no_scroll: true
}
},
{
path: '/order/make',
component: () => import('../views/order/MakeOrder.vue'),
meta: {
rule: 'editor',
role: 'order.makeOrder',
parent: 'order',
no_scroll: true
}
},
{
path: '/order/create',
component: () => import('../views/order/create.vue'),
meta: {
rule: 'editor',
role: 'order.create',
superAdminOnly: true,
parent: 'order',
no_scroll: true
}
},
{
path: '/order/tamin-list',
component: () => import('../views/order/TaminList.vue'),
meta: {
rule: 'editor',
role: 'order.tamin',
parent: 'order',
no_scroll: true
}
},
{
path: '/major/promotion/list',
component: () => import('../views/promotion/promotion_list.vue'),
meta: {
rule: 'editor',
role: 'offers.list',
//parent: 'order',
no_scroll: true
}
},
{
path: '/major/promotion/add',
component: () => import('../views/promotion/promotion_add_edit.vue'),
meta: {
rule: 'editor',
role: 'offers.create',
//parent: 'order',
no_scroll: true
}
},
{
path: '/major/promotion/edit/:id',
component: () => import('../views/promotion/promotion_add_edit.vue'),
meta: {
rule: 'editor',
role: 'offers.list.edit',
//parent: 'order',
no_scroll: true
}
},
{
path: '/major/promotion/tak/add',
component: () => import('../views/promotion/promotion_tak_add_edit.vue'),
meta: {
rule: 'editor',
role: 'offers.create.tak',
superAdminOnly: true,
//parent: 'order',
no_scroll: true
}
},
{
path: '/major/promotion/tak/edit/:id',
component: () => import('../views/promotion/promotion_tak_add_edit.vue'),
meta: {
rule: 'editor',
role: 'offers.list.tak.edit',
superAdminOnly: true,
//parent: 'order',
no_scroll: true
}
},
{
path: '/major/promotion/autopromotion',
component: () => import('../views/promotion/autopromotion.vue'),
meta: {
rule: 'editor',
role: 'offers.autopromotion',
no_scroll: true
}
},
// offersIgnore
{
path: '/major/offersIgnore',
component: () => import('../views/offersIgnore/offersIgnore-add-edit.vue'),
meta: {
rule: 'editor',
role: 'offersIgnore'
}
},
// offersIgnore
{
path: '/comments',
name: 'comments',
component: () => import('../views/customer/Comments/Comments.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'دیدگاه ها',
active: true
}
],
pageTitle: 'دیدگاه ها',
rule: 'editor',
role: 'comment',
// parent: 'comments',
no_scroll: true
}
},
{
path: '/sms/create',
name: 'create_sms',
component: () => import('../views/sms/create.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'ارسال پیامک',
active: true
}
],
pageTitle: 'ارسال پیامک',
rule: 'editor',
role: 'sms.create',
no_scroll: true
}
},
{
path: '/notify',
name: 'notify',
component: () => import('../views/notify/user.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'لیست نوتیفیکیشن های دریافتی',
active: true
}
],
pageTitle: 'لیست نوتیفیکیشن های ذریافتی',
rule: 'editor',
role: 'notify.me',
no_scroll: true
}
},
{
path: '/notify/create',
name: 'create_notify',
component: () => import('../views/notify/create.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'ارسال نوتیفیکیشن',
active: true
}
],
pageTitle: 'ارسال نوتیفیکیشن',
rule: 'editor',
role: 'notify.create',
no_scroll: true
}
},
{
path: '/wallet',
name: 'wallet',
component: () => import('../views/wallet/wallet.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'لیست کیف پول های شارژ شده',
active: true
}
],
pageTitle: 'لیست کیف پول های شارژ شده',
rule: 'editor',
role: 'wallet',
no_scroll: true
}
},
{
path: '/reagent/edit/:id',
name: 'reagent-edit',
component: () => import('../views/apps/customer/EditReagent.vue'),
meta: {
rule: 'editor',
role: 'persons.list.sellers.edit',
parent: 'product',
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',
component: () => import('../views/apps/customer/EditBulkCustomer.vue'),
meta: {
rule: 'editor',
role: 'persons.list.client.omde.edit',
parent: 'product',
no_scroll: true
}
},
{
path: '/bulkCustomer/view/:id',
name: 'bulkCustomer-view',
component: () => import('../views/customer/omde/ViewOmdeCustomer.vue'),
meta: {
rule: 'editor',
role: 'persons.list.client.omde.view',
parent: 'product',
no_scroll: true
}
},
{
path: '/singleCustomer/edit/:id',
name: 'singleCustomer-edit',
component: () => import('../views/apps/customer/EditSingleCustomer.vue'),
meta: {
rule: 'editor',
role: 'persons.list.client.single.edit',
superAdminOnly: true,
parent: 'product',
no_scroll: true
}
},
{
path: '/singleCustomer/view/:id',
name: 'singleCustomer-view',
component: () => import('../views/customer/single-customer/ViewSingleCustomer.vue'),
meta: {
rule: 'editor',
role: 'persons.list.client.single.view',
superAdminOnly: true,
parent: 'product',
no_scroll: true
}
},
{
path: '/customer/omde-list',
name: 'omde-list-customer',
component: () => import('../views/customer/omde/OmdeList.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'مشتریان عمده',
active: true
}
],
pageTitle: 'مشتریان عمده',
rule: 'editor',
role: 'persons.list.client.omde'
}
},
{
path: '/customer/omde-non-verified-list',
name: 'omde-non-verified-list',
component: () => import('../views/customer/omde/OmdeNonVerifiedList.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'مشتریان در انتظار',
active: true
}
],
pageTitle: 'مشتریان در انتظار',
rule: 'editor',
role: 'persons.list.client.omde'
}
},
{
path: '/customer/banker-list',
name: 'banker-list',
component: () => import('../views/customer/omde/BankerList.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'لیست بنکداران',
active: true
}
],
pageTitle: 'لیست بنکداران',
rule: 'editor',
role: 'persons.list.client.omde',
superAdminOnly: true
}
},
{
path: '/customer/shopkeeper-list',
name: 'shopkeeper-list',
component: () => import('../views/customer/omde/ShopkeeperList.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'لیست مغازه داران حضوری',
active: true
}
],
pageTitle: 'لیست مغازه داران حضوری',
rule: 'editor',
role: 'persons.list.client.omde',
superAdminOnly: true
}
},
{
path: '/customer/omde-archived-list',
name: 'omde-archived-list',
component: () => import('../views/customer/omde/OmdeArchivedList.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'مشتریان بایگانی',
active: true
}
],
pageTitle: 'مشتریان بایگانی',
rule: 'editor',
role: 'persons.list.client.omde'
}
},
{
path: '/customer/reagent-list',
name: 'raegentList',
component: () => import('../views/customer/reagentList/ReagentList.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'کارشناسان فروش',
active: true
}
],
pageTitle: 'کارشناسان فروش',
role: 'persons.list.sellers',
rule: 'editor'
}
},
{
path: '/customer/add',
name: 'add-customer',
component: () => import('../views/apps/customer/AddCustomer.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'مشتریان'},
{
title: 'افزودن مشتری',
active: true
}
],
pageTitle: 'افزودن مشتری',
role: 'persons.create',
rule: 'editor'
}
},
{
path: '/customer/list',
name: 'list-customer',
component: () => import('../views/customer/single-customer/SingleCustomer.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'مشتریان'}
],
pageTitle: 'لیست مشتریان',
role: 'persons.list.client.single',
superAdminOnly: true,
rule: 'editor'
}
},
{
path: '/report/order_item',
name: 'report_order_item',
component: () => import('../views/report/order_item.vue'),
meta: {
/* breadcrumb: [
{title: 'خانه', url: '/'},
{title: 'مشتریان'}
],*/
//pageTitle: 'لیست مشتریان',
role: 'report.order.item',
rule: 'editor'
}
},
{
path: '/report/product',
name: 'report_product',
component: () => import('../views/report/product.vue'),
meta: {
role: 'report.product',
rule: 'editor'
}
},
{
path: '/finical/list',
name: 'finical_list',
component: () => import('../views/finical/list.vue'),
meta: {
/* breadcrumb: [
{title: 'خانه', url: '/'},
{title: 'مشتریان'}
],*/
//pageTitle: 'لیست مشتریان',
role: 'document.list',
rule: 'editor'
}
},
// user
{
path: '/user/list',
component: () => import('../views/user/ListUser.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'لیست مدیران',
active: true
}
],
pageTitle: 'لیست مدیران',
role: 'user.list',
rule: 'editor',
parent: 'user',
no_scroll: true
}
},
{
path: '/user/create',
component: () => import('../views/user/UserCreate.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'افزودن کاربر',
active: true
}
],
pageTitle: 'افزودن کاربر',
role: 'user.create',
rule: 'editor',
parent: 'user',
no_scroll: true
}
},
{
path: '/user/edit/:id',
component: () => import('../views/user/UserEdit.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'ویرایش نوع کاربر',
active: true
}
],
pageTitle: 'ویرایش نوع کاربر',
rule: 'editor',
role: 'user.list.edit',
parent: 'user',
no_scroll: true
}
},
// permission
{
path: '/permission',
component: () => import('../views/user/Permission.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'دسترسی ها',
active: true
}
],
pageTitle: 'دسترسی ها',
rule: 'editor',
role: 'user.permission',
parent: 'permission',
no_scroll: true
}
},
{
path: '/city/create',
component: () => import('../views/city/createCity.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'افزودن شهر',
active: true
}
],
pageTitle: 'افزودن شهر',
rule: 'editor',
role: 'cities.create',
parent: 'city',
no_scroll: true
}
},
{
path: '/city/list',
component: () => import('../views/city/cityList.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'لیست شهر ها',
active: true
}
],
pageTitle: 'لیست شهر ها',
rule: 'editor',
role: 'cities.list',
parent: 'city',
no_scroll: true
}
},
{
path: '/statics',
name: 'statics',
component: () => import('../views/statics/index.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'آمار',
active: true
}
],
pageTitle: 'آمار',
rule: 'editor',
role: 'statics',
no_scroll: true
}
},
{
path: '/newsletters',
name: 'newsletters',
component: () => import('../views/newsletters/newsletters.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{
title: 'خبرنامه',
active: true
}
],
pageTitle: 'خبرنامه',
rule: 'editor',
// role: 'newsletters',
no_scroll: true
}
},
{
path: '/branch/add',
name: 'add-branch',
component: () => import('../views/branch/AddBranches.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'شعب'},
{
title: 'افزودن شعب',
active: true
}
],
pageTitle: 'افزودن شعب',
role: 'branch.create',
superAdminOnly: true,
rule: 'editor'
}
},
{
path: '/branch/edit/:id',
name: 'edit-branch',
component: () => import('../views/branch/EditBranches.vue'),
meta: {
pageTitle: 'ویرایش شعب',
role: 'branch.create',
superAdminOnly: true,
rule: 'editor'
}
},
{
path: '/branch/list',
name: 'list-branch',
component: () => import('../views/branch/ListBranches.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'شعب'},
{
title: 'لیست شعب',
active: true
}
],
pageTitle: 'لیست شعب',
role: 'branch.list',
superAdminOnly: true,
rule: 'editor'
}
},
////////////////////////////////////////////////////////////////////////
{
path: '/workshop/add',
name: 'add-workshop',
component: () => import('../views/workshop/AddWorkshop.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'کارگاه'},
{
title: 'افزودن کارگاه',
active: true
}
],
pageTitle: 'افزودن کارگاه',
role: 'workshop.create',
superAdminOnly: true,
rule: 'editor'
}
},
{
path: '/workshop/edit/:id',
name: 'edit-workshop',
component: () => import('../views/workshop/EditWorkshop.vue'),
meta: {
pageTitle: 'ویرایش کارگاه',
role: 'workshop.create',
superAdminOnly: true,
rule: 'editor'
}
},
{
path: '/workshop/list',
name: 'list-workshop',
component: () => import('../views/workshop/ListWorkshop.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'کارگاه'},
{
title: 'لیست کارگاه ها',
active: true
}
],
pageTitle: 'لیست کارگاه ها',
role: 'workshop.list',
superAdminOnly: true,
rule: 'editor'
}
},
////////////////////////////////////////////////////////////////////////
{
path: '/invoice/add',
name: 'add-invoice',
component: () => import('../views/invoice/AddInvoice.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'فاکتور انتقال'},
{
title: 'افزودن فاکتور',
active: true
}
],
pageTitle: 'افزودن فاکتور',
role: 'invoice.create',
rule: 'editor'
}
},
{
path: '/invoice/edit/:id',
name: 'edit-invoice',
component: () => import('../views/invoice/EditInvoice.vue'),
meta: {
pageTitle: 'ویرایش فاکتورها',
role: 'invoice.create',
rule: 'editor'
}
},
{
path: '/invoice/list',
name: 'list-invoice',
component: () => import('../views/invoice/ListInvoice.vue'),
meta: {
breadcrumb: [
{
title: 'خانه',
url: '/'
},
{title: 'فاکتورانتقال'},
{
title: 'لیست فاکتورها',
active: true
}
],
pageTitle: 'لیست فاکتورها',
role: 'invoice.list',
rule: 'editor'
}
}
]
export const fullPageAdminRoute: RouteRecordRaw[] = [
{
path: '/auth/login',
name: 'page-login',
component: () => import('../views/auth/Login.vue'),
meta: {
rule: 'editor'
}
},
{
path: '/reg',
name: 'reg',
component: () => import('../views/reg.vue'),
meta: {
rule: 'editor'
}
}
]