feat: 添加审批历史页面,处于办公中心下

This commit is contained in:
2026-04-15 15:09:03 +08:00
parent f4dbe29d8e
commit 09f1adb63b
9 changed files with 105 additions and 50 deletions

View File

@@ -29,34 +29,29 @@ const permission = {
},
},
actions: {
// 生成路由
GenerateRoutes({ commit }) {
GenerateRoutes({ commit }) {
return new Promise(resolve => {
// 向后端请求路由数据
getRouters().then(res => {
// ================= 新增拦截代码:将页面注入到办公中心开始 =================
// 寻找后端传来的“办公中心”节点(根据路径或标题匹配)
const oaMenu = res.data.find(item => item.path === '/oa' || (item.meta && item.meta.title === '办公中心'));
if (oaMenu) {
if (!oaMenu.children) oaMenu.children = [];
// 防重判断,避免代码热更新时重复添加导致菜单重复
const hasHistory = oaMenu.children.some(child => child.path === 'flowHistory');
if (!hasHistory) {
oaMenu.children.push({
name: 'FlowHistory',
path: 'flowHistory', // 浏览器地址后缀,点击后地址变为 /oa/flowHistory
hidden: false, // 确保在左侧菜单显示
// 【特别注意】:这里对应的是你存放 vue 文件的真实相对路径
// 根据你最初的代码,我推测在 hrm/flow 文件夹下。
// 如果你的文件名叫 taskHistory.vue请把下面的 flowHistory 改成 taskHistory
component: 'hrm/flow/flowHistory',
name: 'HrmFlowHistory',
path: 'flowHistory',
hidden: false,
component: 'hrm/flow/taskHistory',
meta: {
title: '审批历史',
icon: 'date-range', // 菜单图标,支持 element 图标
icon: 'date-range',
noCache: false
}
});