export type MenuNode = { name: string; code: string; path: string; icon?: string; children?: MenuNode[]; }; /** 人事业务在「组织人事」;组织/班次/参数进「系统设置 · 人事设置」。 */ export const MENUS: MenuNode[] = [ { name: '工作台', code: 'office:overview', path: '/workbench', icon: 'HomeOutlined', }, { name: '个人办公', code: 'office', path: '/office/todos', icon: 'AppstoreOutlined', children: [ { name: '待办事项', code: 'office:todos', path: '/office/todos' }, { name: '待我审批', code: 'office:approvals', path: '/office/approvals' }, { name: '我的申请', code: 'office:flow', path: '/office/flow' }, { name: '我的日程', code: 'office:calendar', path: '/office/calendar' }, { name: '工作汇报', code: 'office:reports', path: '/office/reports' }, { name: '我的费用', code: 'office:expenses', path: '/office/expenses' }, { name: '人事申请', code: 'office:hr-apply', path: '/office/hr-apply' }, { name: '用章申请', code: 'office:seal-apply', path: '/office/seal-apply' }, { name: '办公申请', code: 'office:apply', path: '/office/apply' }, { name: '公司公告', code: 'office:notices', path: '/office/notices' }, { name: '发送短信', code: 'office:sms', path: '/office/sms' }, { name: '工作安排', code: 'office:assign', path: '/office/assign' }, { name: '消息', code: 'office:im', path: '/office/im' }, { name: '员工通讯', code: 'office:directory', path: '/office/directory' }, ], }, { name: '往来单位', code: 'party', path: '/party/tenders', icon: 'ClusterOutlined', children: [ { name: '招标单位', code: 'party:tenders', path: '/party/tenders' }, { name: '参与主体', code: 'party:entities', path: '/party/entities' }, { name: '联系名录', code: 'party:contacts', path: '/party/contacts' }, ], }, { name: '证照用章', code: 'seal', path: '/seal/qualifications', icon: 'SafetyCertificateOutlined', children: [ { name: '资质台账', code: 'seal:qualifications', path: '/seal/qualifications' }, { name: '证照借用', code: 'seal:borrows', path: '/seal/borrows' }, { name: '用章登记', code: 'seal:requests', path: '/seal/requests' }, { name: '印章台账', code: 'seal:registry', path: '/seal/registry' }, ], }, { name: '投标管理', code: 'bid', path: '/bid/screening', icon: 'AuditOutlined', children: [ { name: '项目筛选', code: 'bid:screening', path: '/bid/screening' }, { name: '特殊筛选', code: 'bid:special-screening', path: '/bid/special-screening' }, { name: '标书制作', code: 'bid:drafting', path: '/bid/drafting' }, { name: '特殊制标', code: 'bid:special-drafting', path: '/bid/special-drafting' }, { name: '投标执行', code: 'bid:execution', path: '/bid/execution' }, { name: '开标结果', code: 'bid:result', path: '/bid/result' }, { name: '终止投标', code: 'bid:terminated', path: '/bid/terminated' }, ], }, { name: '合同管理', code: 'contract', path: '/contract/tender', icon: 'FileProtectOutlined', children: [ { name: '投标合同', code: 'contract:approval', path: '/contract/tender' }, { name: '直签合同', code: 'contract:direct', path: '/contract/direct' }, { name: '其他合同', code: 'contract:list', path: '/contract/incremental' }, { name: '人事合同', code: 'contract:hr', path: '/contract/hr' }, ], }, { name: '资产管理', code: 'asset', path: '/asset/digital', icon: 'DatabaseOutlined', children: [ { name: '数字资产', code: 'asset:digital', path: '/asset/digital' }, { name: '固定资产', code: 'asset:fixed', path: '/asset/fixed' }, ], }, { name: '项目管理', code: 'project', path: '/project/list', icon: 'ProjectOutlined', children: [ { name: '项目台账', code: 'project:list', path: '/project/list' }, { name: '任务分解', code: 'project:tasks', path: '/project/tasks' }, { name: '工时填报', code: 'project:timesheets', path: '/project/timesheets' }, { name: '资源看板', code: 'project:resources', path: '/project/resources' }, { name: '项目验收', code: 'project:acceptance', path: '/project/acceptance' }, { name: '采购申请', code: 'project:purchases', path: '/project/purchases' }, { name: '器材占用', code: 'project:assets', path: '/project/assets' }, ], }, { name: '财务收支', code: 'finance', path: '/finance/expenses', icon: 'AccountBookOutlined', children: [ { name: '费用报销', code: 'finance:expenses', path: '/finance/expenses' }, { name: '借支记录', code: 'finance:loans', path: '/finance/loans' }, { name: '资产购置台账', code: 'finance:asset-purchases', path: '/finance/asset-purchases' }, { name: '投标保证金', code: 'finance:tender-bonds', path: '/finance/bonds/tender' }, { name: '履约保证金', code: 'finance:perf-bonds', path: '/finance/bonds/performance' }, { name: '项目质保金', code: 'finance:warranty-bonds', path: '/finance/bonds/warranty' }, { name: '开票收款', code: 'finance:invoices', path: '/finance/invoices' }, { name: '付款执行', code: 'finance:payments', path: '/finance/payments' }, ], }, { name: '组织人事', code: 'hr', path: '/hr/employees', icon: 'TeamOutlined', children: [ { name: '在职员工', code: 'hr:employees', path: '/hr/employees' }, { name: '组织管理', code: 'hr:org', path: '/hr/org' }, { name: '入转调离', code: 'hr:lifecycle', path: '/hr/lifecycle' }, { name: '假勤结果', code: 'hr:attendance', path: '/hr/attendance' }, { name: '薪酬核算', code: 'hr:payroll', path: '/hr/payroll' }, { name: '绩效发放', code: 'hr:performance', path: '/hr/performance' }, { name: '发布公告', code: 'hr:notices', path: '/hr/notices' }, { name: '规章制度', code: 'hr:policies', path: '/hr/policies' }, ], }, { name: '经营报表', code: 'report', path: '/report/conversion', icon: 'BarChartOutlined', children: [ { name: '投标转化', code: 'report:conversion', path: '/report/conversion' }, { name: '落标对照', code: 'report:lost', path: '/report/lost' }, { name: '项目利润', code: 'report:profit', path: '/report/profit' }, { name: '部门人效', code: 'report:efficiency', path: '/report/efficiency' }, { name: '资金占用', code: 'report:cash', path: '/report/cash' }, ], }, { name: '系统设置', code: 'system', path: '/system/acl', icon: 'SettingOutlined', children: [ { name: '人事设置', code: 'system:hr', path: '/system/hr-params', children: [ { name: '员工账号', code: 'system:acl', path: '/system/acl' }, { name: '人事参数', code: 'system:hr-params', path: '/system/hr-params' }, { name: '考勤设置', code: 'system:attendance-rules', path: '/system/attendance-rules' }, ], }, { name: '数据字典', code: 'system:dicts', path: '/system/dicts' }, { name: '权限设置', code: 'system:perms', path: '/system/perms' }, { name: '编号规则', code: 'system:numbers', path: '/system/numbers' }, { name: '短信服务', code: 'system:sms', path: '/system/sms' }, { name: '消息通道', code: 'system:messages', path: '/system/messages' }, { name: '手机端升级', code: 'system:app-release', path: '/system/app-release' }, { name: '操作日志', code: 'system:logs', path: '/system/logs' }, ], }, ]; export function walkMenus(nodes: MenuNode[], visit: (node: MenuNode, parent: MenuNode | null, sortNo: number) => void, parent: MenuNode | null = null) { nodes.forEach((node, i) => { visit(node, parent, parent ? i + 1 : (i + 1) * 10); if (node.children?.length) walkMenus(node.children, visit, node); }); } export function isHrSettingCode(code: string) { return ( code === 'system:acl' || code === 'system:hr' || code.startsWith('system:hr') || code === 'system:org' || code === 'system:attendance-rules' ); }