| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- import type { Prisma, MenuType } from '@prisma/mysql/client';
- export interface SeedMenu {
- legacyId: number;
- legacyParentId: number | null;
- title: string; // Chinese display title
- type: MenuType; // DIRECTORY | MENU | SUBMENU | BUTTON
- name: string; // English, camelCase
- path: string; // English, /kebab-case/route
- icon: string | null; // Iconify / material-symbols / mdi
- order: number; // Sort order
- meta?: Prisma.JsonValue;
- }
- /**
- * Hybrid style:
- * - title: Chinese (for UI)
- * - name/path/icon: English & structured
- */
- export const MENU_SEEDS: SeedMenu[] = [
- // ======================
- // 营销中心 (Marketing)
- // ======================
- {
- legacyId: 1,
- legacyParentId: null,
- title: '营销中心',
- type: 'DIRECTORY',
- name: 'marketingRoot',
- path: '/marketing',
- icon: 'material-symbols-light:campaign',
- order: 100,
- meta: {
- title: '营销中心',
- i18n: 'route.marketing.root',
- icon: 'material-symbols-light:campaign',
- },
- },
- {
- legacyId: 2,
- legacyParentId: 1,
- title: '视频管理',
- type: 'MENU',
- name: 'marketingVideos',
- path: '/marketing/videos',
- icon: 'material-symbols-light:notifications-active-outline',
- order: 1,
- meta: {
- title: '视频管理',
- i18n: 'route.marketing.videos',
- icon: 'material-symbols-light:notifications-active-outline',
- },
- },
- {
- legacyId: 3,
- legacyParentId: 1,
- title: '分类管理',
- type: 'MENU',
- name: 'marketingCategories',
- path: '/marketing/categories',
- icon: 'material-symbols-light:ads-click-rounded',
- order: 2,
- meta: {
- title: '分类管理',
- i18n: 'route.marketing.categories',
- icon: 'material-symbols-light:ads-click-rounded',
- },
- },
- {
- legacyId: 4,
- legacyParentId: 1,
- title: '标签管理',
- type: 'MENU',
- name: 'marketingTags',
- path: '/marketing/tags',
- icon: 'material-symbols-light:label-outline',
- order: 3,
- meta: {
- title: '标签管理',
- i18n: 'route.marketing.tags',
- icon: 'material-symbols-light:label-outline',
- },
- },
- {
- legacyId: 5,
- legacyParentId: 1,
- title: '广告管理',
- type: 'MENU',
- name: 'marketingAds',
- path: '/marketing/ads',
- icon: 'material-symbols-light:group-outline',
- order: 4,
- meta: {
- title: '广告管理',
- i18n: 'route.marketing.ads',
- icon: 'material-symbols-light:group-outline',
- },
- },
- {
- legacyId: 6,
- legacyParentId: 1,
- title: '参数管理',
- type: 'MENU',
- name: 'marketingParams',
- path: '/marketing/params',
- icon: 'material-symbols-light:format-quote',
- order: 5,
- meta: {
- title: '参数管理',
- i18n: 'route.marketing.params',
- icon: 'material-symbols-light:format-quote',
- },
- },
- // ======================
- // 数据中心 (Data Center)
- // ======================
- {
- legacyId: 7,
- legacyParentId: null,
- title: '数据中心',
- type: 'DIRECTORY',
- name: 'dataCenterRoot',
- path: '/data',
- icon: 'material-symbols-light:monitoring',
- order: 200,
- meta: {
- title: '数据中心',
- i18n: 'route.data.root',
- icon: 'material-symbols-light:monitoring',
- },
- },
- {
- legacyId: 8,
- legacyParentId: 7,
- title: 'APP访问记录',
- type: 'MENU',
- name: 'dataAppAccessLogs',
- path: '/data/app-access-logs',
- icon: 'material-symbols-light:smartphone',
- order: 1,
- meta: {
- title: 'APP访问记录',
- i18n: 'route.data.appAccessLogs',
- icon: 'material-symbols-light:smartphone',
- },
- },
- {
- legacyId: 9,
- legacyParentId: 7,
- title: '广告点击记录',
- type: 'MENU',
- name: 'dataAdsClickLogs',
- path: '/data/ads-click-logs',
- icon: 'mdi:bank-transfer',
- order: 2,
- meta: {
- title: '广告点击记录',
- i18n: 'route.data.adsClickLogs',
- icon: 'mdi:bank-transfer',
- },
- },
- // ======================
- // 统计中心 (Stats Center)
- // ======================
- {
- legacyId: 10,
- legacyParentId: null,
- title: '统计中心',
- type: 'DIRECTORY',
- name: 'statsCenterRoot',
- path: '/stats',
- icon: 'material-symbols-light:query-stats',
- order: 300,
- meta: {
- title: '统计中心',
- i18n: 'route.stats.root',
- icon: 'material-symbols-light:query-stats',
- },
- },
- {
- legacyId: 11,
- legacyParentId: 10,
- title: '每日统计',
- type: 'MENU',
- name: 'statsDaily',
- path: '/stats/daily',
- icon: 'material-symbols-light:today',
- order: 1,
- meta: {
- title: '每日统计',
- i18n: 'route.stats.daily',
- icon: 'material-symbols-light:today',
- },
- },
- {
- legacyId: 12,
- legacyParentId: 10,
- title: '广告统计',
- type: 'MENU',
- name: 'statsAds',
- path: '/stats/ads',
- icon: 'material-symbols-light:insights',
- order: 2,
- meta: {
- title: '广告统计',
- i18n: 'route.stats.ads',
- icon: 'material-symbols-light:insights',
- },
- },
- {
- legacyId: 13,
- legacyParentId: 10,
- title: '广告汇总',
- type: 'MENU',
- name: 'statsAdsSummary',
- path: '/stats/ads-summary',
- icon: 'material-symbols-light:stacked-line-chart',
- order: 3,
- meta: {
- title: '广告汇总',
- i18n: 'route.stats.adsSummary',
- icon: 'material-symbols-light:stacked-line-chart',
- },
- },
- {
- legacyId: 14,
- legacyParentId: 10,
- title: '网站统计',
- type: 'MENU',
- name: 'statsSite',
- path: '/stats/site',
- icon: 'material-symbols-light:language',
- order: 4,
- meta: {
- title: '网站统计',
- i18n: 'route.stats.site',
- icon: 'material-symbols-light:language',
- },
- },
- // ======================
- // 账号管理 (Account)
- // ======================
- {
- legacyId: 15,
- legacyParentId: null,
- title: '系统管理',
- type: 'DIRECTORY',
- name: 'systemRoot',
- path: '/system',
- icon: 'ic:round-manage-accounts',
- order: 400,
- meta: {
- title: '系统管理',
- i18n: 'route.system.root',
- icon: 'ic:round-manage-accounts',
- },
- },
- {
- legacyId: 16,
- legacyParentId: 15,
- title: '系统用户',
- type: 'MENU',
- name: 'systemUsers',
- path: '/system/users',
- icon: 'mdi:account-multiple-outline',
- order: 1,
- meta: {
- title: '系统用户',
- i18n: 'route.system.users',
- icon: 'mdi:account-multiple-outline',
- },
- },
- {
- legacyId: 17,
- legacyParentId: 15,
- title: '角色列表',
- type: 'MENU',
- name: 'systemRoles',
- path: '/system/roles',
- icon: 'mdi:account-tie-hat',
- order: 20,
- meta: {
- title: '角色列表',
- i18n: 'route.system.roles',
- icon: 'mdi:account-tie-hat',
- },
- },
- {
- legacyId: 18,
- legacyParentId: 15,
- title: '菜单管理',
- type: 'MENU',
- name: 'systemMenus',
- path: '/system/menus',
- icon: 'mdi:menu-open',
- order: 30,
- meta: {
- title: '菜单管理',
- i18n: 'route.system.menus',
- icon: 'mdi:menu-open',
- },
- },
- {
- legacyId: 19,
- legacyParentId: 15,
- title: '操作日志',
- type: 'MENU',
- name: 'systemOperationLogs',
- path: '/system/operation-logs',
- icon: 'mdi:history',
- order: 40,
- meta: {
- title: '操作日志',
- i18n: 'route.system.operationLogs',
- icon: 'mdi:history',
- },
- },
- // ======================
- // SUBMENUs under Roles
- // ======================
- {
- legacyId: 20,
- legacyParentId: 17,
- title: '角色列表',
- type: 'SUBMENU',
- name: 'systemRoleList',
- path: '/system/roles/list',
- icon: 'mdi:account-tie-hat',
- order: 1,
- meta: {
- title: '角色列表',
- i18n: 'route.system.role.list',
- sidebar: false,
- breadcrumb: false,
- cache: ['systemRoleCreate', 'systemRoleEdit'],
- },
- },
- {
- legacyId: 21,
- legacyParentId: 17,
- title: '新增角色',
- type: 'SUBMENU',
- name: 'systemRoleCreate',
- path: '/system/roles/create',
- icon: 'material-symbols-light:add-circle-outline',
- order: 2,
- meta: {
- title: '新增角色',
- i18n: 'route.system.role.create',
- sidebar: false,
- cache: true,
- activeMenu: '/system/roles',
- noCache: 'systemRoleList',
- },
- },
- {
- legacyId: 22,
- legacyParentId: 17,
- title: '编辑角色',
- type: 'SUBMENU',
- name: 'systemRoleEdit',
- path: '/system/roles/:id/edit',
- icon: 'material-symbols-light:edit',
- order: 3,
- meta: {
- title: '编辑角色',
- i18n: 'route.system.role.edit',
- sidebar: false,
- cache: true,
- activeMenu: '/system/roles',
- noCache: 'systemRoleList',
- },
- },
- // ======================
- // SUBMENUs under Menus
- // ======================
- {
- legacyId: 23,
- legacyParentId: 18,
- title: '菜单列表',
- type: 'SUBMENU',
- name: 'systemMenuList',
- path: '/system/menus/list',
- icon: 'mdi:menu-open',
- order: 1,
- meta: {
- title: '菜单列表',
- i18n: 'route.system.menu.list',
- sidebar: false,
- breadcrumb: false,
- cache: ['systemMenuCreate', 'systemMenuEdit'],
- },
- },
- {
- legacyId: 24,
- legacyParentId: 18,
- title: '新增菜单',
- type: 'SUBMENU',
- name: 'systemMenuCreate',
- path: '/system/menus/create',
- icon: 'material-symbols-light:add-circle-outline',
- order: 2,
- meta: {
- title: '新增菜单',
- i18n: 'route.system.menu.create',
- sidebar: false,
- cache: true,
- activeMenu: '/system/menus',
- noCache: 'systemMenuList',
- },
- },
- {
- legacyId: 25,
- legacyParentId: 18,
- title: '编辑菜单',
- type: 'SUBMENU',
- name: 'systemMenuEdit',
- path: '/system/menus/:id/edit',
- icon: 'material-symbols-light:edit',
- order: 3,
- meta: {
- title: '编辑菜单',
- i18n: 'route.system.menu.edit',
- sidebar: false,
- cache: true,
- activeMenu: '/system/menus',
- noCache: 'systemMenuList',
- },
- },
- ];
|