From 31ca694d4896268654064f9d41b66b859e2ed1ce Mon Sep 17 00:00:00 2001 From: chenxing Date: Wed, 23 Sep 2026 15:59:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(approval):=20/approval=20=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=BE=BE=E2=80=94=E2=80=94modId=20=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E5=AF=B9=E9=BD=90=20GetUserMod=20+=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=8C=89=20bsch=20=E5=BA=94=E7=94=A8=E9=A1=B5?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:/approval 与 /list/detail 的 meta.modId 同为 23,menuRoute.ts 的 ROUTE_BY_MODID 按注册 顺序取首条,23 恒解析为「通知详情」;菜单下发的 path 一旦未精确命中,兜底即串页 → 表现为点不到。 - routes.ts:modId 全量对齐 /base/GetUserMod(已收到 1000 / 已发送 2000 / 全部通知 3000 / 通知统计 4000 / 应用设置 5000 / 待审核 2100);深层页按「父×10+序」重排 (/list/new=20001、/list/detail=20002、/noticelist/detail=30001,parentId 同步); /approval 去掉 parentId,按一级模块处理;文件头契约注释重写 - NoticeApproval.vue:tabs-wrapper/tabs-panel[type=card] + main-container(v-show 保活); link-table table-bottom-box + useTableHeight;page-panel + customPageCount 记忆; 操作列 operatingTextHandle(通过 / 驳回 text-error,fixed:right); 状态列改用行级 cellClassName(status-color-N,本仓 view-ui-plus 为行级对象语义); 驳回弹窗改 Form + 必填红星,校验失败统一提示「请填写红色星号内容!」 - mock/noticeapi.ts、config/menu.ts:GetUserMod 六条全量对齐并补「待审核」(顺序按平台配置) --- src/assets/config/menu.ts | 11 +- src/assets/mock/noticeapi.ts | 12 +- src/router/routes.ts | 30 +-- src/views/notice/NoticeApproval.vue | 305 +++++++++++++++++----------- 4 files changed, 215 insertions(+), 143 deletions(-) diff --git a/src/assets/config/menu.ts b/src/assets/config/menu.ts index bf52862..ec4789d 100644 --- a/src/assets/config/menu.ts +++ b/src/assets/config/menu.ts @@ -6,11 +6,12 @@ import type { IModule } from "@/store"; */ export function getMenuList(): Promise { const menu: IModule[] = [ - { id: 1, modId: 1, name: "已收到", page: "/" }, - { id: 2, modId: 2, name: "已发送", page: "/list" }, - { id: 3, modId: 3, name: "全部通知", page: "/noticelist" }, - { id: 4, modId: 4, name: "通知统计", page: "/stats" }, - { id: 21, modId: 21, name: "应用设置", page: "/setting" }, + { id: 1000, modId: 1000, name: "已收到", page: "/" }, + { id: 2000, modId: 2000, name: "已发送", page: "/list" }, + { id: 3000, modId: 3000, name: "全部通知", page: "/noticelist" }, + { id: 2100, modId: 2100, name: "待审核", page: "/approval" }, + { id: 4000, modId: 4000, name: "通知统计", page: "/stats" }, + { id: 5000, modId: 5000, name: "应用设置", page: "/setting" }, ]; return Promise.resolve(menu); } diff --git a/src/assets/mock/noticeapi.ts b/src/assets/mock/noticeapi.ts index ab8adba..6ffa3a5 100644 --- a/src/assets/mock/noticeapi.ts +++ b/src/assets/mock/noticeapi.ts @@ -272,11 +272,13 @@ export default [ response: () => ok([ // icon:用户中心模块管理配置的 YschIcons 图标名,layout 渲染为 iconfont icon-<名称> - { id: 1, modId: 1, name: "已收到", parentId: 0, page: "/", icon: "sjx", orderNumber: 1, usable: true, children: [] }, - { id: 2, modId: 2, name: "已发送", parentId: 0, page: "/list", icon: "fasong", orderNumber: 2, usable: true, children: [] }, - { id: 3, modId: 3, name: "全部通知", parentId: 0, page: "/noticelist", icon: "liebiao", orderNumber: 3, usable: true, children: [] }, - { id: 4, modId: 4, name: "通知统计", parentId: 0, page: "/stats", icon: "tongji", orderNumber: 4, usable: true, children: [] }, - { id: 21, modId: 21, name: "应用设置", parentId: 0, page: "/setting", icon: "shezhi", orderNumber: 5, usable: true, children: [] }, + // id/modId 与平台模块管理的「配置 ID」一致(对照 /base/GetUserMod 现行数据) + { id: 1000, modId: 1000, name: "已收到", parentId: 0, page: "/", icon: "sjx", orderNumber: 1, usable: true, children: [] }, + { id: 2000, modId: 2000, name: "已发送", parentId: 0, page: "/list", icon: "fasong", orderNumber: 2, usable: true, children: [] }, + { id: 3000, modId: 3000, name: "全部通知", parentId: 0, page: "/noticelist", icon: "liebiao", orderNumber: 3, usable: true, children: [] }, + { id: 2100, modId: 2100, name: "待审核", parentId: 0, page: "/approval", icon: "", orderNumber: 4, usable: true, children: [] }, + { id: 4000, modId: 4000, name: "通知统计", parentId: 0, page: "/stats", icon: "tongji", orderNumber: 5, usable: true, children: [] }, + { id: 5000, modId: 5000, name: "应用设置", parentId: 0, page: "/setting", icon: "shezhi", orderNumber: 6, usable: true, children: [] }, ]), }, { diff --git a/src/router/routes.ts b/src/router/routes.ts index 5734f38..4ff2d45 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -9,10 +9,12 @@ import type { RouteRecordRaw } from "vue-router"; * - /list/detail?serid=&type=、/noticelist/detail?serid=&type= * type: 0=编辑视角(不标读) 1=普通查看(标读) * - * modId 是菜单 ↔ 路由的稳定契约(对照后端 GetUserMod 现行数据): - * 1=已收到 2=已发送 3=全部通知 4=通知统计 21=应用设置 - * 发通知为「已发送」的深层子页(modId 22 不在菜单树,meta.parentId=2 关联高亮), - * 与 UserBase「应用管理>应用类型管理」范式一致。 + * 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 配置为 "/",即应用入口页 @@ -20,14 +22,14 @@ const routes: RouteRecordRaw[] = [ path: "/", name: "notice_accept", component: () => import("@/views/notice/NoticeAccept.vue"), - meta: { title: "已收到", modId: 1 }, + meta: { title: "已收到", modId: 1000 }, }, // 已发送 { path: "/list", name: "notice_list", component: () => import("@/views/notice/NoticeList.vue"), - meta: { title: "已发送", modId: 2 }, + meta: { title: "已发送", modId: 2000 }, }, // 发通知(新建/编辑/转发/模板):已发送的深层子页,不在菜单里, // layout.vue 按.meta.parentId 推导面包屑「已发送>发通知」并高亮父菜单 @@ -35,14 +37,14 @@ const routes: RouteRecordRaw[] = [ path: "/list/new", name: "new_notice", component: () => import("@/views/notice/NewNotice.vue"), - meta: { title: "发通知", modId: 22, parentId: 2 }, + meta: { title: "发通知", modId: 20001, parentId: 2000 }, }, // 全部通知(管理端) { path: "/noticelist", name: "notice_manage", component: () => import("@/views/notice/NoticeList.vue"), - meta: { title: "全部通知", modId: 3 }, + meta: { title: "全部通知", modId: 3000 }, }, // 通知详情(同一组件挂两个路由,面包屑/菜单高亮由 meta.parentId 确定父节点: // 已发送下 /list/detail,全部通知下 /noticelist/detail;type 区分是否标读) @@ -50,34 +52,34 @@ const routes: RouteRecordRaw[] = [ path: "/list/detail", name: "notice_list_detail", component: () => import("@/views/notice/NoticeDetails.vue"), - meta: { title: "通知详情", modId: 23, parentId: 2 }, + meta: { title: "通知详情", modId: 20002, parentId: 2000 }, }, { path: "/noticelist/detail", name: "notice_manage_detail", component: () => import("@/views/notice/NoticeDetails.vue"), - meta: { title: "通知详情", modId: 24, parentId: 3 }, + meta: { title: "通知详情", modId: 30001, parentId: 3000 }, }, // 通知统计(旧版行为:整页跳转外部统计系统) { path: "/stats", name: "notice_stats", component: () => import("@/views/notice/NoticeStats.vue"), - meta: { title: "通知统计", modId: 4 }, + meta: { title: "通知统计", modId: 4000 }, }, // 应用设置(发文部门 + 自定义组) { path: "/setting", name: "notice_setting", component: () => import("@/views/notice/NoticeSetting.vue"), - meta: { title: "应用设置", modId: 21 }, + meta: { title: "应用设置", modId: 5000 }, }, - // 我的待审核(应用内审批;modId 23 深层页不在菜单树,菜单挂载待后端 GetUserMod 配置) + // 待审核(应用内审批;平台模块管理已挂一级菜单,配置 ID = 2100,path = /approval) { path: "/approval", name: "notice_approval", component: () => import("@/views/notice/NoticeApproval.vue"), - meta: { title: "我的待审核", modId: 23, parentId: 2 }, + meta: { title: "我的待审核", modId: 2100 }, }, /* ---- 旧版路径兼容重定向(书签、残留的平台模块配置) ---- */ diff --git a/src/views/notice/NoticeApproval.vue b/src/views/notice/NoticeApproval.vue index 14d460a..25c739b 100644 --- a/src/views/notice/NoticeApproval.vue +++ b/src/views/notice/NoticeApproval.vue @@ -1,129 +1,77 @@ - - -