From 0f0ae612ca716606f5aba434b67747e90041b46f Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Thu, 13 Aug 2026 19:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layouts/AppLayout.test.ts | 15 ++- src/app/layouts/AppLayout.vue | 27 ++---- src/app/router/index.test.ts | 2 +- src/core/navigation/adminNavigation.test.ts | 9 +- src/core/navigation/adminNavigation.ts | 11 --- .../components/InboundTaskList.test.ts | 8 ++ .../inbounds/components/InboundTaskList.vue | 7 +- .../InboundWorkflowWorkspace.test.ts | 4 +- .../components/InboundWorkflowWorkspace.vue | 26 +++-- src/modules/inbounds/index.ts | 1 + .../InboundMeasurementPanel.test.ts | 11 ++- .../measurement/InboundMeasurementPanel.vue | 44 +++++---- .../pages/InboundOrderDetailView.test.ts | 6 +- .../inbounds/pages/InboundOrderDetailView.vue | 31 +++--- .../review/MeasurementReviewPanel.vue | 94 +++++++++---------- src/modules/notifications/routes.ts | 6 -- .../pages/UnifiedOrdersView.test.ts | 4 + .../pages/UnifiedOrdersView.vue | 39 +++++++- 18 files changed, 175 insertions(+), 170 deletions(-) diff --git a/src/app/layouts/AppLayout.test.ts b/src/app/layouts/AppLayout.test.ts index c740c98e..af7cfc20 100644 --- a/src/app/layouts/AppLayout.test.ts +++ b/src/app/layouts/AppLayout.test.ts @@ -7,9 +7,6 @@ import { ElMessageBox } from 'element-plus' import { useAuthStore } from '@/core/auth/auth' import AppLayout from './AppLayout.vue' -const { getUnreadCount } = vi.hoisted(() => ({ getUnreadCount: vi.fn() })) -vi.mock('@/modules/notifications/api/notificationCenter', () => ({ getUnreadCount })) - const CachedPage = defineComponent({ setup() { const count = ref(0) @@ -29,14 +26,13 @@ async function mountLayout(path = '/') { const auth = useAuthStore() auth.token = 'token' auth.user = { id: '1', name: '平台管理员', account: 'admin', roles: ['PLATFORM_ADMIN'] } - auth.permissions = ['platform:warehouse:list', 'platform:notification:view'] + auth.permissions = ['platform:warehouse:list', 'platform:notification:task:list', 'platform:notification:template:list'] const router = createRouter({ history: createMemoryHistory(), routes: [ { path: '/', name: 'home', component: { template: '
page
' }, meta: { requiresAuth: true, workspaceTab: false, keepAlive: false } }, { path: '/customers', name: 'customers', component: CachedPage, meta: { title: '客户管理', showPageHeading: false, requiresAuth: true } }, { path: '/warehouses', name: 'warehouses', component: { template: 'warehouses
' }, meta: { title: '仓库管理', requiresAuth: true } }, - { path: '/notifications/mine', name: 'my-notifications', component: { template: 'messages
' }, meta: { title: '我的消息', requiresAuth: true } }, { path: '/login', component: { template: 'login
' } }, ], }) @@ -49,15 +45,16 @@ async function mountLayout(path = '/') { } describe('AppLayout', () => { - beforeEach(() => { vi.mocked(ElMessageBox.confirm).mockReset(); getUnreadCount.mockReset().mockResolvedValue(4) }) + beforeEach(() => { vi.mocked(ElMessageBox.confirm).mockReset() }) it('shows the authenticated identity without a role preview switcher', async () => { const { wrapper } = await mountLayout() expect(wrapper.text()).toContain('登录身份:平台管理员(admin)') expect(wrapper.text()).not.toContain('权限预览') - await flushPromises() - expect(wrapper.get('[aria-label="消息中心,4 条未读"]').attributes('disabled')).toBeUndefined() - expect(wrapper.get('.notification-count').text()).toBe('4') + expect(wrapper.get('[aria-label="消息中心"]').attributes('disabled')).toBeUndefined() + expect(wrapper.text()).toContain('消息管理') + expect(wrapper.text()).toContain('模板管理') + expect(wrapper.text()).not.toContain('我的消息') }) it('hides the shell heading when the route opts out', async () => { diff --git a/src/app/layouts/AppLayout.vue b/src/app/layouts/AppLayout.vue index 52834104..3b65b1ee 100644 --- a/src/app/layouts/AppLayout.vue +++ b/src/app/layouts/AppLayout.vue @@ -1,5 +1,5 @@ @@ -142,14 +135,13 @@ onBeforeUnmount(() => window.removeEventListener('cc-notification-unread-changed >{{ pageDescription }}