Files
NoticeFront/src/router/routes.ts
T
chenxing 693aba9968
build / build (push) Successful in 2m41s
fix(menu): modId 契约全量对齐后端 /base/GetUserMod,解 /approval 与 /list/detail 撞车
- routes.ts:已收到1000/已发送2000/全部通知3000/通知统计4000/应用设置5000;
  深层页按 UserBase 范式编码 20001/20002/30001;/approval 独立 2100
  (原与通知详情同为 23,ROUTE_BY_MODID 取先注册者 → 待审核会被误解析到通知详情)。
- config/menu.ts、mock GetUserMod:id/modId 同步对齐。
- 不动 NoticeApproval.vue 主题改动;/cc 维持 25(与平台一致,未纳入本次对齐)。
2026-09-24 14:22:11 +08:00

112 lines
4.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { RouteRecordRaw } from "vue-router";
/**
* 通知公告模块路由(扁平短路由,与基础平台模块 path 一致)。
* 页面间参数通过 query 传递:
* - /list/new?serid= (编辑)
* - /list/new?fid= (转发)
* - /list/new?tempid=(模板引用)
* - /list/detail?serid=&type=、/noticelist/detail?serid=&type=
* type: 0=编辑视角(不标读) 1=普通查看(标读)
*
* modId 是菜单 ↔ 路由的稳定契约(对照后端 /base/GetUserMod 现行数据,即用户中心
* 模块管理里的配置 ID):
* 1000=已收到 2000=已发送 3000=全部通知 2100=待审核 4000=通知统计 5000=应用设置
* 深层子页不在菜单树,编码沿用 UserBase 范式「父模块 ×10 + 序号」并靠 meta.parentId
* 关联高亮:/list/new=20001、/list/detail=20002(父 2000),/noticelist/detail=30001(父 3000)。
* 深层页编码不得与任何平台一级模块 ID 重复。
*/
const routes: RouteRecordRaw[] = [
// 已收通知(收件箱):后端菜单 page 配置为 "/",即应用入口页
{
path: "/",
name: "notice_accept",
component: () => import("@/views/notice/NoticeAccept.vue"),
meta: { title: "已收到", modId: 1000 },
},
// 已发送
{
path: "/list",
name: "notice_list",
component: () => import("@/views/notice/NoticeList.vue"),
meta: { title: "已发送", modId: 2000 },
},
// 发通知(新建/编辑/转发/模板):已发送的深层子页,不在菜单里,
// layout.vue 按.meta.parentId 推导面包屑「已发送>发通知」并高亮父菜单
{
path: "/list/new",
name: "new_notice",
component: () => import("@/views/notice/NewNotice.vue"),
meta: { title: "发通知", modId: 20001, parentId: 2000 },
},
// 全部通知(管理端)
{
path: "/noticelist",
name: "notice_manage",
component: () => import("@/views/notice/NoticeList.vue"),
meta: { title: "全部通知", modId: 3000 },
},
// 通知详情(同一组件挂两个路由,面包屑/菜单高亮由 meta.parentId 确定父节点:
// 已发送下 /list/detail,全部通知下 /noticelist/detail;type 区分是否标读)
{
path: "/list/detail",
name: "notice_list_detail",
component: () => import("@/views/notice/NoticeDetails.vue"),
meta: { title: "通知详情", modId: 20002, parentId: 2000 },
},
{
path: "/noticelist/detail",
name: "notice_manage_detail",
component: () => import("@/views/notice/NoticeDetails.vue"),
meta: { title: "通知详情", modId: 30001, parentId: 3000 },
},
// 通知统计(旧版行为:整页跳转外部统计系统)
{
path: "/stats",
name: "notice_stats",
component: () => import("@/views/notice/NoticeStats.vue"),
meta: { title: "通知统计", modId: 4000 },
},
// 应用设置(发文部门 + 自定义组)
{
path: "/setting",
name: "notice_setting",
component: () => import("@/views/notice/NoticeSetting.vue"),
meta: { title: "应用设置", modId: 5000 },
},
// 待审核(应用内审批;平台模块管理已挂一级菜单,配置 ID = 2100,path = /approval)
{
path: "/approval",
name: "notice_approval",
component: () => import("@/views/notice/NoticeApproval.vue"),
meta: { title: "我的待审核", modId: 2100 },
},
// 抄送给我的(流程 NOTIFY 知会;modId 25 深层页不在菜单树,菜单挂载待后端 GetUserMod 配置;
// 勿复用 23——/list/detail 已占,modId 撞车会让菜单解析兜底到错误页面)
{
path: "/cc",
name: "notice_cc",
component: () => import("@/views/notice/NoticeCc.vue"),
meta: { title: "抄送给我的", modId: 25, parentId: 1 },
},
/* ---- 旧版路径兼容重定向(书签、残留的平台模块配置) ---- */
{ path: "/accept", redirect: "/" },
{ path: "/details", redirect: "/list/detail" },
{ path: "/newnotice", redirect: "/list/new" },
{ path: "/edit", redirect: "/list/new" },
{ path: "/manage", redirect: "/noticelist" },
{ path: "/notice", redirect: "/accept" },
{ path: "/notice/newnotice", redirect: "/list/new" },
{ path: "/notice/edit", redirect: "/list/new" },
{ path: "/notice/notice_accept", redirect: "/accept" },
{ path: "/notice/notice_list", redirect: "/list" },
{ path: "/notice/manage", redirect: "/noticelist" },
{ path: "/notice/notice_details", redirect: "/list/detail" },
{ path: "/notice/statistics", redirect: "/stats" },
{ path: "/notice/setting", redirect: "/setting" },
];
export default routes;