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 @@ diff --git a/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts b/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts index 77f10b0f..b33a3906 100644 --- a/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts +++ b/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts @@ -24,9 +24,9 @@ describe('InboundWorkflowWorkspace', () => { it('opens measurement editing and review in prototype-sized centered dialogs', () => { expect(source).toContain('title="编辑入库测量数据"') - expect(source).toContain('width="min(1900px, calc(100vw - 32px))"') + expect(source).toContain('width="min(1240px, calc(100vw - 32px))"') expect(source).toContain('title="审核入库测量数据"') - expect(source).toContain('width="min(1700px, calc(100vw - 32px))"') + expect(source).toContain('width="min(1240px, calc(100vw - 32px))"') expect(source).toContain('height: 92vh') expect(source).toContain('max-height: 92vh') expect(source).toContain('.el-dialog__body) { min-height: 0; flex: 1 1 auto; overflow-y: auto;') diff --git a/src/modules/inbounds/components/InboundWorkflowWorkspace.vue b/src/modules/inbounds/components/InboundWorkflowWorkspace.vue index c01eb4e4..cb6c61ab 100644 --- a/src/modules/inbounds/components/InboundWorkflowWorkspace.vue +++ b/src/modules/inbounds/components/InboundWorkflowWorkspace.vue @@ -1,6 +1,6 @@