diff --git a/frontend/components.d.ts b/frontend/components.d.ts index ac689f01..dead878e 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -48,6 +48,7 @@ declare module 'vue' { ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] + ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] ElOption: typeof import('element-plus/es')['ElOption'] ElOptionGroup: typeof import('element-plus/es')['ElOptionGroup'] ElPagination: typeof import('element-plus/es')['ElPagination'] diff --git a/frontend/src/config/decisionDomains.ts b/frontend/src/config/decisionDomains.ts new file mode 100644 index 00000000..fe82ca45 --- /dev/null +++ b/frontend/src/config/decisionDomains.ts @@ -0,0 +1,123 @@ +// ── 决策域菜单配置(L1 决策域 → L2 决策场景 → 页面)──────────────────────────── +// 依据:《管理会计应用指引》100–900 九域;财务BOT 派单 +// finance-20261018-cma-menu-domain-refactor-fullstack(任总 2026-10-18 21:22/21:25) +// +// 边界(重要): +// 1) 本文件只做**菜单分组**——不改路由 path、不改页面、不改 API、不改 DB; +// 2) 权限仍由 permission.ts 的 MENU_ITEMS.roles 过滤 + ROLE_ROUTES/hasRouteAccess 判定, +// zone A/B 只作权限维度,不作菜单维度; +// 3) 页面条目的文案/图标/roles 一律取自 permission.ts(MENU_ITEMS),本文件只写 path 关系; +// 4) 未在本文件登记的菜单项不会消失——MainLayout 兜底归入 900 域「未归类」; +// 5) 回退开关:localStorage.cma_menu_mode = 'pdca' 或 URL ?menu=pdca 即还原原 PDCA 五组。 + +export interface DecisionScene { + /** L2 决策场景文案(菜单内的小标题) */ + label: string + /** 指向已有页面的 path(与 MENU_ITEMS 对齐) */ + paths: string[] +} + +export interface DecisionDomain { + /** 域编号:100 战略 / 200 预算 / … / 900 系统 */ + id: string + /** L1 一级菜单文案 */ + label: string + /** 域图标(取自 MainLayout iconMap 的键名) */ + icon: string + scenes: DecisionScene[] +} + +/** 9 个决策域;场景只用已有页面做聚合,缺能力域(500/700)待第 3 步补页 */ +export const DECISION_DOMAINS: DecisionDomain[] = [ + { + id: '100', + label: '战略管理', + icon: 'DataBoard', + scenes: [ + { label: '战略地图与执行', paths: ['/maps', '/strategy-map', '/alignment'] }, + { label: '目标与复盘', paths: ['/maps-review', '/okr-templates'] }, + { label: '增长与产品组合', paths: ['/growth-quality', '/product-matrix'] }, + { label: '经营总览', paths: ['/dashboard'] }, + ], + }, + { + id: '200', + label: '预算管理', + icon: 'Money', + scenes: [ + { label: '保本与预测', paths: ['/budget', '/predict'] }, + { label: '预算差异', paths: ['/deviations'] }, + ], + }, + { + id: '300', + label: '成本管理', + icon: 'Coin', + scenes: [ + { label: '成本结构与降本', paths: ['/cost', '/cost-intelligence'] }, + { label: '费用与成本控制', paths: ['/expenses', '/mpm-calculator'] }, + ], + }, + { + id: '400', + label: '营运管理', + icon: 'Connection', + scenes: [ + { label: '回款与资金计划', paths: ['/cash-plan', '/receivables'] }, + { label: '客户与资金总览', paths: ['/customer', '/treasury-dashboard'] }, + { label: '改善行动', paths: ['/action-plans'] }, + ], + }, + { + id: '500', + label: '投融资管理', + icon: 'TrendCharts', + scenes: [ + { label: '投资决策', paths: ['/real-options'] }, + { label: '资金内控', paths: ['/treasury-payment'] }, + ], + }, + { + id: '600', + label: '绩效管理', + icon: 'DataLine', + scenes: [ + { label: 'KPI 执行', paths: ['/kpis', '/bot-kpis'] }, + { label: '学习与成长', paths: ['/learning-dashboard'] }, + ], + }, + { + id: '700', + label: '风险管理', + icon: 'WarningFilled', + scenes: [ + { label: '预警与置信度', paths: ['/alerts', '/analysis-confidence'] }, + { label: '税务合规', paths: ['/tax-compliance'] }, + ], + }, + { + id: '800', + label: '管理报告', + icon: 'Document', + scenes: [ + { label: '经营成果', paths: ['/reports', '/dupont-analysis'] }, + { label: '现金与结构', paths: ['/cashflow-structure'] }, + ], + }, + { + id: '900', + label: '信息系统', + icon: 'Setting', + scenes: [ + { label: '数据治理', paths: ['/data', '/data-quality', '/data-classification'] }, + { label: '组织与权限', paths: ['/org', '/users', '/permissions'] }, + { label: '平台配置', paths: ['/notifications', '/knowledge', '/ai-suggestions'] }, + ], + }, +] + +/** 常驻入口(不占域,置顶显示) */ +export const PINNED_PATHS: string[] = ['/my-dashboard'] + +/** 域菜单默认展开的域(只展开战略域;系统域默认折叠) */ +export const DOMAIN_DEFAULT_OPENED: string[] = ['domain-100'] diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index d251b116..af07dc24 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -5,19 +5,42 @@