缓存(默认 false)
- title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
- icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
- breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
- activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
- }
- */
-
// 公共路由
export const constantRoutes = [
{
@@ -73,12 +51,10 @@ export const constantRoutes = [
name: "Index",
meta: { title: "工作台", icon: "dashboard", affix: true },
beforeEnter: (to, from, next) => {
- // 从本地存储获取角色信息
currentRole().then((res) => {
- console.log(res)
const role = res.data[0].roleKey;
if (role === "temp") {
- next("/temp"); // 重定向到临时页面
+ next("/temp");
} else {
next();
}
@@ -91,16 +67,15 @@ export const constantRoutes = [
path: "/temp",
component: () => import("@/views/temp"),
name: "Temp",
- hidden: true, // 隐藏路由
+ hidden: true,
meta: { title: "临时页面", icon: "dashboard" },
beforeEnter: (to, from, next) => {
- // 从本地存储获取角色信息
currentRole().then((res) => {
const role = res.data[0].roleKey;
if (role === "temp") {
next();
} else {
- next("/index"); // 重定向到工作台
+ next("/index");
}
});
},
@@ -144,14 +119,12 @@ export const constantRoutes = [
name: "updateOnboarding",
meta: { title: "更新入职数据", activeMenu: "/people/onboarding" },
},
-
{
path: "addOffboarding",
component: () => import("@/views/oa/offboarding/add"),
name: "addOffboarding",
meta: { title: "新增离职申请", activeMenu: "/people/offboarding" },
},
-
{
path: "updateOffboarding/:offboardingId(\\d+)",
component: () => import("@/views/oa/offboarding/update"),
@@ -174,7 +147,6 @@ export const constantRoutes = [
},
],
},
-
{
path: "/money",
component: Layout,
@@ -188,7 +160,6 @@ export const constantRoutes = [
},
],
},
-
{
path: "/claim",
component: Layout,
@@ -210,7 +181,6 @@ export const constantRoutes = [
},
];
-// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [
{
path: "/system/user-auth",
@@ -240,7 +210,6 @@ export const dynamicRoutes = [
},
],
},
-
{
path: "/system/dict-data",
component: Layout,
@@ -255,7 +224,6 @@ export const dynamicRoutes = [
},
],
},
-
{
path: "/oa/warehouse-data",
component: Layout,
@@ -348,23 +316,20 @@ export const dynamicRoutes = [
},
];
-// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
let routerReplace = Router.prototype.replace;
-// push
-Router.prototype.push = function push (location) {
+Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch((err) => err);
};
-// replace
-Router.prototype.replace = function push (location) {
+Router.prototype.replace = function replace(location) {
return routerReplace.call(this, location).catch((err) => err);
};
const router = new Router({
base: process.env.VUE_APP_CONTEXT_PATH,
- mode: "history", // 去掉url中的#
+ mode: "history",
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes,
});
-export default router;
+export default router;
\ No newline at end of file
diff --git a/ruoyi-ui/src/store/modules/permission.js b/ruoyi-ui/src/store/modules/permission.js
index 2287665..45f3259 100644
--- a/ruoyi-ui/src/store/modules/permission.js
+++ b/ruoyi-ui/src/store/modules/permission.js
@@ -34,6 +34,36 @@ const permission = {
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',
+ meta: {
+ title: '审批历史',
+ icon: 'date-range', // 菜单图标,支持 element 图标
+ noCache: false
+ }
+ });
+ }
+ }
+ // ================= 新增拦截代码:将页面注入到办公中心结束 =================
+
const sdata = JSON.parse(JSON.stringify(res.data))
const rdata = JSON.parse(JSON.stringify(res.data))
const sidebarRoutes = filterAsyncRouter(sdata)
@@ -130,4 +160,4 @@ export const loadView = (view) => {
}
}
-export default permission
+export default permission
\ No newline at end of file
diff --git a/ruoyi-ui/src/views/hrm/flow/taskHistory.vue b/ruoyi-ui/src/views/hrm/flow/taskHistory.vue
new file mode 100644
index 0000000..5492357
--- /dev/null
+++ b/ruoyi-ui/src/views/hrm/flow/taskHistory.vue
@@ -0,0 +1,205 @@
+
+
+
+
+
+
+
+
+
+
+ {{ statusText(scope.row.status) }}
+
+
+
+
+ {{ bizTypeText(scope.row.bizType) }}
+ #{{ scope.row.bizId }}
+
+
+
+
+
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+
请在左侧选择一条任务
+
将展示业务信息、表单字段、流转历史
+
+
+
+
+
+
{{ bizTypeText(detailTask.bizType) }} · 任务 #{{ detailTask.taskId }}
+
+ {{ statusText(detailTask.status) }}
+ 实例 {{ detailTask.instId }} · 节点 {{ detailTask.nodeId }}
+
+
+
+
+
办理人
+
{{ formatUser(detailTask.assigneeUserId, 'userId') }}
+
+
+
到期
+
{{ formatDate(detailTask.expireTime) || '-' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ actionText(a.action) }}
+ · 办理人:{{ formatUser(a.createBy, 'createBy') }}
+
+
+
+
+
+ 暂无流转记录
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi-ui/src/views/hrm/index.vue b/ruoyi-ui/src/views/hrm/index.vue
index b896cf6..1825d9c 100644
--- a/ruoyi-ui/src/views/hrm/index.vue
+++ b/ruoyi-ui/src/views/hrm/index.vue
@@ -17,6 +17,9 @@
薪酬与指标
+
+ 审批历史
+
diff --git a/ruoyi-ui/src/views/hrm/js/History b/ruoyi-ui/src/views/hrm/js/History
new file mode 100644
index 0000000..3028a36
--- /dev/null
+++ b/ruoyi-ui/src/views/hrm/js/History
@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+
+// 获取审批历史(已完成)
+export function listHistoryFlowTask(query) {
+ return request({
+ url: '/workflow/task/historyList',
+ method: 'get',
+ params: query
+ })
+}
+
+// 任务详情
+export function getTodoTaskByBiz(taskId) {
+ return request({
+ url: '/workflow/task/getByTaskId/' + taskId,
+ method: 'get'
+ })
+}
+
+// 审批记录
+export function listFlowAction(query) {
+ return request({
+ url: '/workflow/instance/action/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 表单数据
+export function listFlowFormData(query) {
+ return request({
+ url: '/workflow/instance/form/data',
+ method: 'get',
+ params: query
+ })
+}
\ No newline at end of file