Files
boursecu_admin/src/router/routes/setting.ts
T

198 lines
5.8 KiB
TypeScript
Raw Normal View History

2026-01-24 17:45:54 +03:30
import type { RouteRecordRaw } from 'vue-router'
2026-06-21 20:27:13 +03:30
import { isDeployAdmin } from '@/utils/deployAdmin'
2026-07-04 14:21:27 +03:30
import { hasSmsPanelAccess } from '@/utils/smsPanelAccess'
2026-06-21 20:27:13 +03:30
import { useUserStore } from '@/store/userStore'
2026-07-23 22:24:26 +03:30
import { bannerEnabledSetting, trackingSystemsEnabledSetting, appNotificationEnabledSetting } from '@/utils/config'
2026-06-21 20:27:13 +03:30
2026-01-24 17:45:54 +03:30
const Setting: RouteRecordRaw = {
name: 'settings',
path: '/settings',
component: () => import('@core/layouts/BasicLayout.vue'),
redirect: { name: 'settingMain' },
meta: {
icon: 'vuesax-linear:setting',
permissionsKey: 'config',
title: 'پیکربندی',
disabled: false,
hideMenu: false,
hideChildren: true,
2026-07-13 13:32:08 +03:30
order: 7
2026-01-24 17:45:54 +03:30
},
children: [
{
name: 'settingMain',
path: '',
component: () => import('@/pages/menuPages/setting/index.vue'),
2026-05-02 13:53:43 +03:30
redirect: { name: 'configuration' },
2026-01-24 17:45:54 +03:30
meta: {
permissionsKey: 'config',
icon: 'vuesax-linear:setting',
order: 5,
title: 'پیکربندی',
disabled: false,
hideMenu: true
},
children: [
2026-06-21 20:27:13 +03:30
{
name: 'configuration',
path: 'configuration',
component: () => import('@/pages/menuPages/configuration/index.vue'),
meta: {
icon: 'vuesax-linear:setting-2',
title: 'تنظیمات',
order: 1
}
},
2026-07-12 17:51:48 +02:00
{
name: 'captureSitesMain',
path: 'capture-sites',
component: () => import('@/pages/menuPages/captureSites/index.vue'),
meta: {
permissionsKey: 'pricing',
icon: 'vuesax-linear:global',
title: 'سایت‌های ری‌گیری',
2026-07-13 13:32:08 +03:30
order: 2
},
beforeEnter() {
if (!trackingSystemsEnabledSetting.value) {
return { name: 'configuration' }
}
2026-07-12 17:51:48 +02:00
}
},
2026-06-21 20:27:13 +03:30
{
name: 'advancedConfiguration',
path: 'advanced-configuration',
component: () => import('@/pages/menuPages/configuration/index.vue'),
props: { mode: 'system' },
meta: {
deployAdminOnly: true,
icon: 'vuesax-linear:code-circle',
title: 'تنظیمات پیشرفته',
2026-07-01 22:28:09 +03:30
order: 3
2026-06-21 20:27:13 +03:30
},
beforeEnter() {
const userStore = useUserStore()
if (!isDeployAdmin(userStore.userInfo?.mobile)) {
return { name: 'configuration' }
}
}
},
2026-07-04 14:21:27 +03:30
{
name: 'smsPanelMain',
path: 'sms-panel',
component: () => import('@/pages/menuPages/smsPanel/index.vue'),
meta: {
icon: 'vuesax-linear:wallet-3',
title: 'پنل پیامک',
order: 3.5,
requiresSmsPanelAccess: true
},
beforeEnter() {
const userStore = useUserStore()
if (!hasSmsPanelAccess(userStore.userInfo)) {
return { name: 'configuration' }
}
}
},
2026-06-21 20:27:13 +03:30
{
name: 'banners',
path: 'banners',
component: () => import('@/pages/menuPages/banners/index.vue'),
meta: {
icon: 'vuesax-linear:image',
title: 'بنرها',
2026-07-01 22:28:09 +03:30
order: 4
2026-06-25 00:13:03 +03:30
},
beforeEnter() {
if (!bannerEnabledSetting.value) {
return { name: 'configuration' }
2026-07-23 22:24:26 +03:30
}
}
},
{
name: 'appNotifications',
path: 'app-notifications',
component: () => import('@/pages/menuPages/appNotifications/index.vue'),
meta: {
icon: 'vuesax-linear:notification-bing',
title: 'اعلان‌ها',
order: 4.5
},
beforeEnter() {
if (!appNotificationEnabledSetting.value) {
return { name: 'configuration' }
2026-06-25 00:13:03 +03:30
}
2026-06-21 20:27:13 +03:30
}
},
2026-06-13 12:23:07 +03:30
{
name: 'smsMain',
path: 'sms',
component: () => import('@/pages/menuPages/sms/index.vue'),
meta: {
permissionsKey: 'sms',
icon: 'vuesax-linear:sms',
2026-06-21 20:27:13 +03:30
title: 'پیامک‌ها',
2026-07-13 13:32:08 +03:30
order: 5
2026-06-13 12:23:07 +03:30
}
},
{
name: 'giftCardMain',
path: 'giftCard',
component: () => import('@/pages/menuPages/giftCards/index.vue'),
meta: {
permissionsKey: 'project',
icon: 'vuesax-linear:gift',
title: 'کارت هدیه',
2026-06-21 20:27:13 +03:30
hideMenu: true,
2026-07-13 13:32:08 +03:30
order: 6
2026-06-13 12:23:07 +03:30
}
},
2026-02-19 17:55:23 +03:30
{
name: 'discounts',
path: 'discounts',
component: () => import('@/pages/menuPages/discount/index.vue'),
meta: {
permissionsKey: 'discounts',
2026-02-21 20:24:59 +03:30
icon: 'vuesax-linear:discount-shape',
2026-02-19 17:55:23 +03:30
title: 'تخفیفات',
2026-06-21 20:27:13 +03:30
hideMenu: true,
2026-07-13 13:32:08 +03:30
order: 7
2026-02-19 17:55:23 +03:30
}
},
2026-02-12 11:10:19 +03:30
{
2026-06-21 20:27:13 +03:30
name: 'usersMain',
path: 'admins',
component: () => import('@/pages/menuPages/users/index.vue'),
2026-02-12 11:10:19 +03:30
meta: {
2026-06-21 20:27:13 +03:30
permissionsKey: 'user',
icon: 'vuesax-linear:profile',
title: 'مدیران',
2026-07-13 13:32:08 +03:30
order: 8
2026-02-12 11:10:19 +03:30
}
2026-06-23 22:31:07 +03:30
},
2026-07-13 13:32:08 +03:30
/** ریدایرکت آدرس قدیمی — به حساب کتاب منتقل شد */
2026-06-23 22:31:07 +03:30
{
2026-07-13 13:32:08 +03:30
name: 'settingsPricingRedirect',
path: 'pricing',
redirect: { name: 'pricingMain' },
meta: { hideMenu: true }
},
{
name: 'settingsPriceTriggersRedirect',
path: 'priceTriggers',
redirect: { name: 'priceTriggers' },
meta: { hideMenu: true }
},
{
name: 'settingsAccountingRedirect',
2026-06-23 22:31:07 +03:30
path: 'accounting',
2026-07-13 13:32:08 +03:30
redirect: { name: 'accountingMain' },
meta: { hideMenu: true }
2026-06-21 20:27:13 +03:30
}
2026-01-24 17:45:54 +03:30
]
}
]
}
export default Setting